mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
switch textarea to monospace when value starts with slash
This commit is contained in:
@ -2162,4 +2162,13 @@ export function setSlashCommandAutoComplete(textarea, isFloating = false) {
|
|||||||
}
|
}
|
||||||
window.addEventListener('resize', debounce(updatePosition, 100));
|
window.addEventListener('resize', debounce(updatePosition, 100));
|
||||||
}
|
}
|
||||||
setSlashCommandAutoComplete(document.querySelector('#send_textarea'));
|
/**@type {HTMLTextAreaElement} */
|
||||||
|
const sendTextarea = document.querySelector('#send_textarea');
|
||||||
|
setSlashCommandAutoComplete(sendTextarea);
|
||||||
|
sendTextarea.addEventListener('input', () => {
|
||||||
|
if (sendTextarea.value[0] == '/') {
|
||||||
|
sendTextarea.style.fontFamily = 'monospace';
|
||||||
|
} else {
|
||||||
|
sendTextarea.style.fontFamily = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user