powercord-org / powercord

A lightweight @discord client mod focused on simplicity and performance.
MIT License
1.2k stars 147 forks source link

Autocomplete instruction causes something to be inserted into text box #652

Closed asportnoy closed 1 year ago

asportnoy commented 2 years ago

Describe the bug Pressing enter on a command autocomplete instruction causes the existing arguments to be repeated in the textbox.

To Reproduce

  1. Type .tag add and type some value for the name argument
  2. Press enter. Observe that the rest of the command is repeated in the text box.

This can also be reproduced on any other command argument with instruction: true.

https://user-images.githubusercontent.com/14863373/172182005-ce5bd1b6-f071-4150-8dbb-41947545b0b7.mp4

Expected behavior Pressing enter makes it move to the next argument or send the message, depending on whether or not there are more arguments. Looking at the code, it seems like this is what was intended. https://github.com/powercord-org/powercord/blob/f7504cf4c56a19dca38273929abb113cc1bf45d0/src/Powercord/plugins/pc-commands/injectAutocomplete.js#L80-L82

Desktop (please complete the following information):

Additional context