Skip to content

Commit

Permalink
Include boolean increment
Browse files Browse the repository at this point in the history
  • Loading branch information
otherJL0 committed Sep 22, 2024
1 parent 5632a8c commit 24f1673
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions helix-core/src/increment/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod date_time;
mod integer;
mod boolean;

pub fn integer(selected_text: &str, amount: i64) -> Option<String> {
integer::increment(selected_text, amount)
Expand All @@ -8,3 +9,7 @@ pub fn integer(selected_text: &str, amount: i64) -> Option<String> {
pub fn date_time(selected_text: &str, amount: i64) -> Option<String> {
date_time::increment(selected_text, amount)
}

pub fn boolean(selected_text: &str, amount: i64) -> Option<String> {
boolean::increment(selected_text, amount)
}
2 changes: 1 addition & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6005,7 +6005,7 @@ fn increment_impl(cx: &mut Context, increment_direction: IncrementDirection) {
for range in selection {
let selected_text: Cow<str> = 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));

Expand Down

0 comments on commit 24f1673

Please sign in to comment.