diff options
Diffstat (limited to 'src/nvim/message.c')
| -rw-r--r-- | src/nvim/message.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index dea6696f55..ec5dabbbc0 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -131,7 +131,7 @@ static int msg_grid_scroll_discount = 0; static void ui_ext_msg_set_pos(int row, bool scrolled) { - char buf[MAX_MCO]; + char buf[MAX_MCO + 1]; size_t size = utf_char2bytes(curwin->w_p_fcs_chars.msgsep, (char_u *)buf); buf[size] = '\0'; ui_call_msg_set_pos(msg_grid.handle, row, scrolled, @@ -165,6 +165,7 @@ void msg_grid_validate(void) // TODO(bfredl): eventually should be set to "invalid". I e all callers // will use the grid including clear to EOS if necessary. grid_alloc(&msg_grid, Rows, Columns, false, true); + msg_grid.zindex = kZIndexMessages; xfree(msg_grid.dirty_col); msg_grid.dirty_col = xcalloc(Rows, sizeof(*msg_grid.dirty_col)); @@ -869,18 +870,18 @@ char_u *msg_trunc_attr(char_u *s, int force, int attr) */ char_u *msg_may_trunc(int force, char_u *s) { - int n; int room; room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1; if ((force || (shortmess(SHM_TRUNC) && !exmode_active)) - && (n = (int)STRLEN(s) - room) > 0) { + && (int)STRLEN(s) - room > 0) { int size = vim_strsize(s); // There may be room anyway when there are multibyte chars. if (size <= room) { return s; } + int n; for (n = 0; size >= room; ) { size -= utf_ptr2cells(s + n); n += utfc_ptr2len(s + n); @@ -1193,7 +1194,8 @@ void wait_return(int redraw) || c == K_MIDDLEDRAG || c == K_MIDDLERELEASE || c == K_RIGHTDRAG || c == K_RIGHTRELEASE || c == K_MOUSELEFT || c == K_MOUSERIGHT - || c == K_MOUSEDOWN || c == K_MOUSEUP); + || c == K_MOUSEDOWN || c == K_MOUSEUP + || c == K_MOUSEMOVE); os_breakcheck(); /* * Avoid that the mouse-up event causes visual mode to start. @@ -2265,12 +2267,14 @@ void msg_scroll_up(bool may_throttle) /// per screen update. /// /// NB: The bookkeeping is quite messy, and rests on a bunch of poorly -/// documented assumtions. For instance that the message area always grows while -/// being throttled, messages are only being output on the last line etc. +/// documented assumptions. For instance that the message area always grows +/// while being throttled, messages are only being output on the last line +/// etc. /// -/// Probably message scrollback storage should reimplented as a file_buffer, and -/// message scrolling in TUI be reimplemented as a modal floating window. Then -/// we get throttling "for free" using standard redraw_later code paths. +/// Probably message scrollback storage should be reimplemented as a +/// file_buffer, and message scrolling in TUI be reimplemented as a modal +/// floating window. Then we get throttling "for free" using standard +/// redraw_later code paths. void msg_scroll_flush(void) { if (msg_grid.throttled) { |
