mokkabonna / inquirer-autocomplete-prompt

Autocomplete prompt for inquirer
ISC License
350 stars 82 forks source link

please add prefix and suffix in base.js file. #58

Closed kul2789 closed 3 years ago

kul2789 commented 6 years ago

Hello mokkabonna i am using this module and found an issue. Prefix and suffix is missing from base.js file. i am using inquirer which is supporting prefix and suffix and was presuming that this module is using inquirer as it is as dependency but i was wrong i have gone through the files and manually added prefix and suffix in my local node_module.

this.opt = _.defaults(_.clone(question), {
    validate: function () {
      return true;
    },
    filter: function (val) {
      return val;
    },
    when: function () {
      return true;
    },
    suffix: '',
    prefix: chalk.green('?')
 });
Prompt.prototype.getQuestion = function () {
  var message = this.opt.prefix + ' ' + chalk.bold(this.opt.message)  + this.opt.suffix + chalk.reset(' ');
.......
}
mokkabonna commented 3 years ago

I have testet now that prefix and suffix work as intended with inquirer 8. Updated docs.