Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: the function to show a digit argument while it is being typed



This seems to work:

function neg-argument-show () {
  emulate -R zsh
  if [[ $LASTWIDGET == neg-argument || $LASTWIDGET == digit-argument ]] ; then
    zle beep
    return
  fi
  zle -M "arg: -"
  zle -R
  zle .neg-argument
  if zle read-command ; then
    [[ $REPLY != digit-argument ]] && zle -M ""
  else
    zle send-break
  fi
  [[ -n $KEYS ]] && zle -U $KEYS
}

Any suggestions for improvements?

Greg



Messages sorted by: Reverse Date, Date, Thread, Author