]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0684: :reg # does not display the value of the '#' register v9.2.0684
authorDoug Kearns <dougkearns@gmail.com>
Sun, 21 Jun 2026 13:03:21 +0000 (13:03 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 21 Jun 2026 13:03:21 +0000 (13:03 +0000)
Problem:  ':registers #' does not display the value of the '#' register.
Solution: Filter the '#' :registers output on a '#' arg instead of '%'
          (Doug Kearns).

closes: #20589

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/register.c
src/testdir/test_registers.vim
src/version.c

index 971cd70891aae2033f4bafad51d4de62b1e4b634..95a1145e43e0fde0f31aeaf7b3d0f13bf02fca9a 100644 (file)
@@ -2759,7 +2759,7 @@ ex_display(exarg_T *eap)
     }
 
     // display alternate file name
-    if ((arg == NULL || vim_strchr(arg, '%') != NULL) && !got_int)
+    if ((arg == NULL || vim_strchr(arg, '#') != NULL) && !got_int)
     {
        char_u      *fname;
        linenr_T    dummy;
index 1bf3d6f6078783300ba2d1578bca2b4eef33b8d0..e1c493ac4b10589fea85b22346fb5ebbec52522e 100644 (file)
@@ -51,7 +51,7 @@ func Test_display_registers()
     " these commands work in the sandbox
     let a = execute('sandbox display')
     " When X11 connection is not available, there is a warning W23
-    " filter this out (we could also run the :display comamand twice)
+    " filter this out (we could also run the :display command twice)
     let a = substitute(a, 'W23.*0\n', '', '')
     let b = execute('sandbox registers')
 
@@ -77,6 +77,14 @@ func Test_display_registers()
     call assert_match('^\nType Name Content\n'
           \ .         '  c  ":   ls', a)
 
+    let a = execute('registers %')
+    call assert_match('^\nType Name Content\n'
+          \ .         '  c  "%   file2', a)
+
+    let a = execute('registers #')
+    call assert_match('^\nType Name Content\n'
+          \ .         '  c  "#   file1', a)
+
     bwipe!
 endfunc
 
index fc1ecbce0d41d4349be6d111e86b87ba375c41f4..9fba8ef19cc72bba11d82b5b6d40dfe663eae7ef 100644 (file)
@@ -759,6 +759,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    684,
 /**/
     683,
 /**/