Avoid double hashing in indent/outdent
@@ -555,10 +555,7 @@ fn do_indent(
}
}
for line in start_line..=end_line {
- if lines.contains(&line) {
- continue;
- }
- lines.insert(line);
+ if lines.insert(line) {
let line_content = buffer.line_content(line);
if line_content == "\n" || line_content == "\r\n" {
continue;
@@ -568,6 +565,7 @@ fn do_indent(
edits.push(edit);
}
}
+ }
buffer.edit(&edits, EditType::Indent)
}
@@ -590,10 +588,7 @@ fn do_outdent(
}
}
for line in start_line..=end_line {
- if lines.contains(&line) {
- continue;
- }
- lines.insert(line);
+ if lines.insert(line) {
let line_content = buffer.line_content(line);
if line_content == "\n" || line_content == "\r\n" {
continue;
@@ -606,6 +601,7 @@ fn do_outdent(
}
}
}
+ }
buffer.edit(&edits, EditType::Outdent)
}
