~emersion/gamja

08aefc9dc5becd3b25a70045c1377a6706035a6e — Simon Ser 4 months ago 856dd02
composer: add smart suffix after auto-completion

Append a space after a command name, so that arguments can be typed
directly. Append a colon after a nickname.
1 files changed, 8 insertions(+), 0 deletions(-)

M components/composer.js
M components/composer.js => components/composer.js +8 -0
@@ 69,6 69,14 @@ export default class Composer extends Component {
			return;
		}

		if (wordStart === 0 && wordEnd === text.length) {
			if (word.startsWith("/")) {
				repl += " ";
			} else {
				repl += ": ";
			}
		}

		text = text.slice(0, wordStart) + repl + text.slice(wordEnd);

		input.value = text;