aboutsummaryrefslogtreecommitdiff
path: root/editor.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-10 13:52:47 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-10 13:52:47 +0200
commitc419009f28dc89d8a556b1196de644a3536769e9 (patch)
tree58bd3561b1965f2af588a612d54f6cd515836331 /editor.c
parenta6e301c3c4e52cab0ca042af5934cfba3c76a9c0 (diff)
downloadvis-c419009f28dc89d8a556b1196de644a3536769e9.tar.gz
vis-c419009f28dc89d8a556b1196de644a3536769e9.tar.xz
Fix :q command
Diffstat (limited to 'editor.c')
-rw-r--r--editor.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/editor.c b/editor.c
index c2aa585..97d6fa9 100644
--- a/editor.c
+++ b/editor.c
@@ -214,12 +214,14 @@ static void editor_window_draw(EditorWin *win) {
void editor_draw(Editor *ed) {
erase();
- ed->windows_arrange(ed);
- for (EditorWin *win = ed->windows; win; win = win->next) {
- if (ed->win != win)
- editor_window_draw(win);
+ if (ed->windows) {
+ ed->windows_arrange(ed);
+ for (EditorWin *win = ed->windows; win; win = win->next) {
+ if (ed->win != win)
+ editor_window_draw(win);
+ }
+ editor_window_draw(ed->win);
}
- editor_window_draw(ed->win);
wnoutrefresh(stdscr);
}
@@ -319,6 +321,7 @@ void editor_window_close(Editor *ed) {
ed->win = win->next ? win->next : win->prev;
editor_window_detach(ed, win);
editor_window_free(ed, win);
+ editor_draw(ed);
}
Editor *editor_new(int width, int height) {
@@ -332,7 +335,6 @@ Editor *editor_new(int width, int height) {
ed->width = width;
ed->height = height;
ed->windows_arrange = editor_windows_arrange_horizontal;
- ed->running = true;
return ed;
err:
editor_free(ed);