From a2f300cf84ce023aa7a10345ea7919411835901e Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Tue, 10 Jun 2025 21:20:47 +0300 Subject: [PATCH] M: Improve double boolean editing --- .../features/rsform/components/rs-input/text-editing.ts | 9 +++++++++ 1 file changed, 9 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..9667e3f5 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,15 @@ 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); + if (enclosingText === 'ℬ()') { + this.ref.view.dispatch({ + changes: [{ from: selection.from - 2, insert: 'ℬ' }] + }); + return true; + } + } if (hasSelection && this.startsWithBoolean(selection)) { this.envelopeWith('ℬ', ''); } else {