aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/comment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/src/comment.rs')
-rw-r--r--helix-core/src/comment.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-core/src/comment.rs b/helix-core/src/comment.rs
index ec5d7a45..6241f7fd 100644
--- a/helix-core/src/comment.rs
+++ b/helix-core/src/comment.rs
@@ -68,7 +68,7 @@ pub fn toggle_line_comments(doc: &Rope, selection: &Selection, token: Option<&st
let mut min_next_line = 0;
for selection in selection {
let (start, end) = selection.line_range(text);
- let start = start.max(min_next_line).min(text.len_lines());
+ let start = start.clamp(min_next_line, text.len_lines());
let end = (end + 1).min(text.len_lines());
lines.extend(start..end);