Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion von/controller/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import re
import shlex
import subprocess
import tempfile
import traceback
Expand Down Expand Up @@ -40,7 +41,7 @@ def user_file_input(
filename = tf.name
if pre_hook is not None:
pre_hook(filename)
subprocess.run([EDITOR, filename])
subprocess.run([*shlex.split(EDITOR), filename])

with open(filename, "r") as tf:
edited_message = "".join(_ for _ in tf.readlines())
Expand Down
3 changes: 2 additions & 1 deletion von/controller/edit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import shlex
import subprocess

from .. import model, view
Expand Down Expand Up @@ -37,7 +38,7 @@ def main(self: object, argv: list[str]):
else:
full_path = model.completePath(entry.path)
preview.make_preview(full_path)
subprocess.call([EDITOR, full_path]) # do editing
subprocess.call([*shlex.split(EDITOR), full_path]) # do editing

problem = model.makeProblemFromPath(entry.path)
new_entry = model.updateEntryByProblem(old_entry=entry, new_problem=problem)
Expand Down
4 changes: 3 additions & 1 deletion von/fzf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import shlex
import subprocess
import sys

from .model import PickleMappingEntry, VonIndex, setCache
from .puid import inferPUID
Expand All @@ -21,7 +23,7 @@ def fzf_choose() -> str:
"-d",
r"\t",
"--preview",
"python -m von show {2}",
f"{shlex.quote(sys.executable)} -m von show {{2}}",
"--preview-window",
"down",
],
Expand Down
Loading