mirror of
https://github.com/wez/wezterm.git
synced 2024-09-11 14:25:57 +03:00
Remove ResetViewport, add helper for keys
This commit is contained in:
parent
69e8971400
commit
2291040e88
@ -689,7 +689,6 @@ pub enum CopyModeAssignment {
|
||||
JumpBackward { prev_char: bool },
|
||||
JumpAgain,
|
||||
JumpReverse,
|
||||
ResetViewport,
|
||||
}
|
||||
|
||||
pub type KeyTable = HashMap<(KeyCode, Modifiers), KeyTableEntry>;
|
||||
|
@ -17,8 +17,8 @@ return {
|
||||
action = act.CopyMode 'MoveToStartOfNextLine',
|
||||
},
|
||||
{ key = 'Escape', mods = 'NONE', action = act.Multiple {
|
||||
{ CopyMode = 'ScrollToBottom' },
|
||||
{ CopyMode = 'Close' },
|
||||
{ CopyMode = 'ResetViewport' },
|
||||
} },
|
||||
{
|
||||
key = 'Space',
|
||||
@ -128,8 +128,8 @@ return {
|
||||
{ key = 'b', mods = 'ALT', action = act.CopyMode 'MoveBackwardWord' },
|
||||
{ key = 'b', mods = 'CTRL', action = act.CopyMode 'PageUp' },
|
||||
{ key = 'c', mods = 'CTRL', action = act.Multiple {
|
||||
{ CopyMode = 'ScrollToBottom' },
|
||||
{ CopyMode = 'Close' },
|
||||
{ CopyMode = 'ResetViewport' },
|
||||
} },
|
||||
{
|
||||
key = 'd',
|
||||
@ -154,8 +154,8 @@ return {
|
||||
action = act.CopyMode 'MoveToScrollbackTop',
|
||||
},
|
||||
{ key = 'g', mods = 'CTRL', action = act.Multiple {
|
||||
{ CopyMode = 'ScrollToBottom' },
|
||||
{ CopyMode = 'Close' },
|
||||
{ CopyMode = 'ResetViewport' },
|
||||
} },
|
||||
{ key = 'h', mods = 'NONE', action = act.CopyMode 'MoveLeft' },
|
||||
{ key = 'j', mods = 'NONE', action = act.CopyMode 'MoveDown' },
|
||||
@ -172,8 +172,8 @@ return {
|
||||
action = act.CopyMode 'MoveToSelectionOtherEnd',
|
||||
},
|
||||
{ key = 'q', mods = 'NONE', action = act.Multiple {
|
||||
{ CopyMode = 'ScrollToBottom' },
|
||||
{ CopyMode = 'Close' },
|
||||
{ CopyMode = 'ResetViewport' },
|
||||
} },
|
||||
{
|
||||
key = 't',
|
||||
@ -201,8 +201,8 @@ return {
|
||||
mods = 'NONE',
|
||||
action = act.Multiple {
|
||||
{ CopyTo = 'ClipboardAndPrimarySelection' },
|
||||
{ CopyMode = 'ScrollToBottom' },
|
||||
{ CopyMode = 'Close' },
|
||||
{ CopyMode = 'ResetViewport' },
|
||||
},
|
||||
},
|
||||
{ key = 'PageUp', mods = 'NONE', action = act.CopyMode 'PageUp' },
|
||||
|
@ -1206,7 +1206,6 @@ impl Pane for CopyOverlay {
|
||||
JumpBackward { prev_char } => render.jump(false, *prev_char),
|
||||
JumpAgain => render.jump_again(false),
|
||||
JumpReverse => render.jump_again(true),
|
||||
ResetViewport => render.set_viewport(None),
|
||||
}
|
||||
PerformAssignmentResult::Handled
|
||||
}
|
||||
@ -1574,40 +1573,35 @@ pub fn search_key_table() -> KeyTable {
|
||||
table
|
||||
}
|
||||
|
||||
fn scroll_to_bottom_and_close() -> KeyAssignment {
|
||||
KeyAssignment::Multiple(vec![
|
||||
KeyAssignment::ScrollToBottom,
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::Close),
|
||||
])
|
||||
}
|
||||
|
||||
pub fn copy_key_table() -> KeyTable {
|
||||
let mut table = KeyTable::default();
|
||||
for (key, mods, action) in [
|
||||
(
|
||||
WKeyCode::Char('c'),
|
||||
Modifiers::CTRL,
|
||||
KeyAssignment::Multiple(vec![
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::Close),
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::ResetViewport),
|
||||
]),
|
||||
scroll_to_bottom_and_close(),
|
||||
),
|
||||
(
|
||||
WKeyCode::Char('g'),
|
||||
Modifiers::CTRL,
|
||||
KeyAssignment::Multiple(vec![
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::Close),
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::ResetViewport),
|
||||
]),
|
||||
scroll_to_bottom_and_close(),
|
||||
),
|
||||
(
|
||||
WKeyCode::Char('q'),
|
||||
Modifiers::NONE,
|
||||
KeyAssignment::Multiple(vec![
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::Close),
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::ResetViewport),
|
||||
]),
|
||||
scroll_to_bottom_and_close(),
|
||||
),
|
||||
(
|
||||
WKeyCode::Char('\x1b'),
|
||||
Modifiers::NONE,
|
||||
KeyAssignment::Multiple(vec![
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::Close),
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::ResetViewport),
|
||||
]),
|
||||
scroll_to_bottom_and_close(),
|
||||
),
|
||||
(
|
||||
WKeyCode::Char('h'),
|
||||
@ -1859,8 +1853,7 @@ pub fn copy_key_table() -> KeyTable {
|
||||
Modifiers::NONE,
|
||||
KeyAssignment::Multiple(vec![
|
||||
KeyAssignment::CopyTo(ClipboardCopyDestination::ClipboardAndPrimarySelection),
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::Close),
|
||||
KeyAssignment::CopyMode(CopyModeAssignment::ResetViewport),
|
||||
scroll_to_bottom_and_close(),
|
||||
]),
|
||||
),
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user