0
0
mirror of https://github.com/vim/vim.git synced 2025-10-28 09:27:14 -04:00

patch 9.1.0122: Some minor issues with the getregion() function

Problem:  Some minor issues with the getregion() function
Solution: Fix examples in the help, use OP_NOP op_type and MBLOCK
          as motion_type in f_getreg(), update vim syntax to
          for getregion() (Maxim Kim)

```
:xnoremap <CR>
\ <Cmd>echow getregion('v', '.', mode())<CR>
```
`echo` while in visual mode has no visible effect, thus people trying
example might be frustrated as it looks like nothing happens.

So the option is to change it to `echow` or `echom`.
With `echom` it is again has no visible effect but one can at least inspect `:messages`.
On the other hand `echow` showes selected text in a popup window.

```
Can also be used as a |method|: >
'.'->getregion("'a', 'v')
```

Here is the typo, which makes example invalid, should be `("'a", ...`

closes: #14064

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Maxim Kim
2024-02-21 19:48:37 +01:00
committed by Christian Brabandt
parent e8f6af6091
commit 9ca335aad2
4 changed files with 14 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
*builtin.txt* For Vim version 9.1. Last change: 2024 Feb 20
*builtin.txt* For Vim version 9.1. Last change: 2024 Feb 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4300,10 +4300,10 @@ getregion({pos1}, {pos2}, {type}) *getregion()*
Examples: >
:xnoremap <CR>
\ <Cmd>echo getregion('v', '.', mode())<CR>
\ <Cmd>echow getregion('v', '.', mode())<CR>
<
Can also be used as a |method|: >
'.'->getregion("'a', 'v')
'.'->getregion("'a", 'v')
<
getregtype([{regname}]) *getregtype()*
The result is a String, which is type of register {regname}.