do not flash when empty

This commit is contained in:
Felix Roos 2023-06-30 22:38:14 +02:00
parent 13545d147b
commit dc2ff83fa5

View File

@ -103,7 +103,7 @@ const flashField = StateField.define({
try {
for (let e of tr.effects) {
if (e.is(setFlash)) {
if (e.value) {
if (e.value && tr.newDoc.length > 0) {
const mark = Decoration.mark({ attributes: { style: `background-color: #FFCA2880` } });
flash = Decoration.set([mark.range(0, tr.newDoc.length)]);
} else {