diff options
author | Shougo Matsushita <Shougo.Matsu@gmail.com> | 2024-03-06 21:10:18 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-03-06 21:39:35 +0100 |
commit | 84bf6e658da51126bdd2e50af1f40cabd149343f (patch) | |
tree | b4f6f41e0aef65137c196d10a8507553ca699af7 /runtime | |
parent | 9db39b0ec90600bb41faec3a12b934b17c298b1f (diff) |
patch 9.1.0155: can only get getregion() from current bufferv9.1.0155
Problem: can only call getregion() for current buffer
Solution: Allow to retrieve selections from different buffers
(Shougo Matsushita)
closes: #14131
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 15 | ||||
-rw-r--r-- | runtime/doc/tags | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 0d47e36531..09b4dd068e 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -1,4 +1,4 @@ -*builtin.txt* For Vim version 9.1. Last change: 2024 Mar 03 +*builtin.txt* For Vim version 9.1. Last change: 2024 Mar 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -4274,11 +4274,13 @@ getreginfo([{regname}]) *getreginfo()* GetRegname()->getreginfo() getregion({pos1}, {pos2} [, {opts}]) *getregion()* - Returns the list of strings from {pos1} to {pos2} in current + Returns the list of strings from {pos1} to {pos2} from a buffer. {pos1} and {pos2} must both be |List|s with four numbers. - See |getpos()| for the format of the list. + See |getpos()| for the format of the list. It's possible + to specify positions from a different buffer, but please + note the limitations at |getregion-notes| The optional argument {opts} is a Dict and supports the following items: @@ -4299,6 +4301,7 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()* This function is useful to get text starting and ending in different columns, such as a |characterwise-visual| selection. + *getregion-notes* Note that: - Order of {pos1} and {pos2} doesn't matter, it will always return content from the upper left position to the lower @@ -4308,8 +4311,12 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()* - If the region is blockwise and it starts or ends in the middle of a multi-cell character, it is not included but its selected part is substituted with spaces. - - If {pos1} or {pos2} is not current in the buffer, an empty + - If {pos1} and {pos2} are not in the same buffer, an empty list is returned. + - {pos1} and {pos2} must belong to a |bufloaded()| buffer. + - It is evaluated in current window context, this makes a + different if a buffer is displayed in a different window and + 'virtualedit' or 'list' is set Examples: > :xnoremap <CR> diff --git a/runtime/doc/tags b/runtime/doc/tags index d6ed03a313..8dd4db2418 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -7767,6 +7767,7 @@ getqflist-examples quickfix.txt /*getqflist-examples* getreg() builtin.txt /*getreg()* getreginfo() builtin.txt /*getreginfo()* getregion() builtin.txt /*getregion()* +getregion-notes builtin.txt /*getregion-notes* getregtype() builtin.txt /*getregtype()* getscript pi_getscript.txt /*getscript* getscript-autoinstall pi_getscript.txt /*getscript-autoinstall* |