forked from CringeStudios/gamja
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.
This commit is contained in:
parent
856dd021e2
commit
08aefc9dc5
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user