fix(jump): correct error handling in getmark function

This commit fixes a bug in the `getmark` function where it would not correctly handle non-existent marks. The previous implementation would swallow the error from `realpath`, causing the `||` condition to not be triggered.

This has been corrected by removing the command substitution and directly checking the exit code of `realpath`. The error message is now correctly printed to stderr, and the function returns a non-zero exit code on failure.
This commit is contained in:
google-labs-jules[bot] 2025-10-18 17:20:21 +00:00
commit dff57f2dd3

View file

@ -46,7 +46,7 @@ marks() {
}
function getmark {
LANG= command echo $(command realpath "$MARKPATH/$1") || command echo "No such mark: $1"
LANG= command realpath "$MARKPATH/$1" 2>/dev/null || { command echo "No such mark: $1" >&2; return 1; }
}
_completemarks() {