Comments (107)
What is the key combo for opening the file browser?
I also just added :checkhealth which_key
, you may want to check that too.
What do you get when doing :map <leader>
from which-key.nvim.
The key combo is fe, but it does the same thing with every "leader" combination that creates a popup I tried so far.
checkhealth which_key gives me that
from which-key.nvim.
That warning is OK.
Only for <leader>
combos, or also for other things like g
?
from which-key.nvim.
No, just tried and this doesn't happen for g. It seems to me that only if I open a popup I have this problem, since also things like comment line (c), packer sync (ps) works fine
from which-key.nvim.
Can you tell me exactly what happens when you do:
- type
<leader>
and wait till popup, then typef
- type
<leader>f
and wait till popup
For both of the above, is the popup correctly showing the e
option?
do you have more mappings under <leader>fe
? like <leader>feeeee
or something like that?
from which-key.nvim.
Is the key combo a <plug>
by any chance?
from which-key.nvim.
Yes it shows correctly, and if I do it slowly I don't have any problem at all.
Nop, it's the only mapping under <leader>fe
, but also things like <leader>ff
, mapped to telescope find files doesn't work, and it isn't a <plug>
, this is the mapping
vim.api.nvim_set_keymap('n', '<Leader>fe', '<cmd>lua require(\'telescope.builtin\').file_browser({hidden = true})<CR>', {hidden = true, noremap = true})
from which-key.nvim.
Aha, what is hidden=true
π
Need to check that
from which-key.nvim.
sorry, I typed it wrong, it's a silent = true
I defined a global for the options, so I wrote manually that part and misstyped
from which-key.nvim.
Don't know if this could help, but I have the same problem if I open something through Dashboard: I have set dashboard_default_executive = 'telescope'
, and if I try to open from the dashboard screen something like
lua require(\'telescope.builtin\').oldfiles({hidden = true, shorten_path = true})
I have the same problem
from which-key.nvim.
So pressing enter on one of the dashboard links opens the popup?
from which-key.nvim.
Yes, if I press enter on a dashboard link it behaves as if i instantly completed the key combo, same way as <Leader>fe
from which-key.nvim.
if the popup triggers and stays open, what does the below give?
:lua print(require("which-key.view").keys)`
from which-key.nvim.
and this one:
:lua print(vim.inspect(require("which-key.keys").get_tree("n").tree:get("<leader>fe")))
from which-key.nvim.
For the first one, as soon as I start typing the which key popup closes and i tsrta typing in the telescope popup
the second one gives this output
from which-key.nvim.
That's fine. Even if it closes, when you do that first command, it should show the prefix that was used. Can you show it?
from which-key.nvim.
it gives me just :
I guess I'm not doing it right, what I did is: I opened the telescope popup, i pressed double column to enter command mode, but that closes the which key popup
from which-key.nvim.
I know. Just enter the command after the popup and telescope are closed.
from which-key.nvim.
Doesn't print anything this way, I'm guessing it prints space?
Also, to check if it was actually printing space, i reset the leader key to \
, and everything works fine, I get no problem at all
from which-key.nvim.
So it only seems to be an issue when leader is set to space?
from which-key.nvim.
did you set mapleader
to <space>
instead of a literal space character
?
from which-key.nvim.
I tried now (vim.g.mapleader = '<Space>'
, but it didn't change the problem with dashboard and if I tried to do <Space>fe
nothing happens, and neovim freezes
from which-key.nvim.
mapleader should be a literal " " character
from which-key.nvim.
Oh sorry, it already was a literal space
from which-key.nvim.
Also, I have a function that does:
<cmd>bd!<CR>
then checks if the current buffer is empty, and if it is it opens Dashboard
if the function (which is called by <leader>bd
) just closes the buffer (meaning I have another buffer opened, and so it simply switches to that second buffer) i have no problem at all, but if the Dashboard screen is opened the which key popup is opened, and again, if I do the same key combo, but slow enough, the which key popup does not show up
from which-key.nvim.
I just pushed some changes that may be related to that problem, so would be great if you could see if it fixes this
can you also show the full autocommand for that bd check?
from which-key.nvim.
Just made another change that might be related :)
from which-key.nvim.
(I'm quite a noob soo probably the function sucks )
As for the changes, now even if I do the key combo slowly the popup shows π’
from which-key.nvim.
I want to see the autocmd that triggers that function. Maybe it interfers when the popup closes.
from which-key.nvim.
no autocmd, it's just a mapping to that function
from which-key.nvim.
I'm a bit at loss here. Very weird.
As for the changes, now even if I do the key combo slowly the popup shows π’
So you mean that you type slowly, popup opens, then file broswer launches and popup stays open? Or does it somehow reopen again?
from which-key.nvim.
yes, the first you said, it opens the popup, but when I finish the key combo it behaves as if I did the key combo qiuckly
from which-key.nvim.
Just to be sure:
- then the file browser opens?
- popup stays visible behind the file browser window
from which-key.nvim.
the file browser open, and the popup is visible behind. After I enter the key combo, the popup in the back shows the <leader>
screen, as if I just pressed my leader key:
those in the background are the prefixes of my leader mappings
from which-key.nvim.
update: I think the prolem is with the fact that the leader key is space. I tried to change it to ,
and it worked just fine, without giving me any problem, but I don't understand why the space key doesn't work properly
from which-key.nvim.
It should work with space for sure. Most people (including myself) set that up as their leader.
I have vim.g.mapleader = " "
from which-key.nvim.
That's what I don't understand. I have that exact same line, and it doesn't work, but if instead of " "
i put ","
it just works fine
from which-key.nvim.
Can you try doing :WhichKey <leader>ef
and :WhichKey <space>ef
?
Both should open Telescope without showing the popup.
from which-key.nvim.
I tried both with space
and with ,
as leader key.
:WhichKey <leader>fe
didn't show anything in both cases, while
with ,
as leader
:WhichKey ,fe
worked just fine
with <space>
as leader
:WhichKey <space>fe
didn't show anything
from which-key.nvim.
mapleader
is set to space, before setting those telescope keybindings?
from which-key.nvim.
That is even weirder. Telescope should at least show
from which-key.nvim.
yes, the file in which I define the leader key is the first line of the second file i require in my init.lua, before anything
from which-key.nvim.
There must be something going on with your keybindings somewehre.
:map <leader>fe
:map <leader>f
from which-key.nvim.
from which-key.nvim.
I really don't get it. Those mappings look correct.
Try doing :set timeoutlen=3000
and then quickly doing typing the combo.
There's no reason the popup can even start then, since it will never be hit.
from which-key.nvim.
I also tried verbose map <Leader>
with comma and space set as leader key, but both gave me the same output, set at line 2 from the which key plugin, this is what I got
from which-key.nvim.
those mappings all are correct, that's ok
from which-key.nvim.
If i set timeoutlen to 3000 the popup doesn't show when I press the key combo, but as soon as Telescope popup is opened whichkey popup also opens
from which-key.nvim.
ok! We're getting somewhere :)
Can you share your Telescope config? Do you have any autocmds set there?
from which-key.nvim.
sure, no autocmds there
Do you prefer me sending the zipped folder containing tele config and keymappings or just screenshots?
from which-key.nvim.
You can post it here, or in a Gist. Whatever works for you
from which-key.nvim.
telescope-config.tar.gz
Here it is
from which-key.nvim.
Would alo be great to rule out an issue with Telescope specifically. Maybe add another mapping under <leader>fz
that does something not Telescope and check if the issue also happens with the new mapping,
from which-key.nvim.
Since I had the same problem with the function that showed Dashboard, I tried to create a mapping to <cmd>Dashboard<CR>
, but had the same problem. I then tried with <Space>ps
which is mapped to <cmd>PackerSync<CR>
, and it didn't show the full popup, but just this line
Lastly I tried with something that doesn't create a new window/buffer, <Space>rl
, which is mapped with <cmd>luafile %<CR>
, and that worked just fine
from which-key.nvim.
Any plugins doing something with opened/closed buffers/windows that you know of?
from which-key.nvim.
no errors in :messages
I assume?
from which-key.nvim.
Not that I know, and zero errors in :messages
from which-key.nvim.
Tried to remove almost every plugin and resart neovim, but didn't solve it
from which-key.nvim.
All really weird :)
Maybe install a new Neovim 0.50 nightly?
from which-key.nvim.
Already using 0.5 nightly, should I try to uninstall and reinstall it again?
from which-key.nvim.
If it's older than a week, it's definitely worth a try
from which-key.nvim.
Don't know why, paru just keeps giving me an error, and if I search the Github page it tells me the page is not found. Don't know what is happening right now
from which-key.nvim.
Damn, that sucks π¬
from which-key.nvim.
Any idea what could cause this error?
fatal: ambiguous argument 'nightly': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
==> ERROR: A failure occurred in prepare().
Aborting...
error making: neovim-nightly-git
from which-key.nvim.
Shouldn't it be the master branch?
from which-key.nvim.
Don't know, that's what paru is telling me, I'm trying to go on the github page but it doesn't work either, I get page not found (followed link directly from neovim documentation, stable release works, development doesn't)
from which-key.nvim.
Managed to reinstall it somehow, still the same problem tho
from which-key.nvim.
was worth the try
from which-key.nvim.
The biggest thing I don't get is that with timeoutlen=3000
If you enter <leader>fe
fast, then WhichKey will never be triggered. So very weird you do get the popup then,
from which-key.nvim.
Yeah that's weird, especially because it opens exactly the moment the popup is opened, not after 3000 ms, while if I type very slowly the which key popup opens after 3000 ms as it should
from which-key.nvim.
And what's even weirder to me is that even though verbose map <leader>
gives the same output with comma and space, one works and the other doesn't
from which-key.nvim.
Yeah that's weird, especially because it opens exactly the moment the popup is opened, not after 3000 ms, while if I type very slowly the which key popup opens after 3000 ms as it should
So typing <leader>fe
instantly opens the popup together with Tlescope?
from which-key.nvim.
And what's even weirder to me is that even though
verbose map <leader>
gives the same output with comma and space, one works and the other doesn't
Yeah, that also doesn't make sense.
You are certain that your plugins are loaded after changing leader right?
What if you try leader / ?
from which-key.nvim.
yes if I type <leader>fe
with space as a leader that's what happens
and the plugins are loaded after, I also tried to put the keymapings as the first required file, but still doesn't work
With / works fine, as well as with comma
from which-key.nvim.
That is really odd, since WK uses feedkeys with remap to trigger what was entered. Before executing them, we unhook any triggers to make sure there's no loops, but even then.
Do you have anything that sets buffer-local mappings automatically somewhere that might override leader space?
from which-key.nvim.
It's almost as if something feeds a space character.
from which-key.nvim.
Don't think I have anything of that kind, I surely didn't write anything of this kind and when I tried to delete all the other plugins the problem was the same
from which-key.nvim.
That;s pretty much the only flow I can get:
leader fe opens Telescope,
something else does space
the space opens popup (and as such shows whats under leader)
from which-key.nvim.
Another weird thing is up until yesterday everything worked fine, and I didn't do any major changes to my config
from which-key.nvim.
Apparently if you have a space at the end of a mapping, that might trigger the space character
from which-key.nvim.
Don't have any mapping ending with space
Also, I checked if with my older config (uploaded yesterday, when everything worked) and I still get the same behavior
from which-key.nvim.
This is maybe even weirder than everything else:
I tried to call directly the functions from command mode, both lua require('telescope.builtin').file_browser()
and Dashboard
and I get the same behavior as if I called them with my key mappings
from which-key.nvim.
damn. super weird. Maybe its a terminal issue? Seems like something is echoing a space character.
Open a new file,go to INSERT mode and then do those commandds you just did. Did the buffer add a space?
from which-key.nvim.
As for the terminal, I'm using kitty, so I tried Alacritty but nothing changed. For the second one I tried, and seemed normal to me, no weird space was inserted
Don't know if this is okay or it should give another output, but since <CR>
is what is being used both when I manually call the function and when i call them with key combos I checked verbose map <CR>
and it gave me no mapping found
from which-key.nvim.
I also tried to map <leader><space>
to a print, just to see if it was actually sending an extra space, but it wasn't triggered
from which-key.nvim.
this may be a compatibility issue w/dashboard, which contains its own which-key like implementation from what i remember. have you tried uninstalling dashboard to see if that resolves the issue?
from which-key.nvim.
I use dashboard myself without any issues.
from which-key.nvim.
Just tried, didn't solve :(
from which-key.nvim.
what if you change the dashboard executive to something other than telescope? does the issue persist in both scenarios or is it just <leader>fe
?
as a sidenote,i had a similar issue a while ago with the old which-key, completion or lsp popups, and telescope. for awhile i had autocommands so that each would ignore the other until eventually an update resolved everything. this may be a bit hacky, but ... add the option to ignore certain file/buffer/window types? if some hidden action is feeding a space character on telescope popups, then maybe ignoring telescope buffers entirely will fix it. there's likely other scenarios where ignoring categorically by type rather than by key will come in handy.
from which-key.nvim.
Nop, it happens with everything that opens a new window, even with PackerSync
for example, and this happens even if I manually call the functions
lua require('telescope.builtin').file_browser()
behaves exactly like <leader>fe
for example
from which-key.nvim.
to clarify, when you say "everything that opens a new window" does that mean both new windows AND new popup windows? or only the latter? for packer, are you using your own popup function for its display or the default split window display?
from which-key.nvim.
I mean every window. For example, if I use :Dashboard
I also get the Which Key popup
For packer no custom function, the only "custom" thing in the split is that I set splitright
, but that's it
from which-key.nvim.
ok in the beginning of this thread, you said it only happened for popup windows and packersync worked fine. so something has exacerbated it and i am perplexed.
from which-key.nvim.
It started doing so after a commit I think
What's really perplexing me is that even if I use no key combination at all it gets triggered. I mean, it should not be called at all if I call a function from command mode, and also with every other leader key everything works fine
from which-key.nvim.
It really appears as if something is typing a space after doing anything in lua π€·ββοΈ
from which-key.nvim.
Not just lua it seems, :Dashboard
behaves just the same
Anyways, really appreciate the effort, thanks a lot for all the time spent!
from which-key.nvim.
Just to clarify, WhichKey only triggers on keymapping. There's no funky auto commands or anything like that. I really hope you figure out what's causing this. Super weird
from which-key.nvim.
What if you open Telescope from the commandline prefixed with :noautocmd
? Does it still trigger the popup?
from which-key.nvim.
This way it works correctly!
from which-key.nvim.
So I'm guessing something automatically calls Which key.. I don't know what could it be, I the only two autocmd I have are the following:
autocmd FileType * :norm '"
autocmd TermOpen * setlocal nonumber norelativenumber
from which-key.nvim.
Related Issues (20)
- bug: which-key errors out when pressing wrong key combo in Command Line buffer mode HOT 4
- bug: module 'which-key' not found (Lazy.nvim) after registering maps
- feature: Peek buffers like registers
- feature: Make menu items clickable
- bug: vim.on_key binded function always receive <80><fd>* characters when which-key setup.
- bug: can't disable plugins.presets.z
- feature: Manual trigger of which-key HOT 2
- bug: Mapping vim.cmd functions with arguments will run the function when nvim starts HOT 3
- feature: Ability to highlight letters inside the description
- bug/feature: partial mapping (aliases) don't work as expected HOT 2
- bug: with OSC-52 enabled, which-key doesn't work correctly with registers
- bug: statusline goes away when `cmdheight=0` and `laststatus=3` on latest 0.10 nightly
- bug: Crash on VimEnter when using `mapleader = "<C-Space>"` and setting a mapping with `<C-Space>` instead of `<Leader>` (or defining a group) HOT 1
- bug: cmdheight=0 causes inconsistent behavior between `:` and `;` with whichkey mapping
- can't remap 'z=' to open a which-key menu HOT 1
- Description errorοΌ Increase and decrease window's width
- bug: Missing default bindings - `dd` and `yy` not shown in screen for `d` and `y` keys
- bug: macro execution with :normal @x
- bug: coloring messed up starting from column 2 if wide characters are used
- feature: Add option to exclude + register contents from register display. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from which-key.nvim.