mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-04-12 10:01:08 +02:00
don't cancel syntax highlight update if previously disabled
This commit is contained in:
parent
2b653ac8a1
commit
2ac2a2537d
@ -908,6 +908,7 @@ export class QuickReply {
|
|||||||
let lastSyntaxUpdate = 0;
|
let lastSyntaxUpdate = 0;
|
||||||
const fpsTime = 1000 / 30;
|
const fpsTime = 1000 / 30;
|
||||||
let lastMessageValue = null;
|
let lastMessageValue = null;
|
||||||
|
let wasSyntax = null;
|
||||||
const updateSyntaxLoop = ()=>{
|
const updateSyntaxLoop = ()=>{
|
||||||
const now = Date.now();
|
const now = Date.now();
|
||||||
// fps limit
|
// fps limit
|
||||||
@ -917,7 +918,8 @@ export class QuickReply {
|
|||||||
// elements no longer part of the document
|
// elements no longer part of the document
|
||||||
if (!messageSyntaxInner.closest('body')) return;
|
if (!messageSyntaxInner.closest('body')) return;
|
||||||
// value hasn't changed
|
// value hasn't changed
|
||||||
if (lastMessageValue == message.value) return requestAnimationFrame(upsyn);
|
if (wasSyntax == syntax.checked && lastMessageValue == message.value) return requestAnimationFrame(updateSyntaxLoop);
|
||||||
|
wasSyntax = syntax.checked;
|
||||||
lastSyntaxUpdate = now;
|
lastSyntaxUpdate = now;
|
||||||
lastMessageValue = message.value;
|
lastMessageValue = message.value;
|
||||||
updateSyntax();
|
updateSyntax();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user