take environment directly in edit method
This commit is contained in:
parent
32487937a9
commit
7728ec97ca
1 changed files with 2 additions and 5 deletions
|
@ -5,14 +5,11 @@ from pathlib import Path
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
def edit(filepath: Path, rootpath: Path = None, texinputs=None):
|
def edit(filepath: Path, rootpath: Path = None, env=os.environ):
|
||||||
env = dict(os.environ)
|
|
||||||
if texinputs:
|
|
||||||
env["TEXINPUTS"] = texinputs
|
|
||||||
if not rootpath:
|
if not rootpath:
|
||||||
rootpath = filepath
|
rootpath = filepath
|
||||||
subprocess.Popen([
|
subprocess.Popen([
|
||||||
"termite",
|
"termite",
|
||||||
"-e",
|
"-e",
|
||||||
f"vim --servername tex-vorlesung --remote-silent {str(filepath)}"
|
f"vim --servername tex-vorlesung --remote-silent {str(filepath)}"
|
||||||
], env=env, cwd=str(rootpath.root))
|
], env=env, cwd=str(rootpath))
|
||||||
|
|
Loading…
Reference in a new issue