Skip to content

Commit bfeefc4

Browse files
chrisbrazeertzjq
andcommitted
runtime(doc): clarify the effect of exclusive single char selections
closes: #17410 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent d5fdfa5 commit bfeefc4

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

runtime/doc/builtin.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*builtin.txt* For Vim version 9.1. Last change: 2025 Jun 01
1+
*builtin.txt* For Vim version 9.1. Last change: 2025 Jun 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5042,6 +5042,10 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()*
50425042
- It is evaluated in current window context, which makes a
50435043
difference if the buffer is displayed in a window with
50445044
different 'virtualedit' or 'list' values.
5045+
- When specifying an exclusive selection and {pos1} and {pos2}
5046+
are equal, the returned list contains a single character as
5047+
if selection is inclusive, to match the behavior of an empty
5048+
exclusive selection in Visual mode.
50455049

50465050
Examples: >
50475051
:xnoremap <CR>

runtime/doc/options.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*options.txt* For Vim version 9.1. Last change: 2025 Jun 01
1+
*options.txt* For Vim version 9.1. Last change: 2025 Jun 02
22

33

44
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|.
71997199
the end of line the line break still isn't included.
72007200
When "exclusive" is used, cursor position in visual mode will be
72017201
adjusted for inclusive motions |inclusive-motion-selection-exclusive|.
7202-
Note that when "exclusive" is used and selecting from the end
7203-
backwards, you cannot include the last character of a line, when
7204-
starting in Normal mode and 'virtualedit' empty.
7202+
7203+
Note:
7204+
- When "exclusive" is used and selecting from the end backwards, you
7205+
cannot include the last character of a line, when starting in Normal
7206+
mode and 'virtualedit' empty.
7207+
- when "exclusive" is used with a single character visual selection,
7208+
Vim will behave as if the 'selection' is inclusive (in other words,
7209+
you cannot visually select an empty region).
72057210

72067211
The 'selection' option is set by the |:behave| command.
72077212

0 commit comments

Comments
 (0)