mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
jump plugin: fix autocompletion with single mark
Autocompletion fails if there's only one mark, since the ls command will not display the parent directory with the trailing colon. Handling the single mark case separately and validating the symlink explicitly, resolves the issue.
This commit is contained in:
parent
bf9bdec336
commit
b1a4c437e0
1 changed files with 7 additions and 1 deletions
|
|
@ -38,7 +38,13 @@ marks() {
|
|||
}
|
||||
|
||||
_completemarks() {
|
||||
reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
|
||||
if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then
|
||||
reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g'))
|
||||
else
|
||||
if readlink -e "${MARKPATH}"/* &>/dev/null; then
|
||||
reply=($(ls "${MARKPATH}"))
|
||||
fi
|
||||
fi
|
||||
}
|
||||
compctl -K _completemarks jump
|
||||
compctl -K _completemarks unmark
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue