diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-17 21:48:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-17 21:48:51 -0400 |
commit | e744631647a0b1fcd33d09f48aa206a16459c53a (patch) | |
tree | 6806c39cb465d2566a603ceea6b99c4d57e77968 /src | |
parent | 0ad5b34170920064a415cfcbb01960530ec5f615 (diff) | |
parent | 306d96cd10da8ca1dd3ca22e71a4815403e819a4 (diff) | |
download | rneovim-e744631647a0b1fcd33d09f48aa206a16459c53a.tar.gz rneovim-e744631647a0b1fcd33d09f48aa206a16459c53a.tar.bz2 rneovim-e744631647a0b1fcd33d09f48aa206a16459c53a.zip |
Merge pull request #13100 from janlazo/vim-8.1.2141
vim-patch:8.1.{2141,2419}
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/message.c | 5 | ||||
-rw-r--r-- | src/nvim/testdir/test_display.vim | 17 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c index e4f47917ec..6e2a221ab0 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -1886,6 +1886,7 @@ void msg_puts_attr_len(const char *const str, const ptrdiff_t len, int attr) // wait-return prompt later. Needed when scrolling, resetting // need_wait_return after some prompt, and then outputting something // without scrolling + // Not needed when only using CR to move the cursor. bool overflow = false; if (ui_has(kUIMessages)) { int count = msg_ext_visible + (msg_ext_overwrite ? 0 : 1); @@ -1897,7 +1898,7 @@ void msg_puts_attr_len(const char *const str, const ptrdiff_t len, int attr) overflow = msg_scrolled != 0; } - if (overflow && !msg_scrolled_ign) { + if (overflow && !msg_scrolled_ign && strcmp(str, "\r") != 0) { need_wait_return = true; } msg_didany = true; // remember that something was outputted @@ -1999,7 +2000,7 @@ static void msg_puts_display(const char_u *str, int maxlen, int attr, || (*s == TAB && msg_col <= 7) || (utf_ptr2cells(s) > 1 && msg_col <= 2)) - : (msg_col + t_col >= Columns - 1 + : ((*s != '\r' && msg_col + t_col >= Columns - 1) || (*s == TAB && msg_col + t_col >= ((Columns - 1) & ~7)) || (utf_ptr2cells(s) > 1 diff --git a/src/nvim/testdir/test_display.vim b/src/nvim/testdir/test_display.vim index e853b046dc..a177f6140e 100644 --- a/src/nvim/testdir/test_display.vim +++ b/src/nvim/testdir/test_display.vim @@ -185,6 +185,23 @@ func Test_scroll_CursorLineNr_update() call delete(filename) endfunc +" check a long file name does not result in the hit-enter prompt +func Test_edit_long_file_name() + CheckScreendump + + let longName = 'x'->repeat(&columns) + call writefile([], longName) + let buf = RunVimInTerminal('-N -u NONE ' .. longName, #{rows: 8}) + + call VerifyScreenDump(buf, 'Test_long_file_name_1', {}) + + call term_sendkeys(buf, ":q\<cr>") + + " clean up + call StopVimInTerminal(buf) + call delete(longName) +endfunc + " Test for scrolling that modifies buffer during visual block func Test_visual_block_scroll() " See test/functional/legacy/visual_mode_spec.lua |