Closed zbindenren closed 2 years ago
Thanks for the report. Let me fix this now, wait some minutes~
It should be fixed now~
While I didn't test the case that when an item indeed gets selected(, since I don't know how to use quickfix list...). But with an empty quickfix list and pressing <cr>
I got no error after the newest update. You might try it and let me know the result :)
Now there is no error, but if I hit enter to go to the corresponding instance, nothing happens anymore. So Quickfix window is not working anymore.
@zbindenren: As a temporary solution could you try the following alternative as the triggering command in your .lua file? (If you're using init.vim
then please let me know, I will turn the following into a complete vimscript)
vim.api.nvim_set_keymap('n', '<CR>', "&ft != 'qf' ? 'NeoZoomToggle' : '<CR>'", { expr = true, noremap = true, silent = true, nowait = true })
My intuition is that this would be better done on the client-side(i.e. you decide when to use <cr>
or NeoZoomToggle
), or I will have to update this every time a new filetype is created. But don't worry, I also added a todo for this issue in the README.md that planning to provide an exclude
option. (I will spend some time to reference other plugins)
I think this one would work, since now when I press <cr>
in the list it shows me an error that is expected to appear when pressing <cr>
on empty:
E42: No Errors
Of course I have a lua config :smile: . Your suggestion did almost work, but with the following it seems to work:
keymap(
"n",
"<cr>",
"&ft != 'qf' ? '<cmd> NeoZoomToggle <cr>' : '<cr>'",
{ expr = true, noremap = true, silent = true, nowait = true }
)
see the <cmd>
before NeoZoomToggle
and the <cr>
after.
I think it is enough to solve it on client side and document it in the Readme.
@zbindenren: Lol, you're right, when using expr
some prefix/postfix should be added.(Sorry I was busy on some other things, so a hash debugging) And I'm happy that you resolved it yourself! Thanks for your issue, let me fix the Readme now with your script :)
I use
<cr>
to Toogle zoom. If I press enter in quickfix window to go to the corresponding location, I get the following error: