Fix vim macros duplicating inserted characters#8470
Fix vim macros duplicating inserted characters#8470AshtonCoates wants to merge 5 commits intomarimo-team:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
manzt
left a comment
There was a problem hiding this comment.
Thanks for putting this up. I can see that our handleKey approach breaks macros.
However, I believe removing this block disables insert-mode syncing across cells, which we don't want to regress. We likely need a more direct way to enter insert mode on sibling editors (similar to how the "normal" case calls Vim.exitInsertMode directly).
|
Thanks for the feedback, I hadn’t considered the syncing issue. I’m still getting familiar with the codebase and frontend framework, so I appreciate the clarification. I’ll take another look and work on a more robust approach |
|
Just realized last commit included a regression, I'll fix soon |
|
@manzt I implemented a workaround by essentially skipping the mode change broadcast when we're recording or playing a macro. This shouldn't break synchronization because a macro should take place within one cell anyways, and should always start and end in normal mode. |
📝 Summary
Fixes issue with CodeMirror where vim macros would duplicate characters typed in insert mode.
Closes #8469
🔍 Description of Changes
I believe that the
handleKeymethod is called once per editor instance. Thus if we have 3 cells (editors) and enter insert mode, each of the 3 editors insert each character typed.By removing the relevant code block I was able to fix this behavior and have not observed any side-effects.
Added comment to explain logic flow for this section
I did not add a test for this issue, but all existing other tests are passing after the change.
📋 Checklist