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

[WIP] Bugfix: 'inoremap jk <esc>' doesn't work as expected #101

Closed
wants to merge 1 commit into from

Conversation

bryphe
Copy link
Member

@bryphe bryphe commented Jun 21, 2019

No description provided.

@CrossR
Copy link
Member

CrossR commented Feb 3, 2020

I've fixed this building (wasn't happy on mac) and tried to get to the bottom of it, but I'm still not so sure what is causing the issue.

The only insight I have is that after doing :inoremap jk <esc> in Oni2 has a weird timeout setting of some form, in that after entering insert mode and typing j, there is nothing shown for any length of time, until the second key is pressed. Pressing j after that point works as normal. Dropping back to normal mode and entering insert mode does the same again for the first press and so on.

The timeout seems to be set correctly, and I can see the map is actually set, but not why it isn't working. I think this is blocking all other maps that are chord like (I've got commentary loading locally and :Commentary works, but the built in bind does not, so its not an insert map issue but maps as a whole).

@bryphe
Copy link
Member Author

bryphe commented Feb 4, 2020

I've fixed this building (wasn't happy on mac) and tried to get to the bottom of it, but I'm still not so sure what is causing the issue.

Cool, thanks for the help here @CrossR !

One suspicion I have is that there are a few counters that are used to 'block' mappings - things like this:

++no_mapping;

There's a few of these counters:

  • no_mapping
  • allow_keys

And then this is used in getchar when deciding if a key is mappable:

* - no_mapping set: mapping disabled (e.g. for CTRL-V)

I'm curious if maybe our 'state machine' isn't handling this correctly - there might be cases where we aren't properly incrementing / decrementing those values after refactoring to the state machine.

One other thing - there isn't a mechanism for handling the timeout, I believe - I think the way it works is that Vim expects a K_CURSORHOLD character:

{K_CURSORHOLD, nv_cursorhold, NV_KEEPREG, 0},

And I think we'd need to send that occasionally to time out Vim.

I've got commentary loading locally and :Commentary works, but the built in bind does not, so its not an insert map issue but maps as a whole).

Nice! That's promising. If we can get these binds working, that's a great step towards more Vim plugin support.

@bryphe
Copy link
Member Author

bryphe commented Nov 24, 2020

This is now handled in the Onivim layer - no longer needed here.

@bryphe bryphe closed this Nov 24, 2020
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.

None yet

2 participants