mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
Fixes #2317. Drivers do not normalize accented letters.
This commit is contained in:
@@ -62,40 +62,59 @@ namespace Terminal.Gui {
|
||||
Curses.move (crow, ccol);
|
||||
needMove = false;
|
||||
}
|
||||
if (runeWidth < 2 && ccol > 0
|
||||
&& Rune.ColumnWidth ((char)contents [crow, ccol - 1, 0]) > 1) {
|
||||
if (runeWidth == 0 && ccol > 0) {
|
||||
var r = contents [crow, ccol - 1, 0];
|
||||
var s = new string (new char [] { (char)r, (char)rune });
|
||||
string sn;
|
||||
if (!s.IsNormalized ()) {
|
||||
sn = s.Normalize ();
|
||||
} else {
|
||||
sn = s;
|
||||
}
|
||||
var c = sn [0];
|
||||
Curses.mvaddch (crow, ccol - 1, (int)(uint)c);
|
||||
contents [crow, ccol - 1, 0] = c;
|
||||
contents [crow, ccol - 1, 1] = currentAttribute;
|
||||
contents [crow, ccol - 1, 2] = 1;
|
||||
|
||||
var curAtttib = currentAttribute;
|
||||
Curses.attrset (contents [crow, ccol - 1, 1]);
|
||||
Curses.mvaddch (crow, ccol - 1, (int)(uint)' ');
|
||||
contents [crow, ccol - 1, 0] = (int)(uint)' ';
|
||||
Curses.move (crow, ccol);
|
||||
Curses.attrset (curAtttib);
|
||||
|
||||
} else if (runeWidth < 2 && ccol <= Clip.Right - 1
|
||||
&& Rune.ColumnWidth ((char)contents [crow, ccol, 0]) > 1) {
|
||||
|
||||
var curAtttib = currentAttribute;
|
||||
Curses.attrset (contents [crow, ccol + 1, 1]);
|
||||
Curses.mvaddch (crow, ccol + 1, (int)(uint)' ');
|
||||
contents [crow, ccol + 1, 0] = (int)(uint)' ';
|
||||
Curses.move (crow, ccol);
|
||||
Curses.attrset (curAtttib);
|
||||
|
||||
}
|
||||
if (runeWidth > 1 && ccol == Clip.Right - 1) {
|
||||
Curses.addch ((int)(uint)' ');
|
||||
contents [crow, ccol, 0] = (int)(uint)' ';
|
||||
} else {
|
||||
Curses.addch ((int)(uint)rune);
|
||||
contents [crow, ccol, 0] = (int)(uint)rune;
|
||||
if (runeWidth < 2 && ccol > 0
|
||||
&& Rune.ColumnWidth ((char)contents [crow, ccol - 1, 0]) > 1) {
|
||||
|
||||
var curAtttib = currentAttribute;
|
||||
Curses.attrset (contents [crow, ccol - 1, 1]);
|
||||
Curses.mvaddch (crow, ccol - 1, (int)(uint)' ');
|
||||
contents [crow, ccol - 1, 0] = (int)(uint)' ';
|
||||
Curses.move (crow, ccol);
|
||||
Curses.attrset (curAtttib);
|
||||
|
||||
} else if (runeWidth < 2 && ccol <= Clip.Right - 1
|
||||
&& Rune.ColumnWidth ((char)contents [crow, ccol, 0]) > 1) {
|
||||
|
||||
var curAtttib = currentAttribute;
|
||||
Curses.attrset (contents [crow, ccol + 1, 1]);
|
||||
Curses.mvaddch (crow, ccol + 1, (int)(uint)' ');
|
||||
contents [crow, ccol + 1, 0] = (int)(uint)' ';
|
||||
Curses.move (crow, ccol);
|
||||
Curses.attrset (curAtttib);
|
||||
|
||||
}
|
||||
if (runeWidth > 1 && ccol == Clip.Right - 1) {
|
||||
Curses.addch ((int)(uint)' ');
|
||||
contents [crow, ccol, 0] = (int)(uint)' ';
|
||||
} else {
|
||||
Curses.addch ((int)(uint)rune);
|
||||
contents [crow, ccol, 0] = (int)(uint)rune;
|
||||
}
|
||||
contents [crow, ccol, 1] = currentAttribute;
|
||||
contents [crow, ccol, 2] = 1;
|
||||
}
|
||||
contents [crow, ccol, 1] = currentAttribute;
|
||||
contents [crow, ccol, 2] = 1;
|
||||
} else
|
||||
needMove = true;
|
||||
|
||||
ccol++;
|
||||
if (runeWidth < 0 || runeWidth > 0) {
|
||||
ccol++;
|
||||
}
|
||||
if (runeWidth > 1) {
|
||||
if (validClip && ccol < Clip.Right) {
|
||||
contents [crow, ccol, 1] = currentAttribute;
|
||||
|
||||
Reference in New Issue
Block a user