fix(helix): count the resting block caret as end of buffer - #1192
Open
kronberger-droid wants to merge 1 commit into
Open
fix(helix): count the resting block caret as end of buffer#1192kronberger-droid wants to merge 1 commit into
kronberger-droid wants to merge 1 commit into
Conversation
`is_cursor_at_buffer_end` rejected any non-empty cursor, and helix normal rests as a min-width-1 block. So both history hint completion and the fish-style prefix search on up/`k` were silently inapplicable in helix normal, while vi normal (an empty point under `OnGrapheme`) kept working. Cursor shape alone cannot tell vi visual's `v`-started one-grapheme selection from helix normal's resting block, thus the mode has to say whether a non-empty cursor is intentional: `PromptEditMode::is_selection_mode`. This is `07b6599` from `helix-mode-wip`, which nushell#1138 left behind when helix was rebuilt onto `helix-mode`; `8a4ac80` carried only the append side of that pair.
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.
Summary
is_cursor_at_buffer_endrejected any non-empty cursor, and helix normal rests as a min-width-1 block rather than an empty point.The guard was thus never true there, so both history hint completion and the fish-style prefix search on up/k were silently inapplicable in helix normal, while vi normal (an empty point under OnGrapheme) kept working.
Cursor shape alone cannot decide this.
A v-started one-grapheme selection covering the last grapheme and helix normal's resting block are the same range, thus only the mode knows which one it is looking at.
That is what
PromptEditMode::is_selection_modeasks it.No public API change.
Observable behavior:
HistoryHintComplete,HistoryHintWordCompleteand the prefix search now work in helix normal.Additional notes
closes #1185