feat(ui): add vim yank/paste (y/p/P) with unnamed register#22026
feat(ui): add vim yank/paste (y/p/P) with unnamed register#22026jacob314 merged 7 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the text editing experience within the UI's input buffer by introducing core Vim-like yank and paste functionalities. Users can now efficiently copy and move text using familiar Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Fixed For the other points: Change ops and register population ( Register locality: there's only ever one
|
|
/review-frontend manually reviewed by Jacob I have reviewed the frontend code for PR 22026, which introduces Vim yank and paste functionalities ( What I Found
The FixSince The fixed code simplifies both const pasteLength = pasteText.length;
return clampNormalCursor({
...newState,
cursorCol: Math.max(0, newState.cursorCol - (pasteLength > 0 ? 1 : 0)),
preferredCol: null,
});I recommend applying this fix and adding a test covering multiline charwise |
|
Good catch. Applied the fix to both |
…mini#22026) Co-authored-by: Jacob Richman <jacob314@gmail.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
…mini#22026) Co-authored-by: Jacob Richman <jacob314@gmail.com>
…mini#22026) Co-authored-by: Jacob Richman <jacob314@gmail.com>

Follow-up to #21932 and #21973.
Adds the vim unnamed register and yank/paste support to the input buffer:
yy/Y— yank current line (linewise)yw/yW/ye/yE/y$— yank by motion (charwise)p/P— paste after/before cursor; linewise yanks insert a new line, charwise inserts inlinex,X,dd,dw,dW,de,dE,D,df/dt,dF/dT) now populate the register too, sodw→pto move a word works as expectedTested manually:
yy+pto duplicate a line,yw+pto paste a word,dw+pto move a word.