Vscode: Subsequent calls to find in Files (⇧⌘F) shortcut causes unexpected buffer focus

Created on 15 Feb 2018  ·  3Comments  ·  Source: microsoft/vscode

The Issue

The find in Files (⇧⌘F) keyboard shortcut focuses the editor instead of highlighting the current search term on subsequent executions.

Contrary to most editors, while the search field is focused, the second press of ⇧⌘F causes the right-hand editor pane to become focused. This then inadvertently becomes the cause of potential erroneous character entry into the currently loaded buffer.

Under normal behavior, I would expect to:

  1. Press ⇧⌘F
  2. Type a search term and press enter to execute search
  3. Not find what I'm looking for, press ⇧⌘F again to highlight existing term
  4. Type a new search term and press enter to execute the new search

Proposed solution

After a search, the next call to Find in Files (⇧⌘F) would highlight the current search term instead of the editor. Subsequent calls would toggle back to editor focus. In addition, if no search was performed initially, the subsequent call would again return to the editor. This would: 1. Only minimally affect existing behavior; 2. Bring current behavior into line with most other editors, and 3. Maintain the ability to toggle between the search field and the editor.


VS Code Info

  • VSCode Version: Code 1.19.3 (7c4205b5c6e52a53b81c69d2b2dc8a627abaa0ba, 2018-01-25T10:25:01.248Z)
  • OS Version: Darwin x64 17.4.0
  • Extensions:

Extension|Author (truncated)|Version
---|---|---
material-icon-theme|PKi|3.2.2
code-settings-sync|Sha|2.8.7
markdown-preview-github-styles|bie|0.1.0
vscode-eslint|dba|1.4.5
vscode-coffeescript-preview|dre|0.1.4
gitlens|eam|8.0.0
vscode-power-mode|hoo|2.1.0
goto-last-edit-location|kri|0.2.1
id-generator|mat|1.0.0
csharp|ms-|1.14.0
debugger-for-chrome|msj|4.1.0
coffeescript-formatter|prp|1.0.1
code-spell-checker|str|1.6.3
language-stylus|sys|1.9.0
hipsum|thi|1.0.7
selectline-statusbar|tom|0.0.2


Steps to Reproduce:

  1. press ⇧⌘F
  2. type something in the search
  3. press ⇧⌘F again, note that the editor buffer is focused instead of the existing search field


Reproduces without extensions: Yes

bug search verified

All 3 comments

This is by design, but there have been a lot of issues about this, and I'm second guessing this behavior as the default, and I want to leave this open and consider this for some point in the future.

fyi @sandy081

@sandy081 I think I should change this during this month, as long as we're already changing keyboard shortcuts around search.

This would just be a change to the default keybindings so that cmd+shift+f would not focus the editor, when focus is in the search input box.

Yeah makes sense to me.

Was this page helpful?
0 / 5 - 0 ratings