最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

visual studio code - Close References Peek Using Keyboard Shorttcut | VSCode - Stack Overflow

programmeradmin0浏览0评论

When I execute the command Peek References above a class for example, it opens up a peek window. How do I close it using a keyboard shortcut?

There are other peeks as well like Git: View Changes that opens a similar preview. How do I close that previews with this type of style in general using a keyboard shortcut (meaning a custom command that I can map a mapping to)?

When I execute the command Peek References above a class for example, it opens up a peek window. How do I close it using a keyboard shortcut?

There are other peeks as well like Git: View Changes that opens a similar preview. How do I close that previews with this type of style in general using a keyboard shortcut (meaning a custom command that I can map a mapping to)?

Share Improve this question asked Feb 1 at 9:33 William FernsWilliam Ferns 211 silver badge1 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

In general, Escape will close alot of vscode's various pop-up windows and views. In the particular case of Peek References the command you would rebind is

{
  "key": "escape",                   // put your new command here
  "command": "closeReferenceSearch",
  "when": "editorTextFocus && referenceSearchVisible && !config.editor.stablePeek || referenceSearchVisible && !config.editor.stablePeek && !inputFocus"
}

Since I knew Escape would close that peek widget, I first ran the Palette Command Developer: Toggle Keyboard Shortcuts Troubleshooting. Then open a peek references window, hit Escape, and looked at the Output to see which command (and its when clause) was triggered.

发布评论

评论列表(0)

  1. 暂无评论