Revert to setFormat() to fix color setting

The surrounder code is somewhat complicated, and it could do with either
more documentation, or a simplification.

Closes #2121
This commit is contained in:
Damien Elmes 2022-12-05 16:56:14 +10:00
parent 6ef460e74a
commit 613b5c1034

View File

@ -8,6 +8,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { getPlatformString } from "@tslib/shortcuts";
import { removeStyleProperties } from "@tslib/styling";
import { singleCallback } from "@tslib/typing";
import { setFormat } from "editor/old-editor-adapter";
import { onMount } from "svelte";
import IconButton from "../../components/IconButton.svelte";
@ -109,7 +110,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
removeFormats.update((formats) => [...formats, namedFormat]);
function setTextColor(): void {
surrounder.overwriteSurround(key);
setFormat("foreColor", transformedColor);
}
const setCombination = "F7";