diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2018-03-31 11:12:27 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-03-31 11:12:27 +0200 |
commit | 98e71123900fbdf26a16a43297a1f58118cde41b (patch) | |
tree | 6150b62965361020e20c6d0c0dde285a1d1f0ffb /src/nvim/message.c | |
parent | 362346f56334d05d080be05ae4b8c9902dbdc3f7 (diff) | |
download | rneovim-98e71123900fbdf26a16a43297a1f58118cde41b.tar.gz rneovim-98e71123900fbdf26a16a43297a1f58118cde41b.tar.bz2 rneovim-98e71123900fbdf26a16a43297a1f58118cde41b.zip |
msg: do not scroll entire screen (#8088)
Diffstat (limited to 'src/nvim/message.c')
-rw-r--r-- | src/nvim/message.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index 12e5b844be..04528629c7 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1875,13 +1875,29 @@ bool message_filtered(char_u *msg) return cmdmod.filter_force ? match : !match; } +/// including horizontal separator +int msg_scrollsize(void) +{ + return msg_scrolled + p_ch + 1; +} + /* * Scroll the screen up one line for displaying the next message line. */ static void msg_scroll_up(void) { - /* scrolling up always works */ - screen_del_lines(0, 0, 1, (int)Rows, NULL); + if (dy_flags & DY_MSGSEP) { + if (msg_scrolled == 0) { + screen_fill(Rows-p_ch-1, Rows-p_ch, 0, (int)Columns, + fill_msgsep, fill_msgsep, hl_attr(HLF_MSGSEP)); + } + int nscroll = MIN(msg_scrollsize()+1, Rows); + ui_call_set_scroll_region(Rows-nscroll, Rows-1, 0, Columns-1); + screen_del_lines(Rows-nscroll, 0, 1, nscroll, NULL); + ui_reset_scroll_region(); + } else { + screen_del_lines(0, 0, 1, (int)Rows, NULL); + } } /* |