Skip to content

fix(nvim): keep prompt icon when clearing input with cc/S#615

Merged
dmtrKovalenko merged 2 commits into
dmtrKovalenko:mainfrom
KorigamiK:fix/prompt-cc-stray-icon
Jun 21, 2026
Merged

fix(nvim): keep prompt icon when clearing input with cc/S#615
dmtrKovalenko merged 2 commits into
dmtrKovalenko:mainfrom
KorigamiK:fix/prompt-cc-stray-icon

Conversation

@KorigamiK

Copy link
Copy Markdown
Contributor

Summary

Fixes #614.

With prompt_vim_mode = true, clearing the query from normal mode with cc/S left a stray prompt icon behind that had to be backspaced out.

The input bar is a buftype=prompt buffer whose prompt icon is protected text at the start of the line. cc/S delete the whole line including the prompt, so Neovim re-inserts the icon as plain literal text.

Fix

In prompt_vim_mode, map cc and S to reset the line to just the prompt and re-enter insert at the correct column. Clearing the query now leaves the prompt intact, and the resulting empty-query search runs as normal.

Testing

  • Manually verified cc and S from normal mode in prompt_vim_mode clear the query and keep the prompt icon, with the cursor placed right after it in insert mode.

In prompt_vim_mode the input bar is a prompt buffer whose prompt icon is
protected text at the start of the line. A normal-mode cc/S deletes the
whole line including the prompt, so Neovim re-inserts the icon as plain
literal text that has to be backspaced out.

Map cc and S to reset the line to just the prompt and re-enter insert at
the right column, so clearing the query leaves the prompt intact.
Copilot AI review requested due to automatic review settings June 18, 2026 21:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread lua/fff/picker_ui/ui_creator.lua Outdated
Pass remap=true so existing user mappings of cc/S still resolve through
our handler, per review feedback.
@dmtrKovalenko dmtrKovalenko merged commit 190de87 into dmtrKovalenko:main Jun 21, 2026
51 of 52 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.

cc/S in the prompt (vim mode) leaves a stray prompt icon that must be backspaced

3 participants