-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimdoc.diff
More file actions
42 lines (39 loc) · 1.64 KB
/
Copy pathvimdoc.diff
File metadata and controls
42 lines (39 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 0d7110385..c72a7f2ba 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -1,4 +1,4 @@
-*builtin.txt* For Vim version 9.2. Last change: 2026 Sep 13
+*builtin.txt* For Vim version 9.2. Last change: 2026 Sep 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -5260,6 +5260,31 @@ getregionpos({pos1}, {pos2} [, {opts}]) *getregionpos()*
value of 0 is used for both positions.
(default: |FALSE|)
+ bounds If |TRUE|, return only the outer
+ bounds of the region as a single
+ pair: >
+ [[{start_pos}, {end_pos}]]
+< {start_pos} is the start position on
+ the first line of the region and
+ {end_pos} the end position on its
+ last line. The lines in between are
+ not visited, which is much faster for
+ a large region.
+ (default: |FALSE|)
+
+ Using "bounds" with the same {opts} is equivalent to taking
+ the outer positions of the full result: >
+ let full = getregionpos(pos1, pos2, opts)
+ let bounds = [[full[0][0], full[-1][1]]]
+< When the full result is empty, e.g. because {pos1} and {pos2}
+ are in different buffers, the result is empty as well.
+ Note that the two positions then come from different lines, so
+ they describe a diagonal of the region and not its shape. For
+ a blockwise region they are the start of the first line and
+ the end of the last line, not the corners of the block.
+ Likewise, when the first line is empty and "eol" is |FALSE|,
+ {start_pos} has a "col" of 0 while {end_pos} may not.
+
Can also be used as a |method|: >
getpos('.')->getregionpos(getpos("'a"))
<