Use editor defined in $EDITOR
It seems that pamac has "nano" hardcoded as editor used for editing build files (and possibly other things). I believe better alternative is to use whatever is set in $EDITOR and only default to "nano" if $EDITOR is not set.