I’m writting a plugin that open the corresponding pdf file when a latex source file is opened. The code
import sublime, sublime_plugin,os,subprocess
class openpdf(sublime_plugin.EventListener):
def on_load(self, view):
fs=view.file_name()
fsp=fs:-4]+".pdf"
if fs-4:]=='.tex' and os.path.isfile(fsp):
subprocess.Popen("\"F:\\Program Files (x86)\\SumatraPDF\\SumatraPDF.exe\" -reuse-instance "+fsp+" -forward-search "+fs+" 1")
does that with sublime text 2 but with sublime text 3, it only opens the pdf when sublime’s already running, i.e. when I open sublime and open a latex file there, and not when I open a latex file from, say, windows file explorer. How to fix that? Thanks!