-
Notifications
You must be signed in to change notification settings - Fork 6
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
Unexpected behavior with julia.vim #72
Comments
Based on JuliaEditorSupport/julia-vim#40, particularly JuliaEditorSupport/julia-vim#40 (comment) which states the plugin also conflicts with delimitmate, I'd take a guess and say it's mapping-related. A possible source is resulting in a weird mapping conflict. IIRC, that's also what the OldCR wrapper does. I can't immediately reproduce, but I'm currently stuck on windows where none of my normal automation systems work, and it seems I currently have the wrong version of Python, so coc-snippets doesn't work. Getting everything up-to-date is gonna take a bit of work, and it's 1 in the morning and I just don't feel like doing that right now. I'll take a look tomorrow and see if I can reproduce it then. In the meanwhile, is it just If not, it's probably auto-pairs' "compatible CR mapping" being garbage. I haven't touched it after inheriting the code. It could very well be broken. These types of bugs have been around for a while though, but I've never been able to reproduce any of the previous reports (and they were abandoned, so never got any feedback to help me find the root of the issue) There was a comment in auto-pairs' code about |
Thanks for fast reply. I can confirm that the problem goes when I hit
There is thing weird in here I don't understand is that in julia file it should be three |
The coc.nvim map is the problem. See #66 - not sure why you're not seeing it everywhere, but that's async for you. This is unfortunately a wontfix due to how coc.nvim is structured. Nothing any other plugin does works consistently thanks to its async behavior. Even pum detection (discussed in #66) will fail intermittently. You may be able to make an alternative mapping explicitly integrating auto-pairs instead of As for three maps in the Julia file, no. That's unfortunately not how Vim's keybind system works. You get a buffer keybind and a global keybind for each key. If two different plugins map the same key, only one of them apply. Some plugins try to avoid that (auto-pairs included) by taking whatever is already mapped, prefixing it, and leaving itself as a fallback (or postfixing it and taking priority over the other plugin). Vim's decision to do so makes for quite a few interesting design challenges around commonly mapped keys (again, particularly individual letters, cr, bs, space, ..., in insert mode), and it's all up to the individual plugins to cope |
Also means that the problem is non-deterministic and dependent on unpredictable async operations. Julia.vim might be doing something tipping the scales in favor of the race condition making auto-pairs misbehave, but trying to track it down isn't really possible, and that assumes its a tangible cause to begin with. At an extreme, there could be an autocmd going off (registered by Julia.vim) that ties back to some key typed event that stalls the map processing just long enough (but still on the order of milliseconds at most; it's a race condition, not a performance issue) for an async interrupt to swoop in just in time to break the map, and that nothing else in the configuration provides that thing biasing each keypress towards a race condition. That's why it's inevitably easier to change or remove the map used to make |
I was writing a reply over in Julia.nvim and got nerd sniped. TL;DR: The global In fact, buffer maps are always prioritised over global maps. If not for what auto-pairs does, the global This also means I've narrowed down the problem further. I couldn't reproduce without julia-vim, but when I enabled The problem appears because julia-vim fails to maintain auto-pairs' This means I was wrong; there is indeed a bug here, and it's with julia-vim. |
OS: Windows 11 22H2
**What vim?: gvim, vim 9.0 patch 1-1071
Autopairs config (if applicable):
Describe the bug
When install julia.vim, editting the code for the first time returns
<SNR>122_AutoPairsOldCRWrapper73<SNR>122_AutoPairsReturn
. If open other event for example like NerdTree or other file, then comeback to old file, now you can edit the file normally by magic. I opened the issue in julia.vim for 6 month but there is no new response about this behavior. I suppose there is a bug with one of 2 plugins.Without julia.vim:
162108660-5255620a-0519-4c9b-9db9-8d1eb75f5f47.mp4
With julia.vim:
162109320-a5c4c1a1-8df3-4410-988b-0933403bde15.mp4
Steps to reproduce
Tell me if you can reproduce the bug. Thanks you.
The text was updated successfully, but these errors were encountered: