diff options
author | Nathan Vegdahl | 2021-07-26 18:19:10 +0000 |
---|---|---|
committer | Nathan Vegdahl | 2021-07-26 18:19:10 +0000 |
commit | f62ec6e51e99dce9e93600801c3637c196c592b6 (patch) | |
tree | 8821ee23ade21c0da4fbb5a70143717ac42a2bc1 /helix-core/src/indent.rs | |
parent | 5ee6ba5b38ebeb86006bb2e42734a2285eb354df (diff) | |
parent | 88d6f652390922b389667f469b6d308db569bdaf (diff) |
Merge branch 'master' into great_line_ending_and_cursor_range_cleanup
Diffstat (limited to 'helix-core/src/indent.rs')
-rw-r--r-- | helix-core/src/indent.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs index 0ca05fb3..5ae66769 100644 --- a/helix-core/src/indent.rs +++ b/helix-core/src/indent.rs @@ -47,7 +47,7 @@ fn calculate_indentation(query: &IndentQuery, node: Option<Node>, newline: bool) // NOTE: can't use contains() on query because of comparing Vec<String> and &str // https://doc.rust-lang.org/std/vec/struct.Vec.html#method.contains - let mut increment: i32 = 0; + let mut increment: isize = 0; let mut node = match node { Some(node) => node, @@ -93,9 +93,7 @@ fn calculate_indentation(query: &IndentQuery, node: Option<Node>, newline: bool) node = parent; } - assert!(increment >= 0); - - increment as usize + increment.max(0) as usize } #[allow(dead_code)] |