Replace reset-prompt with push-line and accept-line
The in memory history is not updated until an accept line command, so you
have to push enter before it is correct, this commit replaces the reset-prompt
with an accept-line. It also adds a push-line, to preserve the current editing
buffer
Diff
1diff --git a/plugins/per-directory-history/per-directory-history.plugin.zsh b/plugins/per-directory-history/per-directory-history.plugin.zsh
2index 22383b8b96cf7ff31738fe4ebf3d9a8f28223e13..61e8b5a62753d7d4af5772115203d32acff1e743 100644
3--- a/plugins/per-directory-history/per-directory-history.plugin.zsh
4+++ b/plugins/per-directory-history/per-directory-history.plugin.zsh
5@@ -65,12 +65,13 @@
6 function per-directory-history-toggle-history() {
7 if [[ $_per_directory_history_is_global == true ]]; then
8 _per-directory-history-set-directory-history
9- echo "using local history\n"
10+ print "\nusing local history\n"
11 else
12 _per-directory-history-set-global-history
13- echo "using global history\n"
14+ print "\nusing global history\n"
15 fi
16- zle reset-prompt
17+ zle .push-line
18+ zle .accept-line
19 }
2021 autoload per-directory-history-toggle-history