From f0f41a4dcb4c16c5c1258e7fdb4f54b5943cf3fc Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Tue, 10 Jun 2025 21:20:22 +0300 Subject: [PATCH] M: Improve double boolean editing --- .../rsform/components/rs-input/text-editing.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/rsconcept/frontend/src/features/rsform/components/rs-input/text-editing.ts b/rsconcept/frontend/src/features/rsform/components/rs-input/text-editing.ts index 26d6ede1..d97cca6d 100644 --- a/rsconcept/frontend/src/features/rsform/components/rs-input/text-editing.ts +++ b/rsconcept/frontend/src/features/rsform/components/rs-input/text-editing.ts @@ -145,6 +145,16 @@ export class RSTextWrapper extends CodeMirrorWrapper { return true; } case TokenID.BOOLEAN: { + if (!hasSelection && selection.from >= 2) { + const enclosingText = this.ref.view.state.sliceDoc(selection.from - 2, selection.from + 1); + console.log(enclosingText); + if (enclosingText === 'ℬ()') { + this.ref.view.dispatch({ + changes: [{ from: selection.from - 2, insert: 'ℬ' }] + }); + return true; + } + } if (hasSelection && this.startsWithBoolean(selection)) { this.envelopeWith('ℬ', ''); } else {