Skip to content

feat: accept inline suggestion word-by-word with Ctrl+Right / Alt+Right - #993

Merged
HalFrgrd merged 1 commit into
HalFrgrd:masterfrom
ChanningHe:feat/inline-suggestion-word-accept
Sep 17, 2026
Merged

HalFrgrd merged 1 commit into
HalFrgrd:masterfrom
ChanningHe:feat/inline-suggestion-word-accept

Conversation

@ChanningHe

Copy link
Copy Markdown
Contributor

Adds word-wise acceptance of inline history suggestions (like fish / zsh-autosuggestions):

  • Ctrl+Right — accept the next whitespace-delimited word (inlineSuggestionAcceptOneWord)
  • Alt+Right (and Alt+f / Meta variants) — accept the next word part, stopping at punctuation and path segment boundaries (inlineSuggestionAcceptOneWordPart)

Both bindings only fire when a suggestion is shown and the cursor is at the end of the buffer; otherwise they fall through to the existing word-movement actions. Both actions are rebindable via flyline key bind.

Implementation: the rightward word-reach computation is extracted from delete_right_one_word into str-based functions in flybuffer (right_one_word_end_pos), so word-wise accept, delete, and movement share identical boundary semantics. The boundary is computed on buffer + suffix, so already-typed text participates in path slash detection. The remaining suggestion re-renders automatically after each partial accept.

Test plan

  • Unit tests for word boundaries (whitespace / fine-grained / paths / multi-byte)
  • Unit tests for the accept helper (cargo test --lib, cargo test -p flybuffer)
  • fmt / clippy -D warnings / doc clean
  • Manually verified in a live Bash session

@HalFrgrd

HalFrgrd commented Sep 9, 2026

Copy link
Copy Markdown
Owner

I like the idea! Ill try and test it out soon and review this pr

@HalFrgrd

Copy link
Copy Markdown
Owner

I tested it it out and all looks good, thanks!

@HalFrgrd
HalFrgrd merged commit 588a718 into HalFrgrd:master Sep 17, 2026
7 checks passed
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.

2 participants