Fix backwards character deletion on other whitespaces (#2855)
* delete_backwards_char accepts any type of whitespace
* Fix inconsistency, where unicode whitespaces are treated as normal whitespaces
* Changed back to direct whitespace match
* Only accept explicit whitespace / tabs
Co-authored-by: s0LA1337 <dreamer@neoncity.dev>
commitedee2f4c347c53c4ba0ee7d8e4624e12e64d90fe
authorSora <s0la.luladust@gmail.com>
dateFri 1 Jul 2022, 11:08 (4 years ago)
parent444bc24
helix-term/src/commands.rs+1−1
@@ -2948,7 +2948,7 @@ pub mod insert {
29482948 let line_start_pos = text.line_to_char(range.cursor_line(text));
29492949 // consider to delete by indent level if all characters before `pos` are indent units.
29502950 let fragment = Cow::from(text.slice(line_start_pos..pos));
2951− if !fragment.is_empty() && fragment.chars().all(|ch| ch.is_whitespace()) {
2951+ if !fragment.is_empty() && fragment.chars().all(|ch| ch == ' ' || ch == '\t') {
29522952 if text.get_char(pos.saturating_sub(1)) == Some('\t') {
29532953 // fast path, delete one char
29542954 (