aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src
diff options
context:
space:
mode:
authorPabloMansanet2021-06-29 12:54:16 +0000
committerBlaž Hrastnik2021-06-29 15:56:19 +0000
commitde8745aea772fb03ffc36fd3f959d8aa7ca1fd57 (patch)
tree71a197bc7d40c8fdb4c8e9a78c5ed40b05d7e2ba /helix-core/src
parent73572b77802d5ae2f31b5f060170c89b79c4ff67 (diff)
Incorporate long word commands into keymap
Diffstat (limited to 'helix-core/src')
-rw-r--r--helix-core/src/movement.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/helix-core/src/movement.rs b/helix-core/src/movement.rs
index 900d3806..a4c7f9c9 100644
--- a/helix-core/src/movement.rs
+++ b/helix-core/src/movement.rs
@@ -194,7 +194,9 @@ impl CharHelpers for Chars<'_> {
// Index advancement also depends on the direction.
let advance: &dyn Fn(&mut usize) = match target {
- WordMotionTarget::PrevWordStart | WordMotionTarget::PrevLongWordStart => &|u| *u = u.saturating_sub(1),
+ WordMotionTarget::PrevWordStart | WordMotionTarget::PrevLongWordStart => {
+ &|u| *u = u.saturating_sub(1)
+ }
_ => &|u| *u += 1,
};
@@ -254,9 +256,9 @@ fn is_word_boundary(a: char, b: char) -> bool {
fn is_long_word_boundary(a: char, b: char) -> bool {
match (categorize_char(a), categorize_char(b)) {
(CharCategory::Word, CharCategory::Punctuation)
- | (CharCategory::Punctuation, CharCategory::Word) => false,
+ | (CharCategory::Punctuation, CharCategory::Word) => false,
(a, b) if a != b => true,
- _ => false
+ _ => false,
}
}