mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
dcs: map BSU/ESU unhook handlers directly to term_{enable,disable}_app_sync_upates()
That is, drop the local bsu() and esu() functions.
This commit is contained in:
parent
0b9b726bdf
commit
8f06436985
1 changed files with 7 additions and 26 deletions
33
dcs.c
33
dcs.c
|
|
@ -10,30 +10,6 @@
|
|||
#include "vt.h"
|
||||
#include "xmalloc.h"
|
||||
|
||||
static void
|
||||
bsu(struct terminal *term)
|
||||
{
|
||||
/* https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
|
||||
|
||||
size_t n = term->vt.dcs.idx;
|
||||
if (unlikely(n > 0))
|
||||
LOG_DBG("BSU with unknown params: %.*s)", (int)n, term->vt.dcs.data);
|
||||
|
||||
term_enable_app_sync_updates(term);
|
||||
}
|
||||
|
||||
static void
|
||||
esu(struct terminal *term)
|
||||
{
|
||||
/* https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
|
||||
|
||||
size_t n = term->vt.dcs.idx;
|
||||
if (unlikely(n > 0))
|
||||
LOG_DBG("ESU with unknown params: %.*s)", (int)n, term->vt.dcs.data);
|
||||
|
||||
term_disable_app_sync_updates(term);
|
||||
}
|
||||
|
||||
/* Decode hex-encoded string *inline*. NULL terminates */
|
||||
static char *
|
||||
hex_decode(const char *s, size_t len)
|
||||
|
|
@ -419,9 +395,14 @@ dcs_hook(struct terminal *term, uint8_t final)
|
|||
case '=':
|
||||
switch (final) {
|
||||
case 's':
|
||||
/* BSU/ESU: https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec */
|
||||
switch (vt_param_get(term, 0, 0)) {
|
||||
case 1: term->vt.dcs.unhook_handler = &bsu; return;
|
||||
case 2: term->vt.dcs.unhook_handler = &esu; return;
|
||||
case 1:
|
||||
term->vt.dcs.unhook_handler = &term_enable_app_sync_updates;
|
||||
return;
|
||||
case 2:
|
||||
term->vt.dcs.unhook_handler = &term_disable_app_sync_updates;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue