Skip to content

Commit

Permalink
Merge pull request #337 from petereichinger/master
Browse files Browse the repository at this point in the history
Fixes keep_focus and forward_sync
  • Loading branch information
msiniscalchi committed Mar 14, 2014
2 parents 89409d1 + ce5ffd8 commit 517c5a3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion jumpToPDF.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,21 @@ def run(self, edit, **args):
# self.view.run_command("send_dde",
# { "service": "SUMATRA", "topic": "control", "command": command})
# Now send ForwardSearch command if needed

si = subprocess.STARTUPINFO()
if setfocus == 0:
si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
si.wShowWindow = 4 #constant for SHOWNOACTIVATE

startCommands = ["SumatraPDF.exe","-reuse-instance"]
if forward_sync:
subprocess.Popen(["SumatraPDF.exe","-reuse-instance","-forward-search", srcfile, str(line), pdffile])
startCommands.append("-forward-search")
startCommands.append(srcfile)
startCommands.append(str(line))

startCommands.append(pdffile)

subprocess.Popen(startCommands, startupinfo = si)
# command = "[ForwardSearch(\"%s\",\"%s\",%d,%d,0,%d)]" \
# % (pdffile, srcfile, line, col, setfocus)
# print (command)
Expand Down

0 comments on commit 517c5a3

Please sign in to comment.