diff options
author | Maxim Kim <habamax@gmail.com> | 2024-02-21 19:48:37 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-02-21 19:53:02 +0100 |
commit | 9ca335aad295fdaf4b75d3969b093422c1cc48ee (patch) | |
tree | 50dd626962e36ad721c75faabf762b5a2e5c6755 /src/evalfunc.c | |
parent | e8f6af60917862d04a82efb9e900200fd36f798d (diff) |
patch 9.1.0122: Some minor issues with the getregion() functionv9.1.0122
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>
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r-- | src/evalfunc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c index 81f747f843..071bf7d0f8 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -5584,8 +5584,9 @@ f_getregion(typval_T *argvars, typval_T *rettv) getvvcol(curwin, &p1, &sc1, NULL, &ec1); getvvcol(curwin, &p2, &sc2, NULL, &ec2); - oap.motion_type = OP_NOP; + oap.motion_type = MBLOCK; oap.inclusive = TRUE; + oap.op_type = OP_NOP; oap.start = p1; oap.end = p2; oap.start_vcol = MIN(sc1, sc2); |