tab completion
This commit is contained in:
parent
14534997e8
commit
a6029cdb0d
@ -21,7 +21,8 @@
|
|||||||
@click="fillCmd(msg.cmd)">{{msg.cmd}} <i class="std-text" style="font-size:8pt;">{{msg.help}}</i></p>
|
@click="fillCmd(msg.cmd)">{{msg.cmd}} <i class="std-text" style="font-size:8pt;">{{msg.help}}</i></p>
|
||||||
</div>
|
</div>
|
||||||
<form @submit="sendChatMessage" id="msg-form">
|
<form @submit="sendChatMessage" id="msg-form">
|
||||||
<input id="my-msg" autocomplete="off" v-model="text" style="flex-grow:2;"/>
|
<input id="my-msg" autocomplete="off" v-model="text" style="flex-grow:2;"
|
||||||
|
@keydown.tab.prevent="tabComplete($event.target.value)"/>
|
||||||
<input id="submit-message" type="submit" class="btn" :value="$t('submit')"/>
|
<input id="submit-message" type="submit" class="btn" :value="$t('submit')"/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@ -164,6 +165,12 @@ export default {
|
|||||||
this.text = cmd;
|
this.text = cmd;
|
||||||
document.getElementById('my-msg').focus();
|
document.getElementById('my-msg').focus();
|
||||||
},
|
},
|
||||||
|
tabComplete() {
|
||||||
|
if (this.commandSuggestion.length > 0) {
|
||||||
|
let cmd = this.commandSuggestion[0].cmd;
|
||||||
|
this.text = cmd + ' ';
|
||||||
|
}
|
||||||
|
},
|
||||||
playEffects(path) {
|
playEffects(path) {
|
||||||
const promise = (new Audio(path)).play();
|
const promise = (new Audio(path)).play();
|
||||||
if(promise !== undefined){
|
if(promise !== undefined){
|
||||||
|
Loading…
Reference in New Issue
Block a user