Closed axieax closed 1 year ago
Update: I'm using lazy.nvim and yes this is due to nvim-cmp
conflicts. Managed to resolve this by putting nvim-cmp
on InsertEnter
and autolist.nvim
on InsertCharPre
to ensure this plugin's mappings get set after nvim-cmp
. However, this causes issues with Telescope and other non-related filetypes due to loading, so it isn't the most preferable solution. Are there better ways?
@axieax For the non-related filetypes problem, I recommend using the ft
lazy loading to only load on specific filetypes like in the readme, and then using the priority
to load after your other plugins. I would like lazy.nvim to support ft
and event
, so you can control the plugins to load one after the other, but idk, my workaround is just using ft
and priority
.
I'm using ft
and just tried priority
of 2 for this plugin, but I still get this issue.
Is autolist loading after the conflicting plugin?
Seems like it isn't, since ft
seems to occur before nvim-cmp
's InsertEnter
, even if I add event = "InsertEnter"
for autolist.
Try to use priority to load autolist.nvim nvim-cmp. For example, set nvim-cmp's priority to 2, and then set autolist.nvim's priority to 1
@axieax For the non-related filetypes problem, I recommend using the
ft
lazy loading to only load on specific filetypes like in the readme, and then using thepriority
to load after your other plugins. I would like lazy.nvim to supportft
andevent
, so you can control the plugins to load one after the other, but idk, my workaround is just usingft
andpriority
.
ft
+ event
is possible. Mine is like this:
{ 'hrsh7th/nvim-cmp', event = {'InsertEnter', 'CmdlineEnter'}, ... }
{ 'windwp/nvim-autopairs', event = 'InsertEnter', ... },
{
'gaoDean/autolist.nvim',
event = 'CursorHold *.md',
dependencies = 'windwp/nvim-autopairs',
...
},
<Tab>
worked for me with this loading order. If not maybe try adding 'gaoDean/autolist.nvim'
to the dependencies list of nvim-cmp
.
Hmm, I'm still getting this issue even with both of your suggestions :/
@axieax For the non-related filetypes problem, I recommend using the
ft
lazy loading to only load on specific filetypes like in the readme, and then using thepriority
to load after your other plugins. I would like lazy.nvim to supportft
andevent
, so you can control the plugins to load one after the other, but idk, my workaround is just usingft
andpriority
.
ft
+event
is possible. Mine is like this:{ 'hrsh7th/nvim-cmp', event = {'InsertEnter', 'CmdlineEnter'}, ... } { 'windwp/nvim-autopairs', event = 'InsertEnter', ... }, { 'gaoDean/autolist.nvim', event = 'CursorHold *.md', dependencies = 'windwp/nvim-autopairs', ... },
<Tab>
worked for me with this loading order. If not maybe try adding'gaoDean/autolist.nvim'
to the dependencies list ofnvim-cmp
.
For some reason, the CursorHold *.md
doesn't even load the plugin for me
Hmm, how about event = 'InsertEnter *.md'
for autolist
@axieax? Seems like the recent change for VeryLazy
event makes CursorHold
behavior change. CursorHold *.md
doesn't work on my local too, but InsertEnter *.md
works.
InsertEnter loads the plugin now which is great, but the issue still occurs, even though the ordering is correct. The issue is primarily with nvim-cmp and autolist's mapping of <Tab>
. I've set nvim-cmp as a dependency of autolist which seems to resolve the loading order as well, but the main issue with the error still occurs (nil
entry).
@axieax oh I had that problem as well from a bad commit, just update and it should be fine
A bit strange. I tried to reproduce with cmp
, autopairs
and autolist
(see the repro.lua
below) and it seems ok 🤔:
@goingtosleep
and it seems ok
yeah, fixed in #59 (i hope)
* f8b4c11 (HEAD -> main, origin/main, origin/HEAD) mappings: don't use buffer local mappings (#62)
* 6bf8833 (tag: v2.3.0) docs: add recal autocmd to recommended mappings (#60)
* 2ea640d indent: fix older change (#59)
That fixed the issue perfectly! Thank you so much @gaoDean and @goingtosleep :))
~Edit: is it possible to extend the event InsertEnter *.md
to also include text and tex files? I'm trying something like InsertEnter *.md,*.txt,*.tex
but it doesn't seem to work~ (nvm this is a lazy.nvim issue).
Actually, I was a bit confused about this issue because it seems that autolist doesn't work if I press <CR>
too quickly after entering insert mode, and inserts <esc>g@la
. However, this issue does not occur if I wait a bit after entering insert mode and pressing <CR>
. Not sure if this issue is caused by autolist.nvim or lazy.nvim though. Would like to see if you guys can reproduce it!
Note: it's difficult to reproduce because sometimes this happens after very quickly pressing <CR>
, but other times it doesn't even happen. I find it happens more often when I enter insert mode with A
. Also, refreshing the buffer with :e
doesn't even fix it, perhaps since it doesn't trigger another InsertEnter
event, so nvim will need to be reopened each time. I'm guessing this may be caused by the TextChanged
autocmd for force recalculate, but that's just a hunch.
@axieax I'm not too sure, because my keypresses are loaded even before the ui is loaded if i manage to press them really quickly, but the problem could be due to your autolist being loaded on InsertEnter
, and the plugin requires time to load, so when you press i
it must first load the plugin, then you can use it. Perhaps choose a different event?
I've managed to resolve the mapping issue by adding both nvim-cmp
and nvim-autopairs
as a dependency. However, the <Esc>g@la
issue still appears if <CR>
is pressed too soon in insert mode after the plugin loads. Is there anything that can be done to remedy this issue?
Cursor on
|
.Expected behaviour after pressing
<CR>
, getting the auto bullet and pressing<Tab>
:However, one gets this error:
Not sure if this is due to nvim-cmp conflicts.