Comments (10)
But let's open another issue to track it.
Alright - let's continue that part in #39!
from vscode-which-key.
I didn't think user can type faster than the rendering of the QuickPick 😅. This actually was on my mind when deciding different solutions for implementing the shortcut ,
for major mode.
Anyway, I will implement a solution/fix that won't have this race condition for shortcut to major mode.
from vscode-which-key.
Hehe 😊 I guess when already having the keybinding memorized, and when it happens to be on two separate fingers, that doesn't hold true anymore 😄
Thanks for taking a look, let me know if I can help somehow!
from vscode-which-key.
Let me note that this seems like an issue in generic too - not sure if it's fixable though, and if so, whether I should open a separate issue for it.
If I hit SPC p f
quickly, I can see pf
being entered into the first QuickPick (before the second one gets displayed), then I end up in the +Project
menu rather than the +Find file in project
one.
edit: I can see there's some handling for this kind of case here:
vscode-which-key/src/menu/menu.ts
Lines 107 to 125 in 9c6ad3a
and indeed it gets much better when I set whichkey.delay
to 1
instead of 0
. Maybe that logic should be active in some way even without a delay. I can try contributing a fix, but it might take me a while as I have a lot on my plate with my own projects 🙂
from vscode-which-key.
To solving the race condition of entering second key right after ,
, I am thinking to supply initial value instead of simulating a key press after waiting the menu to open. The race condition for the original issue is that the simulated press comes after the key x
.
If I hit SPC p f quickly, I can see pf being entered into the first QuickPick (before the second one gets displayed), then I end up in the +Project menu rather than the +Find file in project one.
For this case, it can be adjacent to original issue. But let's open another issue to track it. I think the cause of this is probably because multiple onDidChangeValue
events are called before the pervious one has a chance to complete, and the time to finish onDidChangeValue
probably also increased by #34. Two attempts in my heads are
- Have a queue to batch the
onDidChangeValue
to handle event in sequence. However, probably won't work by itself for the upcoming 1.57 (#34) due to how we modify the input. - Change the input handling completely to eliminate modification of the input field.
indeed it gets much better when I set whichkey.delay to 1 instead of 0. Maybe that logic should be active in some way even without a delay
The difference is that
vscode-which-key/src/menu/menu.ts
Lines 239 to 245 in 9c6ad3a
@The-Compiler Wondering what's the version of vscode you are running? Can you also try which-key version v0.8.4 to see if it's any better? Btw, I am also having trouble reproducing the issue on my computer
from vscode-which-key.
FWIW I can still reproduce this one even after downgrading to v0.8.4, using sleep 2 && xdotool type ',x'
.
from vscode-which-key.
Thanks for checking in :) This in some sense is easier to fix than #39. We just need to build a proper support to pass in initial keys instead of "simulating" keys pressed with consecutively commands.
from vscode-which-key.
On a second thought, this might be solved with approach outlined in #39 with better input handling (queue).
from vscode-which-key.
Released in v0.10.0
. The new implementation should be faster and more robust as it uses a processing queue to handle input change.
It is tested with
sleep 1; xdotool type ,; sleep 0.01; xdotool type x;
# or
sleep 1; xdotool type " "; sleep 0.01; xdotool type mx;
We have to wait for at least 10ms for the UI input to be shown before we can type. That's the limit of what we can do.
from vscode-which-key.
Seems to work beautifully now, at least from what I can see so far. Thanks! 👍
from vscode-which-key.
Related Issues (20)
- New commands do not show in default menu HOT 1
- Unable to create when condition for pin/unpin editor HOT 4
- Option to selectively hide items from menu? HOT 3
- Support for VSCode Web HOT 3
- Navigate up / back in the menu structure HOT 2
- Show key bindings in menus HOT 3
- Support partial override HOT 1
- triggerKey Not Firing from edamagit HOT 7
- Weird behaviour with Github Pull Request extension HOT 1
- `whichkey.delay` causes a delay in `SPC SPC` shortcut, others seem to be unaffected HOT 6
- Add default binding for `git pull`
- Crash when mixing `key` / `keys` and using `whichkey.sortOrder` HOT 2
- [bug/ feature?]: whichkey.searchBindings should support fuzzy search HOT 2
- [Help Wanted] Show the menu when press g HOT 3
- Debug Transient State gets closed. HOT 4
- Support several menus HOT 4
- Space keybind with vscode-neovim and the Commands option HOT 5
- `bindings` vs `bindingOverrides` and `keys` vs `key` HOT 3
- Ability to specify font for menu "keys" HOT 6
- Typos in commands
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 vscode-which-key.