From fbfb8b419fc972538fbe7527441c88aa3fbb2761 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 2 Apr 2024 16:05:31 +0200 Subject: [PATCH] Reformat --- service.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/service.js b/service.js index 8d84219..c19bf1e 100644 --- a/service.js +++ b/service.js @@ -579,8 +579,11 @@ class BesService { if (this.textAreaService) { let text = this.textAreaService.textAreaEl.value this.textAreaService.textAreaEl.value = - text.substring(0, match.match.offset) + replacement + text.substring(match.match.offset + match.match.length) - this.textAreaService.textAreaEl.selectionStart = this.textAreaService.textAreaEl.selectionEnd = match.match.offset + text.substring(0, match.match.offset) + + replacement + + text.substring(match.match.offset + match.match.length) + this.textAreaService.textAreaEl.selectionStart = + this.textAreaService.textAreaEl.selectionEnd = match.match.offset } this.clearMistakeMarkup(el) // In my opinion, this approach provides the most straightforward solution for repositioning mistakes after a change.