VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.8k stars 1.31k forks source link

Dismiss notifications with `<Esc>` when editor selected. #2258

Open terudon opened 6 years ago

terudon commented 6 years ago

Is this a BUG REPORT or FEATURE REQUEST? (choose one): FEATURE REQUEST

What happened: Pressing when editor is focussed (and in normal mode) I can't dismiss notifications.

What did you expect to happen: Without VsCodeVim installed. Pressing properly dismisses notifications. When in normal mode, should bubble upwards to trigger dismissal of notifications.

How to reproduce it (as minimally and precisely as possible): Have a notification visable and have editor focussed. Pressing when in normal mode won't dismiss the notification.

Environment:

jpoon commented 6 years ago

I think this may be an upstream issue. Not sure if VS Code offers an extension API to close notifications. Can you file an issue against VS Code and link it here?

jpoon commented 6 years ago

Closing this in favor of https://github.com/VSCodeVim/Vim/issues/2258 as the root fix is the same.

netpro2k commented 6 years ago

@jpoon I assume you meant to link a different issue number, you pointed back at this issue in your last comment.

Chillee commented 6 years ago

@netpro2k Does pressing shift+<esc> do what you want?

jpoon commented 6 years ago

@netpro2k. Hmm, I actually have no idea what issue I was supposed to link to. Re-opening.

terudon commented 6 years ago

@Chillee Yes, shit+\ does what I need it to do and is actually a workable solution for me. Thanks!

Chillee commented 6 years ago

@jpoon @terudon I think we've discussed this before on another issue, and I think shift+<esc> might be the best solution. <esc> is an extremely common key that's basically unavoidable in vim, and I don't think forcing the users to close notifications through <esc> is the best idea.

I think we should make it more clear that you can use shift+<esc>.

Only concern is that I'm not really sure how this plays out with people who use jj as <esc>.

julienvincent commented 2 years ago

FYI, for future readers, I resolved this issue with a keybinding override:

{
  "key": "escape",
  "command": "hideSuggestWidget",
  "when": "suggestWidgetVisible && textInputFocus"
}

Which seems to take precedence over the Vim default binding. This will not enter normal mode as well, and so requires two esc keypresses to go from suggest widget -> normal mode. Personally, I prefer it like that anyway

gvnadir commented 2 months ago

I had the same problem and fixed it by adding the lines below to my keybindings.json file:

{
  "key": "escape",
  "command": "notifications.clearAll",
  "when": "notificationToastsVisible"
}