aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-04-15 16:32:57 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-04-15 16:32:57 +0200
commitf50465312dbb7e8fcb2409aa691d1aea7a43c466 (patch)
tree558b3ddd07eb9532318a105cfb278996d9cdf8b0 /vis.c
parentbd1d849b2033b04a372542c59d458d4f8279c937 (diff)
downloadvis-f50465312dbb7e8fcb2409aa691d1aea7a43c466.tar.gz
vis-f50465312dbb7e8fcb2409aa691d1aea7a43c466.tar.xz
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 (limited to 'vis.c')
-rw-r--r--vis.c2
1 files changed, 1 insertions, 1 deletions
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;
}