fix(vim): support Ctrl+N/Ctrl+P for completion menu navigation#2587
Closed
qwen-code-ci-bot wants to merge 1 commit intomainfrom
Closed
fix(vim): support Ctrl+N/Ctrl+P for completion menu navigation#2587qwen-code-ci-bot wants to merge 1 commit intomainfrom
qwen-code-ci-bot wants to merge 1 commit intomainfrom
Conversation
- Add Ctrl+P/N bindings for COMPLETION_UP/DOWN commands - Allow Ctrl+N/P passthrough in vim INSERT mode for completion handling - Fixes issue where Vim mode users couldn't use Ctrl+N/P to navigate autocomplete menu
Contributor
📋 Review SummaryThis PR adds Ctrl+N/Ctrl+P keyboard shortcuts for completion menu navigation in Vim mode, addressing issue #2561. The implementation is minimal and focused, modifying only two files to add the expected Vim-style key bindings while ensuring they don't conflict with existing functionality. 🔍 General Feedback
🎯 Specific Feedback🔵 Low
const isCompletionNavigationKey = (key: Key) =>
key.ctrl && (key.name === 'n' || key.name === 'p');
✅ Highlights
|
Contributor
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
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.
TLDR
在 Vim 模式下支持使用 Ctrl+N/Ctrl+P 导航自动补全菜单(@文件选择和/命令完成)。
Dive Deeper
问题: Vim 用户期望使用 Ctrl+N(下一个)和 Ctrl+P(上一个)进行补全菜单选择,这是 Vim/NeoVim 的标准行为。但当前实现只支持箭头键。
解决方案:
COMPLETION_UP和COMPLETION_DOWN命令添加 Ctrl+P/N 绑定修改文件:
packages/cli/src/config/keyBindings.ts- 添加 Ctrl+P/N 绑定packages/cli/src/ui/hooks/vim.ts- INSERT 模式放行 Ctrl+N/PReviewer Test Plan
/settings vimMode true)@或/触发补全菜单Testing Matrix
Linked issues
Fixes #2561