]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(doc): use a single pattern in :h 'incsearch' example
authorzeertzjq <zeertzjq@outlook.com>
Thu, 11 Sep 2025 19:08:57 +0000 (15:08 -0400)
committerChristian Brabandt <cb@256bit.org>
Thu, 11 Sep 2025 19:08:57 +0000 (15:08 -0400)
related: https://github.com/vim/vim/pull/18262#issuecomment-3277008408
closes: #18270

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/doc/autocmd.txt
runtime/doc/options.txt

index 66e94b0b8beb0762e142989c36ee6b8c7cddea7f..490ad44563dfbe996c94b76c11c10d62520d52b9 100644 (file)
@@ -1,4 +1,4 @@
-*autocmd.txt*   For Vim version 9.1.  Last change: 2025 Sep 02
+*autocmd.txt*   For Vim version 9.1.  Last change: 2025 Sep 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1629,7 +1629,8 @@ The pattern is interpreted like mostly used in file names:
 
 Note that for all systems the '/' character is used for path separator (even
 for MS-Windows).  This was done because the backslash is difficult to use in a
-pattern and to make the autocommands portable across different systems.
+pattern and to make the autocommands portable across different systems.  To
+only match a '/' on all platforms (e.g. in a non-file pattern), use "\/".
 
 It is possible to use |pattern| items, but they may not work as expected,
 because of the translation done for the above.
index 6d6f341bcb725f29b943b4493d35f8d94416f4b5..7d891a1cfc5df37ff7f6ba8f5fe2bbdb96f9a99c 100644 (file)
@@ -5088,8 +5088,8 @@ A jump table for the options with a short description can be found at |Q_op|.
        autocmd.  Example: >
                augroup vimrc-incsearch-highlight
                  autocmd!
-                 autocmd CmdlineEnter /,\? :set hlsearch
-                 autocmd CmdlineLeave /,\? :set nohlsearch
+                 autocmd CmdlineEnter [\/\?] :set hlsearch
+                 autocmd CmdlineLeave [\/\?] :set nohlsearch
                augroup END
 <
        CTRL-L can be used to add one character from after the current match