aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStanley Chan <pocketgamer5000@gmail.com>2020-10-01 22:56:46 -0500
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-10-16 21:56:55 -0400
commit306d96cd10da8ca1dd3ca22e71a4815403e819a4 (patch)
tree5f7eb912f3be317c5ead58aba4ca1797fc0acbde /src
parentc4cbf16c917c619057ad4711a0121146420a7d74 (diff)
downloadrneovim-306d96cd10da8ca1dd3ca22e71a4815403e819a4.tar.gz
rneovim-306d96cd10da8ca1dd3ca22e71a4815403e819a4.tar.bz2
rneovim-306d96cd10da8ca1dd3ca22e71a4815403e819a4.zip
vim-patch:8.1.2419: with a long file name the hit-enter prompt appears
Problem: With a long file name the hit-enter prompt appears. (J. Lewis Muir) Solution: When checking for text to wrap don't do this when outputing a CR. https://github.com/vim/vim/commit/0efd1bdcf4891f9ef2537e4c3d50a379186dca5f
Diffstat (limited to 'src')
-rw-r--r--src/nvim/message.c2
-rw-r--r--src/nvim/testdir/test_display.vim17
2 files changed, 18 insertions, 1 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 594940ca10..6e2a221ab0 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -2000,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