aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/vis.c b/vis.c
index b65724c..42bc0a0 100644
--- a/vis.c
+++ b/vis.c
@@ -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;
}