Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Double-clicking in the file explorer opens two files dues to Open Editors view expanding #128508

Closed
realh opened this issue Jul 12, 2021 · 3 comments · Fixed by #147771
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders open-editors Issues related to the OPEN EDITORS view verified Verification succeeded
Milestone

Comments

@realh
Copy link

realh commented Jul 12, 2021

Issue Type: Bug

  1. Have the "OPEN EDITORS" section of the explorer open, and above the explorer's main section.
  2. Double-click one of the files in the main section, but delay the second click slightly.

The file opens on the first click and gets added to the OPEN EDITORS section. This moves everything below it down by the height of one line, so if that happens before the second click, you're clicking on a different file. Often, instead of opening the second file, it opens a text entry field near the bottom of the explorer's main section (not necessarily anywhere near the mouse cursor) as if I'm trying to create a new file at the top-level of my project.

VS Code version: Code 1.57.1 (507ce72, 2021-06-17T13:26:56.255Z)
OS version: Linux x64 5.12.14-arch1-1
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz (4 x 1015)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
rasterization: disabled_software
skia_renderer: enabled_on
video_decode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 7.64GB (1.52GB free)
Process Argv --no-sandbox --unity-launch --crash-reporter-id f284bc02-8148-43a2-b910-cc5852739e93
Screen Reader no
VM 0%
DESKTOP_SESSION gnome
XDG_CURRENT_DESKTOP GNOME
XDG_SESSION_DESKTOP gnome
XDG_SESSION_TYPE wayland
Extensions (22)
Extension Author (truncated) Version
vscode-styled-jsx bla 2.0.0
vscode-modelines chr 2.0.5
vscode-eslint dba 2.1.23
vscode-html-css ecm 1.10.2
tslint eg2 1.0.47
auto-close-tag for 0.5.11
dotenv mik 1.0.1
vscode-language-pack-en-GB MS- 1.54.1
python ms- 2021.6.944021595
vscode-pylance ms- 2021.7.2
jupyter ms- 2021.6.999662501
remote-containers ms- 0.183.0
remote-ssh ms- 0.65.7
remote-ssh-edit ms- 0.65.7
remote-wsl ms- 0.56.5
vscode-remote-extensionpack ms- 0.21.0
cpptools ms- 1.5.1
lit-plugin run 1.2.1
sourcekit-lsp unp 0.0.1
vim vsc 1.21.5
viml Xad 1.0.1
html-css-class-completion Zig 1.20.0
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30311713
vspre833:30321513
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscus158:30321503
pythonvsuse255:30335481
vscod805:30301674
pythonvspyt200:30331937
vscextlangct:30333562
binariesv615:30325510
bridge0708:30335490

@isidorn isidorn added bug Issue identified by VS Code Team member as probable bug open-editors Issues related to the OPEN EDITORS view labels Jul 26, 2021
@isidorn isidorn added this to the Backlog milestone Jul 26, 2021
@isidorn
Copy link
Contributor

isidorn commented Jul 26, 2021

This is a known limitation. However I could not find the duplicate so let's keep this one open.

@realh
Copy link
Author

realh commented Jul 26, 2021

I did subsequently find the issue that this duplicates, but it had been closed by a bot: #25911.

@isidorn isidorn assigned JacksonKearl and unassigned isidorn Aug 10, 2021
@isidorn isidorn changed the title Double-clicking in the file explorer has a race condition Double-clicking in the file explorer opens two files dues to Open Editors view expanding Aug 10, 2021
@bpasero
Copy link
Member

bpasero commented Sep 10, 2021

The limit is at 250ms currently but in theory can be changed to a higher value:

willOpenElement: e => {
if (!(e instanceof MouseEvent)) {
return; // only delay when user clicks
}
const openEditorsView = this.getOpenEditorsView();
if (openEditorsView) {
let delay = 0;
const config = this.configurationService.getValue<IFilesConfiguration>();
if (!!config.workbench?.editor?.enablePreview) {
// delay open editors view when preview is enabled
// to accomodate for the user doing a double click
// to pin the editor.
// without this delay a double click would be not
// possible because the next element would move
// under the mouse after the first click.
delay = 250;
}
openEditorsView.setStructuralRefreshDelay(delay);
}
},
didOpenElement: e => {
if (!(e instanceof MouseEvent)) {
return; // only delay when user clicks
}
const openEditorsView = this.getOpenEditorsView();
if (openEditorsView) {
openEditorsView.setStructuralRefreshDelay(0);
}
}

@lramos15 lramos15 modified the milestones: Backlog, April 2022 Apr 20, 2022
@tanhakabir tanhakabir added the verified Verification succeeded label Apr 28, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders open-editors Issues related to the OPEN EDITORS view verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants
@bpasero @isidorn @lramos15 @JacksonKearl @realh @tanhakabir and others