]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1249: tests: no test that 'listchars' "eol" doesn't affect "gM" v9.1.1249
authorzeertzjq <zeertzjq@outlook.com>
Thu, 27 Mar 2025 17:21:49 +0000 (18:21 +0100)
committerChristian Brabandt <cb@256bit.org>
Thu, 27 Mar 2025 17:21:49 +0000 (18:21 +0100)
Problem:  No test that 'listchars' "eol" doesn't affect "gM".
Solution: Add a test (zeertzjq).

closes: #16990

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/testdir/test_normal.vim
src/version.c

index 75a3028b6df57ba02a10e1a87cce2341de2d88bd..35c290c8d7163f8a8ad9d3bffcfc192362f50c49 100644 (file)
@@ -2698,6 +2698,22 @@ func Test_normal33_g_cmd2()
   call assert_equal(87, col('.'))
   call assert_equal('E', getreg(0))
 
+  " Have an odd number of chars in the line
+  norm! A.
+  call assert_equal(145, col('.'))
+  norm! gMyl
+  call assert_equal(73, col('.'))
+  call assert_equal('0', getreg(0))
+
+  " 'listchars' "eol" should not affect gM behavior
+  setlocal list listchars=eol:$
+  norm! $
+  call assert_equal(145, col('.'))
+  norm! gMyl
+  call assert_equal(73, col('.'))
+  call assert_equal('0', getreg(0))
+  setlocal nolist
+
   " Test for gM with Tab characters
   call setline('.', "\ta\tb\tc\td\te\tf")
   norm! gMyl
index 9569a09fe3dfb8a7d11e4623ae82856efd4b2e7b..7339d58f25637894d1dace3cffbffa17e9f1dfdc 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1249,
 /**/
     1248,
 /**/