mirror of https://github.com/helix-editor/helix
Merge 9a42117122
into 205e7ece70
commit
dbd8588a5f
|
@ -865,17 +865,26 @@ impl EditorView {
|
||||||
last_mode = current_mode;
|
last_mode = current_mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
match &key_result {
|
match key_result {
|
||||||
KeymapResult::Matched(command) => {
|
KeymapResult::Matched(command) => {
|
||||||
execute_command(command);
|
execute_command(&command);
|
||||||
}
|
}
|
||||||
KeymapResult::Pending(node) => cxt.editor.autoinfo = Some(node.infobox()),
|
KeymapResult::Pending(node) => cxt.editor.autoinfo = Some(node.infobox()),
|
||||||
KeymapResult::MatchedSequence(commands) => {
|
KeymapResult::MatchedSequence(commands) => {
|
||||||
for command in commands {
|
for command in commands {
|
||||||
execute_command(command);
|
execute_command(&command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
KeymapResult::NotFound | KeymapResult::Cancelled(_) => return Some(key_result),
|
KeymapResult::NotFound => return Some(key_result),
|
||||||
|
KeymapResult::Cancelled(mut pending) => {
|
||||||
|
if !matches!(
|
||||||
|
self.handle_keymap_event(mode, cxt, event),
|
||||||
|
Some(KeymapResult::NotFound)
|
||||||
|
) {
|
||||||
|
pending.pop();
|
||||||
|
}
|
||||||
|
return Some(KeymapResult::Cancelled(pending));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
|
@ -444,6 +444,23 @@ async fn cursor_position_append_eof() -> anyhow::Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn repeated_key_movement() -> anyhow::Result<()> {
|
||||||
|
test((
|
||||||
|
"#[|f]#oo",
|
||||||
|
"]]<space>",
|
||||||
|
helpers::platform_line("#[|f]#oo\n"),
|
||||||
|
))
|
||||||
|
.await?;
|
||||||
|
test((
|
||||||
|
"#[|f]#oo\n\nbar",
|
||||||
|
"]]p",
|
||||||
|
helpers::platform_line("#[foo\n|]#\nbar"),
|
||||||
|
))
|
||||||
|
.await?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread")]
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
async fn select_mode_tree_sitter_next_function_is_union_of_objects() -> anyhow::Result<()> {
|
async fn select_mode_tree_sitter_next_function_is_union_of_objects() -> anyhow::Result<()> {
|
||||||
test_with_config(
|
test_with_config(
|
||||||
|
|
Loading…
Reference in New Issue