Giter Site home page Giter Site logo

Comments (107)

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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
image

As for map i get this
image

from which-key.nvim.

folke avatar folke commented on May 21, 2024

That warning is OK.

Only for <leader> combos, or also for other things like g?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Can you tell me exactly what happens when you do:

  1. type <leader> and wait till popup, then type f
  2. 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.

folke avatar folke commented on May 21, 2024

Is the key combo a <plug> by any chance?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Aha, what is hidden=true πŸ™‚
Need to check that

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

So pressing enter on one of the dashboard links opens the popup?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

if the popup triggers and stays open, what does the below give?

:lua print(require("which-key.view").keys)`

from which-key.nvim.

folke avatar folke commented on May 21, 2024

and this one:

:lua print(vim.inspect(require("which-key.keys").get_tree("n").tree:get("<leader>fe")))

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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
image

from which-key.nvim.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

I know. Just enter the command after the popup and telescope are closed.

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

So it only seems to be an issue when leader is set to space?

from which-key.nvim.

folke avatar folke commented on May 21, 2024

did you set mapleader to <space> instead of a literal space character ?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

mapleader should be a literal " " character

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

Oh sorry, it already was a literal space

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Just made another change that might be related :)

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

(I'm quite a noob soo probably the function sucks )
image

As for the changes, now even if I do the key combo slowly the popup shows 😒

from which-key.nvim.

folke avatar folke commented on May 21, 2024

I want to see the autocmd that triggers that function. Maybe it interfers when the popup closes.

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

no autocmd, it's just a mapping to that function

from which-key.nvim.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Just to be sure:

  • then the file browser opens?
  • popup stays visible behind the file browser window

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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:
image
those in the background are the prefixes of my leader mappings

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Can you try doing :WhichKey <leader>ef and :WhichKey <space>ef?
Both should open Telescope without showing the popup.

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

mapleader is set to space, before setting those telescope keybindings?

from which-key.nvim.

folke avatar folke commented on May 21, 2024

That is even weirder. Telescope should at least show

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

There must be something going on with your keybindings somewehre.

  • :map <leader>fe
  • :map <leader>f

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

image
output of :map <leader>fe

image
output of :map <leader>f

from which-key.nvim.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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
image

from which-key.nvim.

folke avatar folke commented on May 21, 2024

those mappings all are correct, that's ok

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

ok! We're getting somewhere :)
Can you share your Telescope config? Do you have any autocmds set there?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

sure, no autocmds there

Do you prefer me sending the zipped folder containing tele config and keymappings or just screenshots?

from which-key.nvim.

folke avatar folke commented on May 21, 2024

You can post it here, or in a Gist. Whatever works for you

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

telescope-config.tar.gz
Here it is

from which-key.nvim.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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
image

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.

folke avatar folke commented on May 21, 2024

Any plugins doing something with opened/closed buffers/windows that you know of?

from which-key.nvim.

folke avatar folke commented on May 21, 2024

no errors in :messages I assume?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

Not that I know, and zero errors in :messages

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

Tried to remove almost every plugin and resart neovim, but didn't solve it

from which-key.nvim.

folke avatar folke commented on May 21, 2024

All really weird :)

Maybe install a new Neovim 0.50 nightly?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

Already using 0.5 nightly, should I try to uninstall and reinstall it again?

from which-key.nvim.

folke avatar folke commented on May 21, 2024

If it's older than a week, it's definitely worth a try

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Damn, that sucks 😬

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Shouldn't it be the master branch?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

Managed to reinstall it somehow, still the same problem tho

from which-key.nvim.

folke avatar folke commented on May 21, 2024

was worth the try

from which-key.nvim.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

It's almost as if something feeds a space character.

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

Apparently if you have a space at the end of a mapping, that might trigger the space character

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

klooj avatar klooj commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

I use dashboard myself without any issues.

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

Just tried, didn't solve :(

from which-key.nvim.

klooj avatar klooj commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

klooj avatar klooj commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

klooj avatar klooj commented on May 21, 2024

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.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

It really appears as if something is typing a space after doing anything in lua πŸ€·β€β™‚οΈ

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

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.

folke avatar folke commented on May 21, 2024

What if you open Telescope from the commandline prefixed with :noautocmd? Does it still trigger the popup?

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

This way it works correctly!

from which-key.nvim.

grecodavide avatar grecodavide commented on May 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.