vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit c12797bcc2a403e27de582edd6f9570473edbf5d parent a29ccca4c235655984067c0a82d5e444a6f872fe Author: Marc André Tanner <mat@brain-dump.org> Date: Thu, 14 Jan 2016 21:56:43 +0100 vis: use different default register when editing a prompt file Diffstat:
| M | vis.c | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/vis.c b/vis.c @@ -425,9 +425,9 @@ void action_do(Vis *vis, Action *a) { next = view_cursors_next(cursor); size_t pos = view_cursors_pos(cursor); - Register *reg = a->reg ? a->reg : &vis->registers[VIS_REG_DEFAULT]; - if (multiple_cursors) - reg = view_cursors_register(cursor); + Register *reg = multiple_cursors ? view_cursors_register(cursor) : a->reg; + if (!reg) + reg = &vis->registers[win->file->internal ? VIS_REG_PROMPT : VIS_REG_DEFAULT]; OperatorContext c = { .count = a->count,