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

Support opening text document with provided visible ranges from diff editor #53465

Closed
ajackson-cpi opened this Issue Jul 2, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@ajackson-cpi

ajackson-cpi commented Jul 2, 2018

Issue Type: Bug

When viewing a Source Code Management (git) diff editor, I scroll to the interesting areas. But when I click "Open File" to be rid of the left-side view, I'm reset to the top of the file.

Though minor, its impact is significant: I'm usually thinking about the change to be made, not about file navigation. This causes confusion by kicking me out of the solution mindset and into trying to re-discover the code area.

VS Code version: Code 1.24.1 (24f6262, 2018-06-13T17:41:50.128Z)
OS version: Darwin x64 17.5.0

System Info
Item Value
CPUs Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz (8 x 2800)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
vpx_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 16, 23
Memory (System) 16.00GB (0.80GB free)
Process Argv /Applications/Visual Studio Code.app/Contents/MacOS/Electron -psn_0_2826930
Screen Reader no
VM 0%
Extensions (13)
Extension Author (truncated) Version
ng-template Ang 0.1.9
vscode-docker Pet 0.0.27
vscode-database baj 1.5.1
gitlens eam 8.4.1
Angular2 joh 6.1.1
vscode-sshfs Kel 1.9.2
atom-keybindings ms- 3.0.4
Go ms- 0.6.84
vetur oct 0.12.5
remote-vscode raf 1.1.0
vscode-redis vit 1.2.0
vscode-todo-highlight way 0.5.12
vscode-proto3 zxh 0.2.1
@joaomoreno

This comment has been minimized.

Member

joaomoreno commented Jul 3, 2018

Does this work for you if you set a cursor/selection before switching editors?

@ajackson-cpi

This comment has been minimized.

ajackson-cpi commented Jul 3, 2018

Yes, Setting a cursor location does resolve it.

@mnikn

This comment has been minimized.

Contributor

mnikn commented Jul 6, 2018

want to contribute on this issue, has someone handled it before?

@mnikn

This comment has been minimized.

Contributor

mnikn commented Jul 8, 2018

@ajackson-cpi what if you set a cursor location first, then you scroll to another area, which position you expect when you open this file? the cursor location or the scroll area?

@ajackson-cpi

This comment has been minimized.

ajackson-cpi commented Jul 9, 2018

My preference is that both the cursor and the scroll location are preserved thereby resembling the left-side of the diff being closed and the right side being unchanged.
Today only the cursor position is preserved and the scroll is re-centered onto it.

Hirico added a commit to Hirico/vscode that referenced this issue Jul 23, 2018

@joaomoreno joaomoreno changed the title from SCM Diff --> Open File --> Line Number Reset to Support opening text document with provided visible ranges Sep 12, 2018

@joaomoreno joaomoreno changed the title from Support opening text document with provided visible ranges to Support opening text document with provided visible ranges from diff editor Sep 12, 2018

@joaomoreno

This comment has been minimized.

Member

joaomoreno commented Sep 12, 2018

Fixed by #54867

@joaomoreno joaomoreno modified the milestones: Backlog, September 2018 Sep 12, 2018

@joaomoreno joaomoreno closed this Sep 12, 2018

joaomoreno added a commit that referenced this issue Sep 12, 2018

Merge pull request #54867 from Hirico/master
Preserve the revealed area after using "Open File" from git-diff editor (fix #53465)

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 27, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.