From de8745aea772fb03ffc36fd3f959d8aa7ca1fd57 Mon Sep 17 00:00:00 2001 From: PabloMansanet Date: Tue, 29 Jun 2021 14:54:16 +0200 Subject: Incorporate long word commands into keymap --- helix-core/src/movement.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'helix-core/src') 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, } } -- cgit v1.2.3-70-g09d2