mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
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
1 changed files with 8 additions and 0 deletions
|
@ -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…
Reference in a new issue