chat-js: revive # prefix for code messages

This commit is contained in:
Liam Fitzgerald 2020-04-17 22:35:12 +10:00
parent 535cace962
commit 4d118ce6c4
2 changed files with 10 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

View File

@ -397,6 +397,13 @@ export class ChatInput extends Component {
this.editor.setOption('mode', null);
this.editor.setOption('placeholder', "Code...");
}
const value = this.editor.getValue();
// Force redraw of placeholder
if(value.length === 0) {
this.editor.setValue(' ');
this.editor.setValue('');
}
}
@ -445,7 +452,9 @@ export class ChatInput extends Component {
'Enter': (cm) =>
completeActive
? this.completePatp(state.selectedSuggestion)
: this.messageSubmit()
: this.messageSubmit(),
'Shift-3': (cm) =>
this.toggleCode()
}
};