Closed lifepillar closed 7 months ago
Hi, @lifepillar,
Thank you for reporting this issue. I am trying to fix it via https://github.com/TabbyML/tabby/pull/763. Would you mind checking and testing it locally?
This PR adds checks for the script
property of the original <tab>
maparg and determines whether to add <script>
to the imap
command or not. For cases where <nop>
is used, I haven't found a good solution yet, so I simply added a patch to check if the original <tab>
maps to <nop>
and do not fallback in that scenario.
Sorry, I didn't explain myself clearly enough. I've used <nop>
as an example, but the idea is that if Tab is already mapped (in the case of MUcomplete, it is mapped to <plug>(MUcompleteFwd)
), after Tabby remaps Tab the original mapping is added verbatim into the buffer when Tab is pressed.
I wasn't able to spot an obvious problem in the code, which is superficially very similar to copilot.vim's. But, for some reason, copilot.vim works as expected and Tabby doesn't.
Sorry, I didn't explain myself clearly enough. I've used
<nop>
as an example, but the idea is that if Tab is already mapped (in the case of MUcomplete, it is mapped to<plug>(MUcompleteFwd)
), after Tabby remaps Tab the original mapping is added verbatim into the buffer when Tab is pressed.I wasn't able to spot an obvious problem in the code, which is superficially very similar to copilot.vim's. But, for some reason, copilot.vim works as expected and Tabby doesn't.
Thank you. The mentioned PR should address the bug when Tab is mapped to <plug>(MUcompleteFwd)
. It has been released in Tabby plugin v1.1.0. Could you please update the Tabby Plugin to the latest version and test it again to see if the issue is resolved?
I confirmed that the PR fixes the issue. I thought I had pulled it, but apparently I didn't it. Thank you very much!
Add this to your
vimrc
:When Vim is opened,
<tab>
is remapped by Tabby, which takes into account the existing mapping:But pressing Tab now may result in
<nop>
(the five-character string) being inserted literally into the buffer.I noticed that because Tabby conflicts with my MUcomplete plugin, which maps
<tab>
to an internal plug. Then, pressing Tab inserts the plug literally into the buffer. For comparison, copilot.vim does not have this issue and coexists with MUcomplete without problems.