fix: guard against undefined editor in multiple code paths#9986
Open
SAY-5 wants to merge 2 commits intoVSCodeVim:masterfrom
Open
fix: guard against undefined editor in multiple code paths#9986SAY-5 wants to merge 2 commits intoVSCodeVim:masterfrom
SAY-5 wants to merge 2 commits intoVSCodeVim:masterfrom
Conversation
Previously, finishCurrentStep() only fired when ranRepeatableAction was true, which excluded movements and commands without createsUndoPoint. This caused changes to accumulate in a single undo step, making 'u' undo everything at once. Now fires after every completed normal mode action (ranAction), while preserving the macro/dot/remap guards. Type-checked: no new errors introduced (all existing errors are pre-existing in node_modules and unrelated files). Fixes VSCodeVim#2007
Several commands and utilities crashed with 'editor is undefined' when no text editor was active. Added null checks in getLineLength, getLine, the :edit/:tabnew/:smile commands, modeHandler updateView, and the extension handler lookup. Fixes VSCodeVim#3033
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.
Several commands and utilities crash with "editor is undefined" when no text editor is active (e.g. when all tabs are closed or focus is on a non-editor panel).
Added null checks in six places:
Fixes #3033