From 24f16734b6a8aeb9341e98e007bc445dc5c70077 Mon Sep 17 00:00:00 2001 From: Jonathan Lopez Date: Sun, 22 Sep 2024 07:31:33 -0400 Subject: [PATCH] Include boolean increment --- helix-core/src/increment/mod.rs | 5 +++++ helix-term/src/commands.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/helix-core/src/increment/mod.rs b/helix-core/src/increment/mod.rs index f1978bde469b..e5435c4bd130 100644 --- a/helix-core/src/increment/mod.rs +++ b/helix-core/src/increment/mod.rs @@ -1,5 +1,6 @@ mod date_time; mod integer; +mod boolean; pub fn integer(selected_text: &str, amount: i64) -> Option { integer::increment(selected_text, amount) @@ -8,3 +9,7 @@ pub fn integer(selected_text: &str, amount: i64) -> Option { pub fn date_time(selected_text: &str, amount: i64) -> Option { date_time::increment(selected_text, amount) } + +pub fn boolean(selected_text: &str, amount: i64) -> Option { + boolean::increment(selected_text, amount) +} diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 6e037a471ffc..fc45f2c918e8 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -6005,7 +6005,7 @@ fn increment_impl(cx: &mut Context, increment_direction: IncrementDirection) { for range in selection { let selected_text: Cow = range.fragment(text); let new_from = ((range.from() as i128) + cumulative_length_diff) as usize; - let incremented = [increment::integer, increment::date_time] + let incremented = [increment::integer, increment::date_time, increment::boolean] .iter() .find_map(|incrementor| incrementor(selected_text.as_ref(), amount));