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

Leaving insert-mode (ESC) inserts an underscore one char left of point #180

Open
PorcelainMouse opened this issue Jun 8, 2020 · 4 comments

Comments

@PorcelainMouse
Copy link

PorcelainMouse commented Jun 8, 2020

This happens now when editing a .tex file. I type a word and then hit ESC to exit incert-mode, which takes me out of insert-mode, but first it inserts an underscore in between the last and second-to-last character of the word I just typed.

I just updated my plugins with PlugUpdate, and now I have this strange behavior when editing latex files. I know that it is related to vim-latex because, when I comment out this plugin, this erroneous behavior stops. But, it could obviously be an interaction.

And, it seems to be related to completion. It doesn't happen when completion has finished searching for suggestions. So, if I finish a word, then put a space, then hit ESC, it doesn't happen. Also, if I wait after typing a word until completion gives me a list of suggested completions (or none), then when I hit ESC, it doesn't happen. It's like I'm interrupting completion and that's what causes it, but only if vim-latex is active.

Oh, I'm using deoplete completion.

@gerw
Copy link
Contributor

gerw commented Jun 9, 2020

What happens if you disable 'deoplete completion'? I think this is a strange interaction between both plugins.

@PorcelainMouse
Copy link
Author

I don't fully know how to do it correctly, but I temporarily disabled the deoplete plugin, itself, by removing it from my config file so that it wouldn't get started. That caused some errors, but it worked, meaning the problem symptom was not observed in this condition.

Looking over my configuration, though, I noticed I had an option for deoplete completion set: auto_complete_delay. With this value set to 100 (ms) or greater, the symptom is observed, with it set to 80 or less, the symptom does not occur. So, a workaround is to reduce this delay.

The delay prevents nvim from trying to automatically complete everything I type constantly. This is especially useful in LaTeX, since it can get a little bit in the way when I'm composing regular prose. So, it would be cool to have this conflict resolved. It was originally 300 ms, but I don't know what is the default value; 0 I suspect.

@PorcelainMouse
Copy link
Author

Okay, this is actually a bigger problem that I noticed at first.

'cw' is also broken. Try 'cwESC' and it get 'newwor_d', even with the previous workaround of setting the deoplete delay to a low value (even 0). Do you not see this too? I'm confused. Obviously this is not usable with cw broken.

@PorcelainMouse
Copy link
Author

Oh wait; it is still related to the same thing. it's just that I'm really fast with 'cw' and I beat deoplete finding the replacement word even with delay set to 0. Okay, so it's still the same issue.

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

No branches or pull requests

2 participants