diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-09-10 13:52:47 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-09-10 13:52:47 +0200 |
| commit | c419009f28dc89d8a556b1196de644a3536769e9 (patch) | |
| tree | 58bd3561b1965f2af588a612d54f6cd515836331 /editor.c | |
| parent | a6e301c3c4e52cab0ca042af5934cfba3c76a9c0 (diff) | |
| download | vis-c419009f28dc89d8a556b1196de644a3536769e9.tar.gz vis-c419009f28dc89d8a556b1196de644a3536769e9.tar.xz | |
Fix :q command
Diffstat (limited to 'editor.c')
| -rw-r--r-- | editor.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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); |
