Skip to content

Commit

Permalink
comment: reverting small bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TornaxO7 committed Oct 19, 2024
1 parent 898f231 commit 12a8b3e
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions helix-core/src/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ fn find_line_comment(
lines: impl IntoIterator<Item = usize>,
) -> (bool, Vec<usize>, usize, usize) {
let mut commented = true;
let mut text_is_empty = true;
let mut to_change = Vec::new();
let mut min = usize::MAX; // minimum col for first_non_whitespace_char
let mut margin = 1;
Expand All @@ -51,7 +50,6 @@ fn find_line_comment(
for line in lines {
let line_slice = text.line(line);
if let Some(pos) = line_slice.first_non_whitespace_char() {
text_is_empty = false;
let len = line_slice.len_chars();

min = std::cmp::min(min, pos);
Expand All @@ -76,10 +74,6 @@ fn find_line_comment(
}
}

if text_is_empty {
commented = false;
}

(commented, to_change, min, margin)
}

Expand Down Expand Up @@ -344,14 +338,6 @@ mod test {
mod find_line_comment {
use super::*;

#[test]
fn empty_line() {
let doc = Rope::from("");

let (is_commented, _, _, _) = find_line_comment("//", doc.slice(..), [0]);
assert!(!is_commented);
}

#[test]
fn not_commented() {
// four lines, two space indented, except for line 1 which is blank.
Expand Down

0 comments on commit 12a8b3e

Please sign in to comment.