diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2020-09-20 17:57:41 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-09-20 17:57:41 +0200 |
| commit | 1b1d45db20781cba443e5a065e05c2e43d5cdf1d (patch) | |
| tree | 7563508f215e29d3d51bbd817bc73a24e411bf9b /vis.c | |
| parent | 2290224c844775d446fc8aaf3a98c0149d935875 (diff) | |
| parent | daf4b8d3894cca25b3015d35e9168b7b2569d43b (diff) | |
| download | vis-1b1d45db20781cba443e5a065e05c2e43d5cdf1d.tar.gz vis-1b1d45db20781cba443e5a065e05c2e43d5cdf1d.tar.xz | |
Merge branch 'csi_event' of https://github.com/ezdiy/vis into master
Diffstat (limited to 'vis.c')
| -rw-r--r-- | vis.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -100,6 +100,10 @@ bool vis_event_emit(Vis *vis, enum VisEvents id, ...) { if (vis->event->quit) vis->event->quit(vis); break; + case VIS_EVENT_TERM_CSI: + if (vis->event->term_csi) + vis->event->term_csi(vis, va_arg(ap, const long *)); + break; } va_end(ap); @@ -1304,6 +1308,17 @@ static const char *getkey(Vis *vis) { } TermKey *termkey = vis->ui->termkey_get(vis->ui); + if (key.type == TERMKEY_TYPE_UNKNOWN_CSI) { + long args[18]; + size_t nargs; + unsigned long cmd; + if (termkey_interpret_csi(termkey, &key, &args[2], &nargs, &cmd) == TERMKEY_RES_KEY) { + args[0] = (long)cmd; + args[1] = nargs; + vis_event_emit(vis, VIS_EVENT_TERM_CSI, args); + } + return getkey(vis); + } termkey_strfkey(termkey, vis->key, sizeof(vis->key), &key, TERMKEY_FORMAT_VIM); return vis->key; } |
