refactor(jump): improve robustness of getmark function

This commit refactors the `getmark` function in the `jump` plugin to improve its robustness and consistency with the rest of the file.

The `LANG=` prefix is added to ensure that the output of the `realpath` command is in a consistent, predictable format. The `command` prefix is used to bypass any potential aliases for `realpath` and `echo`, ensuring that the script executes the intended commands.
This commit is contained in:
google-labs-jules[bot] 2025-10-18 16:00:58 +00:00
commit 2757306ef1

View file

@ -45,11 +45,16 @@ marks() {
done done
} }
function getmark {
LANG= command echo $(command realpath "$MARKPATH/$1") || command echo "No such mark: $1"
}
_completemarks() { _completemarks() {
reply=("${MARKPATH}"/{,.}*(@N:t)) reply=("${MARKPATH}"/{,.}*(@N:t))
} }
compctl -K _completemarks jump compctl -K _completemarks jump
compctl -K _completemarks unmark compctl -K _completemarks unmark
compctl -K _completemarks getmark
_mark_expansion() { _mark_expansion() {
setopt localoptions extendedglob setopt localoptions extendedglob