Add Insert/Delete bindings with combined modifiers

Fixes #3046.
This commit is contained in:
Kirill Chibisov 2019-11-28 23:18:22 +03:00 committed by Christian Duerr
parent 1836d4679a
commit 0d637a096a
2 changed files with 33 additions and 24 deletions

View File

@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added compatibility logo variants for environments which can't render the default SVG - Added compatibility logo variants for environments which can't render the default SVG
### Added
- Terminal escape bindings with combined modifiers for Delete and Insert
### Fixed ### Fixed
- URLs not truncated with non-matching single quote - URLs not truncated with non-matching single quote

View File

@ -344,6 +344,8 @@ pub fn default_key_bindings() -> Vec<KeyBinding> {
let modifiers_code = index + 2; let modifiers_code = index + 2;
bindings.extend(bindings!( bindings.extend(bindings!(
KeyBinding; KeyBinding;
Key::Delete, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl];
Action::Esc(format!("\x1b[3;{}~", modifiers_code));
Key::Up, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Key::Up, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl];
Action::Esc(format!("\x1b[1;{}A", modifiers_code)); Action::Esc(format!("\x1b[1;{}A", modifiers_code));
Key::Down, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Key::Down, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl];
@ -399,6 +401,8 @@ pub fn default_key_bindings() -> Vec<KeyBinding> {
if modifiers_code != 2 { if modifiers_code != 2 {
bindings.extend(bindings!( bindings.extend(bindings!(
KeyBinding; KeyBinding;
Key::Insert, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl];
Action::Esc(format!("\x1b[2;{}~", modifiers_code));
Key::PageUp, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Key::PageUp, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl];
Action::Esc(format!("\x1b[5;{}~", modifiers_code)); Action::Esc(format!("\x1b[5;{}~", modifiers_code));
Key::PageDown, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Key::PageDown, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl];
@ -454,6 +458,7 @@ pub fn platform_key_bindings() -> Vec<KeyBinding> {
Key::Equals, [logo: true]; Action::IncreaseFontSize; Key::Equals, [logo: true]; Action::IncreaseFontSize;
Key::Add, [logo: true]; Action::IncreaseFontSize; Key::Add, [logo: true]; Action::IncreaseFontSize;
Key::Minus, [logo: true]; Action::DecreaseFontSize; Key::Minus, [logo: true]; Action::DecreaseFontSize;
Key::Insert, [shift: true]; Action::Esc("\x1b[2;2~".into());
Key::F, [ctrl: true, logo: true]; Action::ToggleFullscreen; Key::F, [ctrl: true, logo: true]; Action::ToggleFullscreen;
Key::K, [logo: true]; Action::ClearHistory; Key::K, [logo: true]; Action::ClearHistory;
Key::K, [logo: true]; Action::Esc("\x0c".into()); Key::K, [logo: true]; Action::Esc("\x0c".into());