Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed modeHandler being recreated on every key stroke #4335

Merged
merged 1 commit into from
Dec 7, 2019
Merged

Fixed modeHandler being recreated on every key stroke #4335

merged 1 commit into from
Dec 7, 2019

Conversation

cvaldev
Copy link

@cvaldev cvaldev commented Dec 6, 2019

What this PR does / why we need it:

this.modeHandlerMap.get(editorId) returns undefined all the time, which means that a new modeHandler gets created everytime getOrCreate() gets invoked on every key press. The result was modeHandler always being in its initial state and rendering the editor completely useless.

This fix properly checks if editorId exists in the map, if it does it properly retrieves its modeHandler.

Which issue(s) this PR fixes
Fixes #4332.

Special notes for your reviewer:
I'm not sure if what was expected here was that Map.get() would call EditorIdentity.isEqual() to check editorId against the keys, but that's not what was happening.

Copy link
Member

@J-Fields J-Fields left a comment

Choose a reason for hiding this comment

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

Whoops - this was my fault :) Thanks!

@J-Fields J-Fields merged commit 2e3317b into VSCodeVim:master Dec 7, 2019
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.

Insert mode not working
2 participants