mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
screen: use UTF-8 representation
Store text in ScreenLines as UTF-8, so it can be sent as-is to the UI layer. `utfc_char2bytes(off,buf)` is removed, as `ScreenLines[off]` now already contains this representation. To recover the codepoints that the screen arrays previously contained, use utfc_ptr2char (or utf_ptr2char to ignore composing chars). NB: This commit does NOT change how screen.c processes incoming UTF-8 data from buffers, cmdline, messages etc. Any algorithm that operates on UCS-4 (like arabic shaping, treatment of non-printable chars) is left unchanged for now.
This commit is contained in:
@@ -13994,10 +13994,7 @@ static void f_screenchar(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
c = -1;
|
||||
} else {
|
||||
off = LineOffset[row] + col;
|
||||
if (enc_utf8 && ScreenLinesUC[off] != 0)
|
||||
c = ScreenLinesUC[off];
|
||||
else
|
||||
c = ScreenLines[off];
|
||||
c = utf_ptr2char(ScreenLines[off]);
|
||||
}
|
||||
rettv->vval.v_number = c;
|
||||
}
|
||||
|
Reference in New Issue
Block a user