AutoYADM commit: 2025-04-22 18:15:06

This commit is contained in:
Daniel Fichtinger 2025-04-22 18:15:06 -04:00
parent 5bb20dda7c
commit 7cfc5f8797
2 changed files with 9 additions and 3 deletions

View file

@ -100,16 +100,17 @@ if not string match -q '*.typ' $src
qecho "$(path basename $src) is not a Typst file!"
return $ret
end
# change to pdf extension
# change abs path to pdf extension
set -l targ (string replace '.typ' '.pdf' $src)
# get pdf target's base name
set -l base (path basename --no-extension $src).pdf
# if a suitable pdf exists in the same dir, open it
if test -f "$targ"
# zathura "$targ" &>/dev/null &
zopen "$targ"
else
# no such file in current dir, time to search!
# if we're in a git repo, search from root
# if we're in a git repo, search from its root
# if we're not, search from cwd
if git rev-parse --is-inside-work-tree &>/dev/null
set root (git rev-parse --show-toplevel)