vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 10b9881b88eb4a6c1e9c6c9030d7a34549f945c8 parent 13a57c6f08c240edff46a84a49be895b5f678621 Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 21 Dec 2017 22:35:36 +0100 vis: do not override default register on delete operations in insert mode Fix #644 Diffstat:
| M | vis-operators.c | | | 8 | ++++++++ |
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/vis-operators.c b/vis-operators.c @@ -297,6 +297,14 @@ bool vis_operator(Vis *vis, enum VisOperator id, ...) { vis->action.arg.s = macro->data; break; } + case VIS_OP_DELETE: + { + enum VisMode mode = vis_mode_get(vis); + enum VisRegister reg = vis_register_used(vis); + if (reg == VIS_REG_DEFAULT && (mode == VIS_MODE_INSERT || mode == VIS_MODE_REPLACE)) + vis_register(vis, VIS_REG_BLACKHOLE); + break; + } default: break; }