Skip to content

Commit e17c210

Browse files
authored
Merge pull request #14 from aaronjensen/trigger-cd-hooks
Trigger cd hooks after jumping in zsh
2 parents 65ee417 + ceb4772 commit e17c210

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

fzf-marks.plugin.zsh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ function handle_symlinks() {
4141
echo "${fname}"
4242
}
4343

44+
# Ensure precmds are run after cd
45+
function redraw-prompt() {
46+
local precmd
47+
for precmd in $precmd_functions; do
48+
$precmd
49+
done
50+
zle reset-prompt
51+
}
52+
zle -N redraw-prompt
53+
4454
function jump() {
4555
local jumpline jumpdir bookmarks
4656
jumpline=$($(echo ${FZF_MARKS_COMMAND}) --bind=ctrl-y:accept --query="$*" --select-1 --tac < "${BOOKMARKS_FILE}")
@@ -50,7 +60,7 @@ function jump() {
5060
perl -p -i -e "s#${jumpline}\n##g" "${bookmarks}"
5161
cd "${jumpdir}" && echo "${jumpline}" >> "${BOOKMARKS_FILE}"
5262
fi
53-
zle && zle reset-prompt
63+
zle && zle redraw-prompt
5464
}
5565

5666
function dmark() {

0 commit comments

Comments
 (0)