diff options
author | Marc Cornellà <marc.cornella@live.com> | 2019-10-24 17:57:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-24 17:57:01 +0200 |
commit | cad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9 (patch) | |
tree | 2b07ec259bbd2b1a4919245669900a87fa87a03b /plugins/zsh-navigation-tools/n-history | |
parent | 225425fe091ca052997833279ccc08643818c24a (diff) | |
parent | 40df67bc3b9b51caa24df5d220487043040d1f9a (diff) | |
download | zsh-cad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9.tar.gz zsh-cad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9.tar.bz2 zsh-cad48e38bfbfa6e3e0096caddf330d6fc8f1ffb9.zip |
Merge branch 'master' into fabric_task_description
Diffstat (limited to 'plugins/zsh-navigation-tools/n-history')
-rw-r--r-- | plugins/zsh-navigation-tools/n-history | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/plugins/zsh-navigation-tools/n-history b/plugins/zsh-navigation-tools/n-history index af475dcb8..b425ecd10 100644 --- a/plugins/zsh-navigation-tools/n-history +++ b/plugins/zsh-navigation-tools/n-history @@ -307,7 +307,7 @@ while (( 1 )); do elif [ "$active_view" = "1" ]; then if [ -s "$private_history_db" ]; then local title=$'\x1b[00;32m'"Private history:"$'\x1b[00;00m\0' - () { fc -ap -R "$private_history_db"; list=( "$title" ${history[@]} ) } + () { fc -Rap "$private_history_db" 20000 0; list=( "$title" ${history[@]} ) } else list=( "Private history - history entries selected via this tool will be put here" ) fi @@ -335,21 +335,37 @@ done if [ "$REPLY" -gt 0 ]; then selected="$reply[REPLY]" + + # Append to private history + if [[ "$active_view" = "0" ]]; then + local newline=$'\n' + local selected_ph="${selected//$newline/\\$newline}" + print -r -- "$selected_ph" >> "$private_history_db" + fi + + # TMUX? + if [[ "$ZNT_TMUX_MODE" = "1" ]]; then + tmux send -t "$ZNT_TMUX_ORIGIN_SESSION:$ZNT_TMUX_ORIGIN_WINDOW.$ZNT_TMUX_ORIGIN_PANE" "$selected" + tmux kill-window + return 0 # ZLE? - if [ "${(t)CURSOR}" = "integer-local-special" ]; then + elif [ "${(t)CURSOR}" = "integer-local-special" ]; then zle .redisplay zle .kill-buffer LBUFFER+="$selected" - - # Append to private history - local newline=$'\n' - selected="${selected//$newline/\\$newline}" - [ "$active_view" = "0" ] && print -r -- "$selected" >> "$private_history_db" else print -zr -- "$selected" fi else - [ "${(t)CURSOR}" = "integer-local-special" ] && zle redisplay + # TMUX? + if [[ "$ZNT_TMUX_MODE" = "1" ]]; then + tmux kill-window + # ZLE? + elif [[ "${(t)CURSOR}" = "integer-local-special" ]]; then + zle redisplay + fi fi +return 0 + # vim: set filetype=zsh: |