mirror of
https://github.com/neovim/neovim.git
synced 2025-09-25 20:48:32 +00:00
vim-patch:87410ab3f556 (#27696)
runtime(doc): some improvements to getregion() docs (vim/vim#14122)
- Mention the default selection behavior
- Remove useless sentence
- Correct description about space padding
87410ab3f5
This commit is contained in:
21
runtime/doc/builtin.txt
generated
21
runtime/doc/builtin.txt
generated
@@ -2928,32 +2928,31 @@ getregion({pos1}, {pos2} [, {opts}]) *getregion()*
|
|||||||
The optional argument {opts} is a Dict and supports the
|
The optional argument {opts} is a Dict and supports the
|
||||||
following items:
|
following items:
|
||||||
|
|
||||||
type Specify the selection type
|
type Specify the region's selection type
|
||||||
(default: "v"):
|
(default: "v"):
|
||||||
"v" for |charwise| mode
|
"v" for |charwise| mode
|
||||||
"V" for |linewise| mode
|
"V" for |linewise| mode
|
||||||
"<CTRL-V>" for |blockwise-visual| mode
|
"<CTRL-V>" for |blockwise-visual| mode
|
||||||
|
|
||||||
exclusive If |TRUE|, use exclusive selection
|
exclusive If |TRUE|, use exclusive selection
|
||||||
for the end position 'selection'.
|
for the end position
|
||||||
|
(default: follow 'selection')
|
||||||
|
|
||||||
You can get the last selection type by |visualmode()|.
|
You can get the last selection type by |visualmode()|.
|
||||||
If Visual mode is active, use |mode()| to get the Visual mode
|
If Visual mode is active, use |mode()| to get the Visual mode
|
||||||
(e.g., in a |:vmap|).
|
(e.g., in a |:vmap|).
|
||||||
This function uses the line and column number from the
|
This function is useful to get text starting and ending in
|
||||||
specified position.
|
different columns, such as a |charwise-visual| selection.
|
||||||
It is useful to get text starting and ending in different
|
|
||||||
columns, such as |charwise-visual| selection.
|
|
||||||
|
|
||||||
Note that:
|
Note that:
|
||||||
- Order of {pos1} and {pos2} doesn't matter, it will always
|
- Order of {pos1} and {pos2} doesn't matter, it will always
|
||||||
return content from the upper left position to the lower
|
return content from the upper left position to the lower
|
||||||
right position.
|
right position.
|
||||||
- If 'virtualedit' is enabled and selection is past the end of
|
- If 'virtualedit' is enabled and the region is past the end
|
||||||
line, resulting lines are filled with blanks.
|
of the lines, resulting lines are padded with spaces.
|
||||||
- If the selection starts or ends in the middle of a multibyte
|
- If the region is blockwise and it starts or ends in the
|
||||||
character, it is not included but its selected part is
|
middle of a multi-cell character, it is not included but
|
||||||
substituted with spaces.
|
its selected part is substituted with spaces.
|
||||||
- If {pos1} or {pos2} is not current in the buffer, an empty
|
- If {pos1} or {pos2} is not current in the buffer, an empty
|
||||||
list is returned.
|
list is returned.
|
||||||
|
|
||||||
|
21
runtime/lua/vim/_meta/vimfn.lua
generated
21
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -3534,32 +3534,31 @@ function vim.fn.getreginfo(regname) end
|
|||||||
--- The optional argument {opts} is a Dict and supports the
|
--- The optional argument {opts} is a Dict and supports the
|
||||||
--- following items:
|
--- following items:
|
||||||
---
|
---
|
||||||
--- type Specify the selection type
|
--- type Specify the region's selection type
|
||||||
--- (default: "v"):
|
--- (default: "v"):
|
||||||
--- "v" for |charwise| mode
|
--- "v" for |charwise| mode
|
||||||
--- "V" for |linewise| mode
|
--- "V" for |linewise| mode
|
||||||
--- "<CTRL-V>" for |blockwise-visual| mode
|
--- "<CTRL-V>" for |blockwise-visual| mode
|
||||||
---
|
---
|
||||||
--- exclusive If |TRUE|, use exclusive selection
|
--- exclusive If |TRUE|, use exclusive selection
|
||||||
--- for the end position 'selection'.
|
--- for the end position
|
||||||
|
--- (default: follow 'selection')
|
||||||
---
|
---
|
||||||
--- You can get the last selection type by |visualmode()|.
|
--- You can get the last selection type by |visualmode()|.
|
||||||
--- If Visual mode is active, use |mode()| to get the Visual mode
|
--- If Visual mode is active, use |mode()| to get the Visual mode
|
||||||
--- (e.g., in a |:vmap|).
|
--- (e.g., in a |:vmap|).
|
||||||
--- This function uses the line and column number from the
|
--- This function is useful to get text starting and ending in
|
||||||
--- specified position.
|
--- different columns, such as a |charwise-visual| selection.
|
||||||
--- It is useful to get text starting and ending in different
|
|
||||||
--- columns, such as |charwise-visual| selection.
|
|
||||||
---
|
---
|
||||||
--- Note that:
|
--- Note that:
|
||||||
--- - Order of {pos1} and {pos2} doesn't matter, it will always
|
--- - Order of {pos1} and {pos2} doesn't matter, it will always
|
||||||
--- return content from the upper left position to the lower
|
--- return content from the upper left position to the lower
|
||||||
--- right position.
|
--- right position.
|
||||||
--- - If 'virtualedit' is enabled and selection is past the end of
|
--- - If 'virtualedit' is enabled and the region is past the end
|
||||||
--- line, resulting lines are filled with blanks.
|
--- of the lines, resulting lines are padded with spaces.
|
||||||
--- - If the selection starts or ends in the middle of a multibyte
|
--- - If the region is blockwise and it starts or ends in the
|
||||||
--- character, it is not included but its selected part is
|
--- middle of a multi-cell character, it is not included but
|
||||||
--- substituted with spaces.
|
--- its selected part is substituted with spaces.
|
||||||
--- - If {pos1} or {pos2} is not current in the buffer, an empty
|
--- - If {pos1} or {pos2} is not current in the buffer, an empty
|
||||||
--- list is returned.
|
--- list is returned.
|
||||||
---
|
---
|
||||||
|
@@ -4368,32 +4368,31 @@ M.funcs = {
|
|||||||
The optional argument {opts} is a Dict and supports the
|
The optional argument {opts} is a Dict and supports the
|
||||||
following items:
|
following items:
|
||||||
|
|
||||||
type Specify the selection type
|
type Specify the region's selection type
|
||||||
(default: "v"):
|
(default: "v"):
|
||||||
"v" for |charwise| mode
|
"v" for |charwise| mode
|
||||||
"V" for |linewise| mode
|
"V" for |linewise| mode
|
||||||
"<CTRL-V>" for |blockwise-visual| mode
|
"<CTRL-V>" for |blockwise-visual| mode
|
||||||
|
|
||||||
exclusive If |TRUE|, use exclusive selection
|
exclusive If |TRUE|, use exclusive selection
|
||||||
for the end position 'selection'.
|
for the end position
|
||||||
|
(default: follow 'selection')
|
||||||
|
|
||||||
You can get the last selection type by |visualmode()|.
|
You can get the last selection type by |visualmode()|.
|
||||||
If Visual mode is active, use |mode()| to get the Visual mode
|
If Visual mode is active, use |mode()| to get the Visual mode
|
||||||
(e.g., in a |:vmap|).
|
(e.g., in a |:vmap|).
|
||||||
This function uses the line and column number from the
|
This function is useful to get text starting and ending in
|
||||||
specified position.
|
different columns, such as a |charwise-visual| selection.
|
||||||
It is useful to get text starting and ending in different
|
|
||||||
columns, such as |charwise-visual| selection.
|
|
||||||
|
|
||||||
Note that:
|
Note that:
|
||||||
- Order of {pos1} and {pos2} doesn't matter, it will always
|
- Order of {pos1} and {pos2} doesn't matter, it will always
|
||||||
return content from the upper left position to the lower
|
return content from the upper left position to the lower
|
||||||
right position.
|
right position.
|
||||||
- If 'virtualedit' is enabled and selection is past the end of
|
- If 'virtualedit' is enabled and the region is past the end
|
||||||
line, resulting lines are filled with blanks.
|
of the lines, resulting lines are padded with spaces.
|
||||||
- If the selection starts or ends in the middle of a multibyte
|
- If the region is blockwise and it starts or ends in the
|
||||||
character, it is not included but its selected part is
|
middle of a multi-cell character, it is not included but
|
||||||
substituted with spaces.
|
its selected part is substituted with spaces.
|
||||||
- If {pos1} or {pos2} is not current in the buffer, an empty
|
- If {pos1} or {pos2} is not current in the buffer, an empty
|
||||||
list is returned.
|
list is returned.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user