]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.1506: line number not displayed when using 'smoothscroll' v9.0.1506
authorzeertzjq <zeertzjq@outlook.com>
Tue, 2 May 2023 19:52:59 +0000 (20:52 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 2 May 2023 19:52:59 +0000 (20:52 +0100)
Problem:    Line number not displayed when using 'smoothscroll'.
Solution:   Adjust condition for showing the line number. (closes #12333)

src/drawline.c
src/testdir/dumps/Test_smooth_number_10.dump [new file with mode: 0644]
src/testdir/dumps/Test_smooth_number_7.dump
src/testdir/dumps/Test_smooth_number_8.dump [new file with mode: 0644]
src/testdir/dumps/Test_smooth_number_9.dump [new file with mode: 0644]
src/testdir/test_scroll_opt.vim
src/version.c

index f3d70ed833e484c1fb02ac19b58d8883a38e7dab..e5fa15cbeded9020a0f23ccd714efadb08079445 100644 (file)
@@ -389,7 +389,7 @@ handle_lnum_col(
          // When there are text properties above the line put the line number
          // below them.
          if (wlv->row == lnum_row
-                   && (wp->w_skipcol == 0 || wlv->row > wp->w_winrow
+                   && (wp->w_skipcol == 0 || wlv->row > 0
                                               || (wp->w_p_nu && wp->w_p_rnu)))
          {
              long num;
diff --git a/src/testdir/dumps/Test_smooth_number_10.dump b/src/testdir/dumps/Test_smooth_number_10.dump
new file mode 100644 (file)
index 0000000..b617dc0
--- /dev/null
@@ -0,0 +1,12 @@
+|2+0#af5f00255#ffffff0|<+0#4040ff13&@2>o+0#0000000&|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e
+| +0#af5f00255&@3|x+0#0000000&|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r
+| +0#af5f00255&@3|y+0#0000000&| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g
+| +0#af5f00255&@3| +0#0000000&|t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| 
+| +0#af5f00255&@1|1| |t+0#0000000&|h|r|e@1| @30
+|~+0#4040ff13&| @38
+|~| @38
+|~| @38
+|~| @38
+|~| @38
+|~| @38
+|-+0#0000000&@1|N|o|.@2|e|r|-@1| @10|2|,|3|7| @9|B|o|t| 
index b617dc085557b13c3120ef27736e8f26c30bab1d..7219f8f7275b5b78339522dcf8bb9115f28ebed3 100644 (file)
@@ -1,12 +1,12 @@
-|2+0#af5f00255#ffffff0|<+0#4040ff13&@2>o+0#0000000&|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e
-| +0#af5f00255&@3|x+0#0000000&|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r
-| +0#af5f00255&@3|y+0#0000000&| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g
-| +0#af5f00255&@3| +0#0000000&|t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| |v|e|r|y| |l|o|n|g| |t|e|x|t| 
-| +0#af5f00255&@1|1| |t+0#0000000&|h|r|e@1| @30
-|~+0#4040ff13&| @38
-|~| @38
-|~| @38
-|~| @38
-|~| @38
-|~| @38
-|-+0#0000000&@1|N|o|.@2|e|r|-@1| @10|2|,|3|7| @9|B|o|t| 
+| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|e| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+| +0#af5f00255&@3|r+0#0000000&|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @4
+|@+0#4040ff13&@2| @36
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @8|3|,|1| @11|T|o|p
+| +0#af5f00255&@1|1| >o+0#0000000&|n|e| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+| +0#af5f00255&@3|r+0#0000000&|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @4
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+|@+0#4040ff13&@2| @36
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @8|1|,|1| @11|T|o|p
+|:+0&&|b|o|t|r|i|g|h|t| |s|p| @27
diff --git a/src/testdir/dumps/Test_smooth_number_8.dump b/src/testdir/dumps/Test_smooth_number_8.dump
new file mode 100644 (file)
index 0000000..edae52b
--- /dev/null
@@ -0,0 +1,12 @@
+| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|e| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+| +0#af5f00255&@3|r+0#0000000&|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @4
+|@+0#4040ff13&@2| @36
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @8|3|,|1| @11|T|o|p
+|<+0#4040ff13&@2| +0#af5f00255&|r+0#0000000&|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d> @4
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+| +0#af5f00255&@3|n+0#0000000&|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| @34
+|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @8|1|,|1|0|4| @9|T|o|p
+|:+0&&|b|o|t|r|i|g|h|t| |s|p| @27
diff --git a/src/testdir/dumps/Test_smooth_number_9.dump b/src/testdir/dumps/Test_smooth_number_9.dump
new file mode 100644 (file)
index 0000000..1243b39
--- /dev/null
@@ -0,0 +1,12 @@
+| +0#af5f00255#ffffff0@1|1| |o+0#0000000&|n|e| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o
+| +0#af5f00255&@3|r+0#0000000&|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| @4
+|@+0#4040ff13&@2| @36
+|[+1#0000000&|N|o| |N|a|m|e|]| |[|+|]| @8|3|,|1| @11|T|o|p
+|<+0#4040ff13&@2| +0#af5f00255&|d+0#0000000&| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d| |w|o|r|d> @4
+| +0#af5f00255&@1|2| |t+0#0000000&|w|o| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o
+| +0#af5f00255&@3|n+0#0000000&|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r|d| |l|o|n|g| |w|o|r
+| +0#af5f00255&@3|d+0#0000000&| @34
+| +0#af5f00255&@1|3| |l+0#0000000&|i|n|e| @31
+|[+3&&|N|o| |N|a|m|e|]| |[|+|]| @8|1|,|1|0|4| @9|T|o|p
+|:+0&&|b|o|t|r|i|g|h|t| |s|p| @27
index 01b1dafe36419016e80ee69d3d840e838fd88ea3..bab1e08fe8463b9891fbc7ffc1e8e034ad2b988c 100644 (file)
@@ -137,6 +137,7 @@ func Test_smoothscroll_number()
         'line',
       ])
       set smoothscroll
+      set splitkeep=topline
       set number cpo+=n
       :3
 
@@ -167,8 +168,16 @@ func Test_smoothscroll_number()
   call term_sendkeys(buf, "\<C-Y>")
   call VerifyScreenDump(buf, 'Test_smooth_number_6', {})
 
-  call term_sendkeys(buf, ":call DoRel()\<CR>")
+  call term_sendkeys(buf, ":botright split\<CR>gg")
   call VerifyScreenDump(buf, 'Test_smooth_number_7', {})
+  call term_sendkeys(buf, "\<C-E>")
+  call VerifyScreenDump(buf, 'Test_smooth_number_8', {})
+  call term_sendkeys(buf, "\<C-E>")
+  call VerifyScreenDump(buf, 'Test_smooth_number_9', {})
+  call term_sendkeys(buf, ":close\<CR>")
+
+  call term_sendkeys(buf, ":call DoRel()\<CR>")
+  call VerifyScreenDump(buf, 'Test_smooth_number_10', {})
 
   call StopVimInTerminal(buf)
 endfunc
index d01d7f26bd1a3626252ba2b394933817f8bb597f..b70825408a1633f1a8e49b95fc46ef0df10f1653 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1506,
 /**/
     1505,
 /**/