zsh-users / zaw

zsh anything.el-like widget.
BSD 3-Clause "New" or "Revised" License
572 stars 67 forks source link

Action not executed #103

Open noscript opened 3 years ago

noscript commented 3 years ago

In my source I have only one action. But having only one element in actions and act_descriptions arrays does not execute the action for me when candidate selected. To work around this I had to duplicate the elements. Maybe I misunderstand something?

function zaw-src-mywidget() {
  candidates=('HELLO' 'WORLD')
  actions=(zaw-src-mycall zaw-src-mycall) # <-- dublicates
  act_descriptions=("description" "description") # <-- dublicates
}
function zaw-src-mycall() {
  LBUFFER="choice was $1"
}
zaw-register-src -n mywidget zaw-src-mywidget