diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-02-07 16:06:31 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-02-07 23:14:30 +0100 |
| commit | a9128846c27307bae1a8154c8bfe8c71acd2c88e (patch) | |
| tree | 239ee9cba0eaf5f3329748d78987e7cbfb4c21da /vis.c | |
| parent | 0ca5c66a71aa6ed9b2cfc621c26d4fc4ff47ec93 (diff) | |
| download | vis-a9128846c27307bae1a8154c8bfe8c71acd2c88e.tar.gz vis-a9128846c27307bae1a8154c8bfe8c71acd2c88e.tar.xz | |
vis: export vis_window_closable
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -284,6 +284,12 @@ bool vis_window_new(Vis *vis, const char *filename) { return true; } +bool vis_window_closable(Win *win) { + if (!text_modified(win->file->text)) + return true; + return win->file->refcount > 1; +} + void vis_window_close(Win *win) { Vis *vis = win->vis; if (vis->event && vis->event->win_close) @@ -1090,6 +1096,10 @@ View *vis_view(Vis *vis) { return vis->win->view; } +Win *vis_window(Vis *vis) { + return vis->win; +} + Text *vis_file_text(File *file) { return file->text; } |
