From d8e18c96a904667ce60366be22dbdf248006ff2e Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Sat, 10 Feb 2018 11:03:59 +0100 Subject: 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. --- src/nvim/mouse.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/mouse.c') diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 6f636f643a..96d20b6a32 100644 --- a/src/nvim/mouse.c +++ b/src/nvim/mouse.c @@ -108,12 +108,13 @@ retnomove: goto retnomove; // ugly goto... // Remember the character under the mouse, it might be a '-' or '+' in the - // fold column. + // fold column. NB: only works for ASCII chars! if (row >= 0 && row < Rows && col >= 0 && col <= Columns - && ScreenLines != NULL) - mouse_char = ScreenLines[LineOffset[row] + (unsigned)col]; - else + && ScreenLines != NULL) { + mouse_char = ScreenLines[LineOffset[row] + (unsigned)col][0]; + } else { mouse_char = ' '; + } old_curwin = curwin; old_cursor = curwin->w_cursor; -- cgit