]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(doc): clarify the effect of exclusive single char selections
authorChristian Brabandt <cb@256bit.org>
Mon, 2 Jun 2025 17:56:57 +0000 (19:56 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 2 Jun 2025 17:56:57 +0000 (19:56 +0200)
closes: #17410

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

index 8cce98a3fd28c58de7e37518b36eea9d2d4dd9bc..3105a3d7d29d2ef6f8ee7f286088a4a0d8118d35 100644 (file)
@@ -1,4 +1,4 @@
-*builtin.txt*  For Vim version 9.1.  Last change: 2025 Jun 01
+*builtin.txt*  For Vim version 9.1.  Last change: 2025 Jun 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -5042,6 +5042,10 @@ getregion({pos1}, {pos2} [, {opts}])                     *getregion()*
                - It is evaluated in current window context, which makes a
                  difference if the buffer is displayed in a window with
                  different 'virtualedit' or 'list' values.
+               - When specifying an exclusive selection and {pos1} and {pos2}
+                 are equal, the returned list contains a single character as
+                 if selection is inclusive, to match the behavior of an empty
+                 exclusive selection in Visual mode.
 
                Examples: >
                        :xnoremap <CR>
index cc0a5e652753e8f024730924729f3cca80dfb4d7..5c6fbfbef1a0f5cc2ac9efb2d411f8f044207679 100644 (file)
@@ -1,4 +1,4 @@
-*options.txt*  For Vim version 9.1.  Last change: 2025 Jun 01
+*options.txt*  For Vim version 9.1.  Last change: 2025 Jun 02
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -7199,9 +7199,14 @@ A jump table for the options with a short description can be found at |Q_op|.
        the end of line the line break still isn't included.
        When "exclusive" is used, cursor position in visual mode will be
        adjusted for inclusive motions |inclusive-motion-selection-exclusive|.
-       Note that when "exclusive" is used and selecting from the end
-       backwards, you cannot include the last character of a line, when
-       starting in Normal mode and 'virtualedit' empty.
+
+       Note:
+       - When "exclusive" is used and selecting from the end backwards, you
+         cannot include the last character of a line, when starting in Normal
+         mode and 'virtualedit' empty.
+       - when "exclusive" is used with a single character visual selection,
+         Vim will behave as if the 'selection' is inclusive (in other words,
+         you cannot visually select an empty region).
 
        The 'selection' option is set by the |:behave| command.