mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
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>
This commit is contained in:
parent
444bc24a26
commit
edee2f4c34
@ -2948,7 +2948,7 @@ pub fn delete_char_backward(cx: &mut Context) {
|
||||
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
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user