aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-09-20 17:57:41 +0200
committerMarc André Tanner <mat@brain-dump.org>2020-09-20 17:57:41 +0200
commit1b1d45db20781cba443e5a065e05c2e43d5cdf1d (patch)
tree7563508f215e29d3d51bbd817bc73a24e411bf9b /vis-lua.c
parent2290224c844775d446fc8aaf3a98c0149d935875 (diff)
parentdaf4b8d3894cca25b3015d35e9168b7b2569d43b (diff)
downloadvis-1b1d45db20781cba443e5a065e05c2e43d5cdf1d.tar.gz
vis-1b1d45db20781cba443e5a065e05c2e43d5cdf1d.tar.xz
Merge branch 'csi_event' of https://github.com/ezdiy/vis into master
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/vis-lua.c b/vis-lua.c
index f59528c..753aa7d 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -161,6 +161,7 @@ void vis_lua_win_open(Vis *vis, Win *win) { }
void vis_lua_win_close(Vis *vis, Win *win) { }
void vis_lua_win_highlight(Vis *vis, Win *win) { }
void vis_lua_win_status(Vis *vis, Win *win) { window_status_update(vis, win); }
+void vis_lua_term_csi(Vis *vis, const long *csi) { }
#else
@@ -3105,4 +3106,24 @@ void vis_lua_win_status(Vis *vis, Win *win) {
lua_pop(L, 1);
}
+/***
+ * CSI command received from terminal.
+ * @function term_csi
+ * @param List of CSI parameters
+ */
+void vis_lua_term_csi(Vis *vis, const long *csi) {
+ lua_State *L = vis->lua;
+ if (!L)
+ return;
+ vis_lua_event_get(L, "term_csi");
+ if (lua_isfunction(L, -1)) {
+ int nargs = csi[1];
+ lua_pushinteger(L, csi[0]);
+ for (int i = 0; i < nargs; i++)
+ lua_pushinteger(L, csi[2 + i]);
+ pcall(vis, L, 1 + nargs, 0);
+ }
+ lua_pop(L, 1);
+}
+
#endif