vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 3502b02a06313da0af1ff460c1946f69fcaed5ee parent 4cb19e899d31c19dc23f17cfa587d1cb7cd88b40 Author: Marc André Tanner <mat@brain-dump.org> Date: Fri, 15 Apr 2016 16:32:57 +0200 vis: do not run registered event handlers for internal files This fixes interactive :-commands when the user has configured to set custom options vis:command(...) via the Lua win_open event handler. The problem was that the creation of the window for the command prompt would itself trigger an execution of a :-command. Upon successful completion the editor would switch to normal mode. Therefore the interactively entered command would not be applied to the correct range. Diffstat:
| M | vis.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vis.c b/vis.c @@ -185,7 +185,7 @@ Win *window_new_file(Vis *vis, File *file) { vis->ui->window_focus(win->ui); for (size_t i = 0; i < LENGTH(win->modes); i++) win->modes[i].parent = &vis_modes[i]; - if (vis->event && vis->event->win_open) + if (!file->internal && vis->event && vis->event->win_open) vis->event->win_open(vis, win); return win; }