mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-25 20:40:36 +03:00
M: Improve double boolean editing
This commit is contained in:
parent
46f3099b01
commit
a2f300cf84
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user