aboutsummaryrefslogtreecommitdiff
path: root/vis.h
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-05-10 08:55:56 +0200
committerRandy Palamar <randy@rnpnr.xyz>2024-05-12 09:16:29 -0600
commit352ee0761ced17612d751bd568c888c78d279e9f (patch)
tree9db6cc3c62b5506144b96a7aa89f7c616470c269 /vis.h
parent50a7673370fa037960e9d2c3a8d6aed1bb9c39c4 (diff)
downloadvis-352ee0761ced17612d751bd568c888c78d279e9f.tar.gz
vis-352ee0761ced17612d751bd568c888c78d279e9f.tar.xz
lua: allow changing the displayed file of a window
Change the file displayed in a window by writing the new file name to the window's file member. This is useful to change the displayed file during events. Using the edit command during an event caused by a pervious edit command causes a double free.
Diffstat (limited to 'vis.h')
-rw-r--r--vis.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/vis.h b/vis.h
index 8287a45..fcc1e05 100644
--- a/vis.h
+++ b/vis.h
@@ -209,6 +209,8 @@ bool vis_window_new(Vis*, const char *filename);
bool vis_window_new_fd(Vis*, int fd);
/** Reload the file currently displayed in the window from disk. */
bool vis_window_reload(Win*);
+/** Change the file currently displayed in the window. */
+bool vis_window_change_file(Win*, const char *filename);
/** Check whether closing the window would loose unsaved changes. */
bool vis_window_closable(Win*);
/** Close window, redraw user interface. */