fixed wide carets moved too far left

This commit is contained in:
Miodec 2022-04-26 15:08:25 +02:00
parent 374251bc39
commit 5cbc7c6646

View file

@ -36,10 +36,14 @@ export async function updatePosition(): Promise<void> {
// }
const caret = $("#caret");
const caretWidth = Math.round(
let caretWidth = Math.round(
document.querySelector("#caret")?.getBoundingClientRect().width ?? 0
);
if (["block", "outline", "underline"].includes(Config.caretStyle)) {
caretWidth /= 3;
}
let inputLen = TestInput.input.current.length;
inputLen = Misc.trailingComposeChars.test(TestInput.input.current)
? TestInput.input.current.search(Misc.trailingComposeChars) + 1