SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 366 forks source link

New Window Opened on Build #1530

Open adam-blakey opened 3 years ago

adam-blakey commented 3 years ago

I'm on Sublime Text 4113 on Windows 10.

Previously, after I've built my .tex file, the PDF viewer would become the active window and then it would switch back to ST being the active window. However, as of today, after building an entirely new window pops up in ST.

I've noticed with ST 4113 there's an entry "Windows: Always make a new window when launching main executable on Windows". With this release being released today I'm not sure if this is an ST or LaTeXTools issue.

I'd like for the previous behaviour to be restored, where the window I am working on becomes the active window after building.

sekti commented 3 years ago

For me the following fix worked:

The problem seems to be caused by the jump_to_pdf command with enabled keep_focus. LaTeXTools tries to give back focus to sublime by running sublime_executable after keep_focus_delay seconds have expired. If the setting sublime_executable is left blank, then sublime_text.exe is used as a default. As of version 4113, subl.exe should be used a a default instead.

adam-blakey commented 3 years ago

That did the trick. Many thanks!

mzalaya commented 2 years ago

For Sublime text 3 on Windows 10: go into the preferences for the package and set keep_focus to false(this applies to both packages), although this will stop it from being able to give the focus back to Sublime automatically. See in the following link on Stackoverflow