diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-04-18 16:31:26 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-04-18 16:31:26 +0200 |
| commit | 61a0008ad75189f542df3818d3d0c43830b94990 (patch) | |
| tree | 2c97860a71c358b98f79287300343ce3147c0382 /vis-prompt.c | |
| parent | ef5c9d41e86a2c8af909308355518635a6007d56 (diff) | |
| download | vis-61a0008ad75189f542df3818d3d0c43830b94990.tar.gz vis-61a0008ad75189f542df3818d3d0c43830b94990.tar.xz | |
vis: use internal file to show lua errors
This means no event handlers are run for it, hence there is no chance
for recursive errors.
Diffstat (limited to 'vis-prompt.c')
| -rw-r--r-- | vis-prompt.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/vis-prompt.c b/vis-prompt.c index 3711cc9..01dc916 100644 --- a/vis-prompt.c +++ b/vis-prompt.c @@ -189,18 +189,17 @@ void vis_info_hide(Vis *vis) { void vis_message_show(Vis *vis, const char *msg) { if (!msg) return; - if (!vis->message_window) { - if (!vis_window_new(vis, NULL)) - return; - vis->message_window = vis->win; - } - + if (!vis->message_window) + vis->message_window = window_new_file(vis, vis->error_file); Win *win = vis->message_window; + if (!win) + return; Text *txt = win->file->text; size_t pos = text_size(txt); text_appendf(txt, "%s\n", msg); text_save(txt, NULL); view_cursor_to(win->view, pos); + vis_window_focus(win); } void vis_message_hide(Vis *vis) { |
