diff options
Diffstat (limited to 'src/nvim/mouse.c')
| -rw-r--r-- | src/nvim/mouse.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/mouse.c b/src/nvim/mouse.c index 6f636f643a..8c615f52e7 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; @@ -525,7 +526,7 @@ static colnr_T scroll_line_len(linenr_T lnum) if (*line != NUL) { for (;;) { int numchar = chartabsize(line, col); - mb_ptr_adv(line); + MB_PTR_ADV(line); if (*line == NUL) { // don't count the last character break; } |
