Skip to content

fix(helix): count the resting block caret as end of buffer - #1192

Open
kronberger-droid wants to merge 1 commit into
nushell:mainfrom
kronberger-droid:fix/helix-normal-buffer-end-guard
Open

fix(helix): count the resting block caret as end of buffer#1192
kronberger-droid wants to merge 1 commit into
nushell:mainfrom
kronberger-droid:fix/helix-normal-buffer-end-guard

Conversation

@kronberger-droid

Copy link
Copy Markdown
Collaborator

Summary

is_cursor_at_buffer_end rejected 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_mode asks it.

No public API change.

Observable behavior: HistoryHintComplete, HistoryHintWordComplete and the prefix search now work in helix normal.

Additional notes

closes #1185

`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HistoryHint(Word)Complete events don't work in Helix Normal mode

1 participant