]> granicus.if.org Git - vim/commitdiff
patch 8.1.2419: with a long file name the hit-enter prompt appears v8.1.2419
authorBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2019 18:00:04 +0000 (19:00 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 11 Dec 2019 18:00:04 +0000 (19:00 +0100)
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.

src/message.c
src/testdir/dumps/Test_long_file_name_1.dump [new file with mode: 0644]
src/testdir/test_display.vim
src/version.c

index 9ecd194b595bc97ac09c9f5374d03b7fb71fae0b..0b690bb5d3a7e207b2242e9eb4fab15801972986 100644 (file)
@@ -2080,7 +2080,7 @@ msg_puts_display(
                      || (has_mbyte && (*mb_ptr2cells)(s) > 1 && msg_col <= 2))
                    :
 #endif
-                     (msg_col + t_col >= Columns - 1
+                     ((*s != '\r' && msg_col + t_col >= Columns - 1)
                       || (*s == TAB && msg_col + t_col >= ((Columns - 1) & ~7))
                       || (has_mbyte && (*mb_ptr2cells)(s) > 1
                                         && msg_col + t_col >= Columns - 2)))))
diff --git a/src/testdir/dumps/Test_long_file_name_1.dump b/src/testdir/dumps/Test_long_file_name_1.dump
new file mode 100644 (file)
index 0000000..46fa9bd
--- /dev/null
@@ -0,0 +1,8 @@
+> +0&#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|<+0#0000000&|x@64|"| |0|L|,| |0|C| 
index a25d2cfe08fb9cd1e2839bd39b24b9f2a13bd06e..4ef361e05bbca0b26d186a5a5de68416f75fa9b7 100644 (file)
@@ -181,3 +181,21 @@ func Test_scroll_CursorLineNr_update()
   call StopVimInTerminal(buf)
   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
+
index ecdcb9c7faa9ec7f436fea13dd816e5fdba1cd92..2b992df9490a28783423ad4e277a2667561160de 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2419,
 /**/
     2418,
 /**/