vague2k / huez.nvim

All things color related. All Lua.
MIT License
102 stars 3 forks source link

Bug: Pressing Esc while in Insert mode closes Huez instead of switching to Normal mode #35

Closed amenrio closed 1 month ago

amenrio commented 1 month ago

Reading the new documentation, I noticed that there are some commands listed for normal mode, but I'm always in insert and any command to enter normal mode just closes Huez

vague2k commented 1 month ago

have you checked that you don't have a key map re-binded somewhere?

amenrio commented 1 month ago

I can look into it but I don't know if I'm missing something...

What is the expected use?

I have set up the keybinds in the README, all those commands open Huez in INSERT mode, pressing \<C-c>, \<Esc> and so just closes Huez.

What key(s) is supposed to put me back into normal mode?

vague2k commented 1 month ago

Usually in telescope when pressing from insert mode it usually takes you into normal mode first, and you would have to hit again to actually close the picker. Is the behavior ur describing also present when using telescope for other tasks?

amenrio commented 1 month ago

Yes telescope works fine, that's why I was confused thinking that I must have missed something (Wouldn't be the first nor the last time).

Huez is behaving differently. Pressing \<Esc> just closes any Huez window.

vague2k commented 1 month ago

I'll look into this then, maybe there was an error on my part with the implementation of the mapping's actions. I'll ping you if that ok

amenrio commented 1 month ago

Sorry if I'm completely mistaken. I dont know lua that much nor telescope or your plugin, but based just on function names, I found this:

https://github.com/vague2k/huez.nvim/blob/c336dbc939253a9fca0af5259f2cbceaf0bba21d/lua/huez/pickers/live/actions.lua#L42

Maybe I'm completely wrong tho. but maybe it was helpful

vague2k commented 1 month ago

Yes, this was the intended behavior because I have <esc> in insert mode binded to <jk> but did not realize that hitting the actual escape key in insert mode while in the picker, will close the picker outright.

I will fix this a little later today, thanks for the issue!

amenrio commented 1 month ago

Changed the title to be more precise and explanatory.

vague2k commented 1 month ago

@amenrio I Tested the changes on my end and escaping from insert mode now goes into normal mode, letting you close the picker from normal mode.

Let me know if this was the behavior you were expecting.

amenrio commented 1 month ago

Yes! That's it! Thank you for fixing it that quickly and good luck going forward!