Skip to content

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

Open
KorigamiK wants to merge 2 commits into
dmtrKovalenko:mainfrom
KorigamiK:fix/prompt-cc-stray-icon
Open

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

Conversation

@KorigamiK

Copy link
Copy Markdown

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
end
end)
end
set_keymap('n', 'cc', clear_query_line, input_opts)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

we probably need remap=true here to be able to remap existing bindings of cc

@KorigamiK KorigamiK Jun 19, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Cool, I've updated this for the cc/S mappings so existing user remaps still resolve.

Pass remap=true so existing user mappings of cc/S still resolve through
our handler, per review feedback.
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