Set edit type only once for indent and outdent
@@ -734,8 +734,9 @@ impl Editor {
let offset = self.view.line_col_to_offset(&self.text, line, 0);
let interval = Interval::new_closed_open(offset, offset);
builder.replace(interval, Rope::from(tab_text));
- self.this_edit_type = EditType::InsertChars;
+
}
+ self.this_edit_type = EditType::InsertChars;
self.add_delta(builder.build());
}
@@ -753,8 +754,8 @@ impl Editor {
let interval = Interval::new_closed_open(offset, first_char_offset);
builder.delete(interval);
}
- self.this_edit_type = EditType::Delete;
}
+ self.this_edit_type = EditType::Delete;
self.add_delta(builder.build());
}
