vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit be053a800ac146793cb552439cb8d5dc5f45a446
parent c942b61df0f1b881413d95e3fc2117c9223426e0
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Mon, 18 Apr 2016 15:52:52 +0200

vis: do not run event handlers for internal files

Should have been part of 3502b02a06313da0af1ff460c1946f69fcaed5ee.

Diffstat:
Mvis.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vis.c b/vis.c @@ -44,7 +44,7 @@ static void file_free(Vis *vis, File *file) { --file->refcount; return; } - if (vis->event && vis->event->file_close) + if (!file->internal && vis->event && vis->event->file_close) vis->event->file_close(vis, file); text_free(file->text); free((char*)file->name); @@ -96,7 +96,7 @@ static File *file_new(Vis *vis, const char *filename) { if (filename) file->name = strdup(filename); - if (vis->event && vis->event->file_open) + if (!file->internal && vis->event && vis->event->file_open) vis->event->file_open(vis, file); return file; } @@ -323,7 +323,7 @@ void vis_window_swap(Win *a, Win *b) { void vis_window_close(Win *win) { Vis *vis = win->vis; - if (vis->event && vis->event->win_close) + if (!win->file->internal && vis->event && vis->event->win_close) vis->event->win_close(vis, win); file_free(vis, win->file); if (win->prev)