James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.57k stars 526 forks source link

Source control panel opens unexpectedly when focusing tex file in diff view #2430

Closed bersbersbers closed 3 years ago

bersbersbers commented 3 years ago

Preliminary questions [Required]

Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]

You still see this issue?: Yes

Make sure to visit the wiki FAQ before filling an issue.

You visited the wiki?: Yes

If your issue is with compiling a document (not having to do with finding the root file of a project), check first that you can compile manually.

You can compile a TeX document manually?: N/A

Describe the bug [Required]

Source control panel opens unexpectedly when focusing tex file, but not txt file: idnwua0qoQ

To Reproduce

Steps to reproduce the behavior:

  1. Open folder under source control
  2. Create x.tex and y.txt
  3. Stage both
  4. Open x.tex in diff view: "x.tex (Index)"
  5. Close Source Control
  6. Focus y.txt
  7. Focus x.tex

Expected behavior

Source Control stays closed.

Logs [Required]

image (I cannot copy the text due to an unrelated bug.)

LaTeX Workshop Output [Required]

To access the log, click the 'TeX' icon on the Activity Bar on the left side, select 'View Log Messages', then select 'View LaTeX Workshop extension log'.

(command does not do anything - note I am not compiling)

Developer Tools Console [Required]

  ERR [File Watcher (node.js)] Error: ENOENT: no such file or directory, stat 'd:\x\.vscode'
contextKeyService.ts:420 Element already has context attribute
w @ contextKeyService.ts:379
DevTools failed to load SourceMap: Could not load content for https://ticino.blob.core.windows.net/sourcemaps/dbbf7079b20b3036b3ff5ac2e2106b84dd3c6d66/node_modules/windows-process-tree/lib/index.js.map: Unknown error

Screenshots

see above

Desktop [Required]

Additional questions

Are you using VSCodium?

No

Are you using LaTeX Workshop with VS Code Remote?

Yes, but the problem reproduces standalone

tamuratak commented 3 years ago

This is an intended behavior.

https://github.com/James-Yu/LaTeX-Workshop/blob/3cb5d21a6d8bc8676291bcbd53180e5bd7d7cb27/src/main.ts#L207-L212

microsoft/vscode/issues/3742

bersbersbers commented 3 years ago

Thanks. You might add "Source Control" to the FAQ (I did check the FAQ, but "Source Control" did not match anything) and document options (I did look here, but the name of the option did not ring a bell): image

bersbersbers commented 3 years ago

Wait, I misread - this is not working. view.autoFocus.enabled does not do anything when gits.length > 0.

So are you are saying it is intended to reopen the Source Control sidebar when working with git, and it is intended that this cannot be turned off?

bersbersbers commented 3 years ago

https://github.com/microsoft/vscode/issues/3742 is a different issue in my opinion. I don't want to close the side bar after some time, I would like Latex Workshop to not open it in the first place. My screen is not wide enough for two tex docs (remember, that's a side-by-side diff), a pdf preview, and a side bar.

I'd suggest that view.autoFocus.enabled should apply to the source control sidebar as well.

jlelong commented 3 years ago

My feeling is that we should remove https://github.com/James-Yu/LaTeX-Workshop/blob/4b1a338393e5bde8855f19dc8a6b9c66cdd68f45/src%2Fmain.ts#L210-L212

The other language related extensions do not seem to handle the scm view. Other filetypes do not exhibit this behaviour with the scm view.

jlelong commented 3 years ago

This was introduced by 58425b41a09b938240c241a9ff4e8cde4b955d85 but I cannot really see the logic here

jlelong commented 3 years ago

I have just reverted it. Wait and see if anyone complains.

bersbersbers commented 3 years ago

Thanks - looking forward to the next release! (Update: I cherry-picked https://github.com/James-Yu/LaTeX-Workshop/commit/9c5ab86e9b852eca37bc67a4620ebb4352ead920 and built the package myself - working great, thanks again!)