aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSora2022-07-01 09:08:48 +0000
committerGitHub2022-07-01 09:08:48 +0000
commitedee2f4c347c53c4ba0ee7d8e4624e12e64d90fe (patch)
tree0057938fdcc2c30a3fe1f7037dbbe06b8be469bb
parent444bc24a261ce02618cb73425d3847e554c83156 (diff)
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>
-rw-r--r--helix-term/src/commands.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index bc8e6530..59ca2e3b 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -2948,7 +2948,7 @@ pub mod insert {
let line_start_pos = text.line_to_char(range.cursor_line(text));
// consider to delete by indent level if all characters before `pos` are indent units.
let fragment = Cow::from(text.slice(line_start_pos..pos));
- if !fragment.is_empty() && fragment.chars().all(|ch| ch.is_whitespace()) {
+ if !fragment.is_empty() && fragment.chars().all(|ch| ch == ' ' || ch == '\t') {
if text.get_char(pos.saturating_sub(1)) == Some('\t') {
// fast path, delete one char
(