From f50465312dbb7e8fcb2409aa691d1aea7a43c466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 15 Apr 2016 16:32:57 +0200 Subject: 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. --- vis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vis.c') diff --git a/vis.c b/vis.c index c59133b..f069f60 100644 --- 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; } -- cgit v1.2.3