diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-11 10:23:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 10:23:33 +0800 |
commit | a2f157233f274599739941e39673ca4d3b0291c3 (patch) | |
tree | 35d99a3005c14b1501b91868d0af217ef3d52e3b /src/nvim/tui/input.c | |
parent | 9da0023a666e83e6b9f777871553177473bfa9ce (diff) | |
download | rneovim-a2f157233f274599739941e39673ca4d3b0291c3.tar.gz rneovim-a2f157233f274599739941e39673ca4d3b0291c3.tar.bz2 rneovim-a2f157233f274599739941e39673ca4d3b0291c3.zip |
fix(tui)!: remove `ESC NUL` forced escape (#17198)
This make Nvim recognize `ESC NUL` as <M-C-Space>, as many terminal
emulators (including libvterm) send <M-C-Space> as `ESC NUL`.
There is already another unambiguous way to encode a `ESC` key supported
by libtermkey: `ESC [ 2 7 u`, which is a `CSI u` sequence.
If one still wants to use `ESC NUL` as `ESC`, they can just map
<M-C-Space> to <Esc>.
Diffstat (limited to 'src/nvim/tui/input.c')
-rw-r--r-- | src/nvim/tui/input.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/nvim/tui/input.c b/src/nvim/tui/input.c index 24958ce041..17656c5ddc 100644 --- a/src/nvim/tui/input.c +++ b/src/nvim/tui/input.c @@ -439,22 +439,6 @@ static HandleState handle_bracketed_paste(TermInput *input) return kNotApplicable; } -// ESC NUL => <Esc> -static bool handle_forced_escape(TermInput *input) -{ - if (rbuffer_size(input->read_stream.buffer) > 1 - && !rbuffer_cmp(input->read_stream.buffer, "\x1b\x00", 2)) { - // skip the ESC and NUL and push one <esc> to the input buffer - size_t rcnt; - termkey_push_bytes(input->tk, rbuffer_read_ptr(input->read_stream.buffer, - &rcnt), 1); - rbuffer_consumed(input->read_stream.buffer, 2); - tk_getkeys(input, true); - return true; - } - return false; -} - static void set_bg_deferred(void **argv) { char *bgvalue = argv[0]; @@ -583,7 +567,6 @@ static void handle_raw_buffer(TermInput *input, bool force) if (!force && (handle_focus_event(input) || (is_paste = handle_bracketed_paste(input)) != kNotApplicable - || handle_forced_escape(input) || (is_bc = handle_background_color(input)) != kNotApplicable)) { if (is_paste == kIncomplete || is_bc == kIncomplete) { // Wait for the next input, leaving it in the raw buffer due to an |