From 01929037f123aa1f9008b920b74d3fa4a403cd82 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Tue, 15 Nov 2022 12:02:09 -0800 Subject: [PATCH] fixed clear problem --- crates/terminal/src/mappings/keys.rs | 12 ------------ crates/terminal/src/terminal.rs | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/crates/terminal/src/mappings/keys.rs b/crates/terminal/src/mappings/keys.rs index 199f42df65c26a9a32b3fbff239f49c7079b7b33..ddcd6c58984d5e21e087c5c0c4f0262a1e2bb4ab 100644 --- a/crates/terminal/src/mappings/keys.rs +++ b/crates/terminal/src/mappings/keys.rs @@ -36,18 +36,6 @@ impl Modifiers { } } -///This function checks if to_esc_str would work, assuming all terminal settings are off. -///Note that this function is conservative. It can fail in cases where the actual to_esc_str succeeds. -///This is unavoidable for our use case. GPUI cannot wait until we acquire the terminal -///lock to determine whether we could actually send the keystroke with the current settings. Therefore, -///This conservative guess is used instead. Note that in practice the case where this method -///Returns false when the actual terminal would consume the keystroke never happens. All keystrokes -///that depend on terminal modes also have a mapping that doesn't depend on the terminal mode. -///This is fragile, but as these mappings are locked up in legacy compatibility, it's probably good enough -pub fn might_convert(keystroke: &Keystroke) -> bool { - to_esc_str(keystroke, &TermMode::NONE, false).is_some() -} - pub fn to_esc_str(keystroke: &Keystroke, mode: &TermMode, alt_is_meta: bool) -> Option { let modifiers = Modifiers::new(keystroke); diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 761dad6675f36a5b14fe9347e3f74ade7f13c295..5d52a664decbababf809c54fc49140fbcddf23d1 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -635,7 +635,7 @@ impl Terminal { term.grid_mut().reset_region(..cursor.line); // Copy the current line up - let line = term.grid()[cursor.line][..cursor.column] + let line = term.grid()[cursor.line][..Column(term.grid().columns())] .iter() .cloned() .enumerate()