This commit is contained in:
2023-11-27 11:32:55 +03:00
parent e164248d9c
commit 3a85bf532d
4 changed files with 68 additions and 24 deletions

View File

@@ -47,20 +47,16 @@ const createDecorations = (view: EditorView) => {
const size = result.size()
switch (size.length) {
case 1:
decoration = Decoration.widget({
widget: new MathResult(result.toString()),
side: 1,
})
break
case 2:
decoration = Decoration.widget({
widget: new Matrix(result),
side: 1,
})
break
if (size.length === 2) {
decoration = Decoration.widget({
widget: new Matrix(result),
side: 1,
})
} else {
decoration = Decoration.widget({
widget: new MathResult(result.toString()),
side: 1,
})
}
}