Repository navigation
Alt backspace/delete: treat path-like words as slash-delimited - #396
Merged
Merged
Conversation
… strings When the whitespace-delimited word to the left (or right) of the cursor contains `/` or `\`, LessStrict mode now treats only those slash characters as punctuation word boundaries instead of the full ASCII punctuation set. This makes alt+backspace on `./foo_bar/baz.jeb` delete `baz.jeb` as a single unit rather than splitting on `.`, then delete `/`, then `foo_bar`. - Add less_strict_class_slash_only: only / and \ are class 1 (punctuation) - Add has_slash_in_word_left / has_slash_in_word_right helpers - Use slash-only classification in delete_one_word_left/right (LessStrict) - Add delete_one_word_left_less_strict_path test - Add delete_one_word_right_less_strict_path test Agent-Logs-Url: https://github.com/HalFrgrd/flyline/sessions/3afddf3a-8bf5-4bf5-85c0-e1ed33865b3e Co-authored-by: HalFrgrd <[email protected]>
Copilot
AI
changed the title
[WIP] Update alt backspace and delete behavior for backslashed words
Alt backspace/delete: treat path-like words as slash-delimited
Apr 1, 2026
HalFrgrd
marked this pull request as ready for review
April 1, 2026 19:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
LessStrictmode, alt+backspace/delete split on every ASCII punctuation character, sobaz.jebwould be broken at the.rather than deleted as a unit. When working with paths this is almost never the desired behaviour.Approach
Detect whether the whitespace-delimited word in the deletion direction contains
/or\. If so, switch to a slash-only punctuation classifier for that operation —.,:,-,_, etc. become regular word characters, and only//\act as boundaries.Non-path words (no slashes) continue to use the full ASCII punctuation boundary set — no behaviour change for
abc::def::ghistyle tokens.Changes
less_strict_class_slash_only— new character classifier; only/and\are class 1 (punctuation), everything else non-whitespace is class 2.has_slash_in_word_left/has_slash_in_word_right— scan from cursor to the nearest whitespace and return whether a slash is present.delete_one_word_left/delete_one_word_right(LessStrict branch) — select the slash-only classifier when the relevant word context contains a slash.delete_one_word_left_less_strict_pathanddelete_one_word_right_less_strict_pathcovering theecho ./foo_bar/baz.jebcase from the issue; existing less-strict tests are unaffected.Original prompt