From 57c7e1d4a0d7285d9de5b9035e91f546654268da Mon Sep 17 00:00:00 2001 From: "Pedro L. Ramos" Date: Mon, 7 Jan 2019 15:48:44 +0000 Subject: vim-patch:8.1.0648: custom operators can't act upon forced motion Problem: Custom operators can't act upon a forced motion. (Christian Wellenbrock) Solution: Add the forced motion to the mode() result. (Christian Brabandt, closes vim/vim#3490) https://github.com/vim/vim/commit/5976f8ff00efcb3e155a89346e44f2ad43d2405a closes #8667 closes #9476 Christian Wellenbrock: > For (most) built in text objects it's possible to force operation on > them to be linewise, for example by using `dVab` (`:h o_V`, > `motion_force`). When using custom text objects (defined as mappings > by plugins for example), this doesn't currently work. > > Example: > > onoremap x viw > > Open a file with a few lines each containing some words. With the > cursor on any word, try: > > 1. `dw` (builtin) deletes some characters > 2. `dVw` (builtin) deletes linewise > 3. `dx` (from mapping) deletes some characters > 4. `dVx` (from mapping) deletes some characters, but should delete > linewise ref: https://github.com/wellle/targets.vim/issues/214 ref: https://gitter.im/neovim/neovim?at=5b379ff7f1664406610e7483 --- runtime/doc/eval.txt | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 7b463aa6ca..425dcede8b 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5741,29 +5741,35 @@ mode([expr]) Return a string that indicates the current mode. a non-empty String (|non-zero-arg|), then the full mode is returned, otherwise only the first letter is returned. - n Normal - no Operator-pending - v Visual by character - V Visual by line - CTRL-V Visual blockwise - s Select by character - S Select by line - CTRL-S Select blockwise - i Insert - ic Insert mode completion |compl-generic| - ix Insert mode |i_CTRL-X| completion - R Replace |R| - Rc Replace mode completion |compl-generic| - Rv Virtual Replace |gR| - Rx Replace mode |i_CTRL-X| completion - c Command-line editing - cv Vim Ex mode |gQ| - ce Normal Ex mode |Q| - r Hit-enter prompt - rm The -- more -- prompt - r? A |:confirm| query of some sort - ! Shell or external command is executing - t Terminal mode: keys go to the job + n Normal + no Operator-pending + nov Operator-pending (forced characterwise |o_v|) + noV Operator-pending (forced linewise |o_V|) + noCTRL-V Operator-pending (forced blockwise |o_CTRL-V|) + niI Normal using |i_CTRL-O| in |Insert-mode| + niR Normal using |i_CTRL-O| in |Replace-mode| + niV Normal using |i_CTRL-O| in |Virtual-Replace-mode| + v Visual by character + V Visual by line + CTRL-V Visual blockwise + s Select by character + S Select by line + CTRL-S Select blockwise + i Insert + ic Insert mode completion |compl-generic| + ix Insert mode |i_CTRL-X| completion + R Replace |R| + Rc Replace mode completion |compl-generic| + Rv Virtual Replace |gR| + Rx Replace mode |i_CTRL-X| completion + c Command-line editing + cv Vim Ex mode |gQ| + ce Normal Ex mode |Q| + r Hit-enter prompt + rm The -- more -- prompt + r? |:confirm| query of some sort + ! Shell or external command is executing + t Terminal mode: keys go to the job This is useful in the 'statusline' option or when used with |remote_expr()| In most other places it always returns "c" or "n". -- cgit