d012402dada1ec7d8796f2f4b04744d817137b4d

Author
psprint <sgniazdowski@gmail.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

znt: update to v2.2.1 (#5174)

Diff

  1diff --git a/plugins/zsh-navigation-tools/.config/znt/n-kill.conf b/plugins/zsh-navigation-tools/.config/znt/n-kill.conf
  2index deb2a3fd998c28906a9625f6e19cde3d87427b94..59807b2c358a2585607dd14c12ed7be5ee3458d8 100644
  3--- a/plugins/zsh-navigation-tools/.config/znt/n-kill.conf
  4+++ b/plugins/zsh-navigation-tools/.config/znt/n-kill.conf
  5@@ -8,7 +8,7 @@ local active_text=reverse
  6 # This doesn't cover scripts named "[0-9]## *", which should be very rare
  7 # (#s) is ^, (#e) is $, # is *, ## is + (comparing to regex)
  8 # | is alternative, but only in ()
  9-local NLIST_COLORING_PATTERN="((#s) #[0-9]## |[[][^]]#](#e)|[^ 0-9/?\\\\][^/\\\\]#(#e)|[^ /\\\\]##[^0-9/\\\\ ]##[^/\\\\]#(#e))"
 10+local NLIST_COLORING_PATTERN="((#s) #[0-9]## |[[][^]]#](#e)|[^ 0-9/?\\\\][^/\\\\]#(#e))"
 11 local NLIST_COLORING_COLOR=$'\x1b[00;33m'
 12 local NLIST_COLORING_MATCH_MULTIPLE=1
 13 
 14diff --git a/plugins/zsh-navigation-tools/.config/znt/n-list.conf b/plugins/zsh-navigation-tools/.config/znt/n-list.conf
 15index 68f5668f9f8f950f47979a0865b7264f727d1108..096104df6c9ef46094d8ebeaddd25db58ba4028c 100644
 16--- a/plugins/zsh-navigation-tools/.config/znt/n-list.conf
 17+++ b/plugins/zsh-navigation-tools/.config/znt/n-list.conf
 18@@ -6,7 +6,7 @@ local bold=0
 19 local colorpair="white/black"
 20 
 21 # Should draw the border?
 22-local border=1
 23+local border=0
 24 
 25 # Combinations of colors to try out with Ctrl-T and Ctrl-G
 26 # The last number is the bold option, 0 or 1
 27diff --git a/plugins/zsh-navigation-tools/n-help b/plugins/zsh-navigation-tools/n-help
 28index 415050a81da68b8d08adb49a6195723a3357bcf8..c7f6328b771bb12f9f55d0cef75e9d71da350a51 100644
 29--- a/plugins/zsh-navigation-tools/n-help
 30+++ b/plugins/zsh-navigation-tools/n-help
 31@@ -1,11 +1,11 @@
 32 autoload colors
 33 colors
 34 
 35-local h1="$fg_bold[cyan]"
 36+local h1="$fg_bold[magenta]"
 37 local h2="$fg_bold[green]"
 38 local h3="$fg_bold[blue]"
 39 local h4="$fg_bold[yellow]"
 40-local h5="$fg_bold[magenta]"
 41+local h5="$fg_bold[cyan]"
 42 local rst="$reset_color"
 43 
 44 LESS="-iRc" less <<<"
 45@@ -93,4 +93,43 @@ start. This is a way to have handy set of bookmarks prepared in private
 46 history's file.
 47 
 48 Private history is instantly shared among sessions.
 49+
 50+${h1}Zshrc integration${rst}
 51+
 52+There are 5 standard configuration variables that can be set in zshrc:
 53+
 54+${h4}znt_history_active_text${rst}
 55+\"underline\" or \"reverse\" - how should be active element highlighted
 56+${h4}znt_history_nlist_coloring_pattern${rst}
 57+Pattern that can be used to colorize elements
 58+${h4}znt_history_nlist_coloring_color${rst}
 59+Color with which to colorize via the pattern
 60+${h4}znt_history_nlist_coloring_match_multiple${rst}
 61+Should multiple matches be colorized (${h2}\"0\"${rst} or ${h2}\"1\"${rst})
 62+${h4}znt_history_keywords ${h2}(array)${rst}
 63+Search keywords activated with Ctrl-X, F2, Ctrl-/, e.g. ( ${h2}\"git\"${rst} ${h2}\"vim\"${rst} )
 64+
 65+Above variables will work for n-history tool. For other tools, change
 66+\"_history_\" to e.g. \"_cd_\", for the n-cd tool. The same works for
 67+all 8 tools.
 68+
 69+Common configuration of the tools uses variables with \"_list_\" in them:
 70+
 71+${h4}znt_list_bold${rst}
 72+Should draw text in bold (${h2}\"0\"${rst} or ${h2}\"1\"${rst})
 73+${h4}znt_list_colorpair${rst}
 74+Main pair of colors to be used, e.g ${h2}\"green/black\"${rst}
 75+${h4}znt_list_border${rst}
 76+Should draw borders around windows (${h2}\"0\"${rst} or ${h2}\"1\"${rst})
 77+${h4}znt_list_themes ${h2}(array)${rst}
 78+List of themes to try out with Ctrl-T, e.g. ( ${h2}\"white/black/1\"${rst}
 79+${h2}\"green/black/0\"${rst} )
 80+${h4}znt_list_instant_select${rst}
 81+Should pressing enter in search mode leave tool (${h2}\"0\"${rst} or ${h2}\"1\"${rst})
 82+
 83+If you used ZNT before v2.1.12 then remove old configuration files
 84+${h3}~/.config/znt/*.conf${rst} so that ZNT can update them to the latest versions
 85+that support integration with Zshrc. If you used installer then run it
 86+again (after the remove of configuration files), that is not needed when
 87+using as plugin.
 88 "
 89diff --git a/plugins/zsh-navigation-tools/n-history b/plugins/zsh-navigation-tools/n-history
 90index 68370f6e5381a9b3383357b6665c7dbf1e736e00..af475dcb891d20f50b29aa5e2f971a39e7449005 100644
 91--- a/plugins/zsh-navigation-tools/n-history
 92+++ b/plugins/zsh-navigation-tools/n-history
 93@@ -157,7 +157,7 @@ _nhistory_generate_most_frequent() {
 94         vk+="$v"$'\t'"$k"
 95     done
 96 
 97-    print -rl "$title" "${(On)vk[@]}" > "$most_frequent_db"
 98+    print -rl -- "$title" "${(On)vk[@]}" > "$most_frequent_db"
 99 }
100 
101 # Load configuration
102@@ -337,16 +337,16 @@ if [ "$REPLY" -gt 0 ]; then
103     selected="$reply[REPLY]"
104     # ZLE?
105     if [ "${(t)CURSOR}" = "integer-local-special" ]; then
106-        zle redisplay
107-        zle kill-buffer
108+        zle .redisplay
109+        zle .kill-buffer
110         LBUFFER+="$selected"
111 
112         # Append to private history
113         local newline=$'\n'
114         selected="${selected//$newline/\\$newline}"
115-        [ "$active_view" = "0" ] && print -r "$selected" >> "$private_history_db"
116+        [ "$active_view" = "0" ] && print -r -- "$selected" >> "$private_history_db"
117     else
118-        print -zr "$selected"
119+        print -zr -- "$selected"
120     fi
121 else
122     [ "${(t)CURSOR}" = "integer-local-special" ] && zle redisplay
123diff --git a/plugins/zsh-navigation-tools/n-list b/plugins/zsh-navigation-tools/n-list
124index d3a8da302ee40dedf1e77edb6a0183038a4a59aa..f3d2e5b3efc9fad1ca7e7c4a63c822dbc111773c 100644
125--- a/plugins/zsh-navigation-tools/n-list
126+++ b/plugins/zsh-navigation-tools/n-list
127@@ -445,7 +445,10 @@ while (( 1 )); do
128 
129     [ "$border" = "1" ] && zcurses border main
130 
131-    local top_msg=" F1-change view, ${(C)ZSH_NAME} $ZSH_VERSION, shell level $SHLVL "
132+    local top_msg=" ${(C)ZSH_NAME} $ZSH_VERSION, shell level $SHLVL "
133+    if [[ "${NLIST_ENABLED_EVENTS[(r)F1]}" = "F1" ]]; then
134+        top_msg=" F1-change view,$top_msg"
135+    fi
136     zcurses move main 0 $(( term_width / 2 - $#top_msg / 2 ))
137     zcurses string main $top_msg
138