znt-history-widget 551 B

12345678910111213141516171819202122
  1. autoload znt-usetty-wrapper n-history
  2. local NLIST_START_IN_SEARCH_MODE=1
  3. local NLIST_START_IN_UNIQ_MODE=1
  4. # Only if current $BUFFER doesn't come from history
  5. if [ "$HISTCMD" = "$HISTNO" ]; then
  6. () {
  7. setopt localoptions extendedglob
  8. local -a match mbegin mend
  9. local MATCH; integer MBEGIN MEND
  10. [ -n "$BUFFER" ] && BUFFER="${BUFFER%% ##} "
  11. }
  12. local NLIST_SET_SEARCH_TO="$BUFFER"
  13. fi
  14. znt-usetty-wrapper n-history "$@"
  15. unset NLIST_START_IN_SEARCH_MODE
  16. unset NLIST_START_IN_UNIQ_MODE
  17. unset NLIST_SET_SEARCH_TO