Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Fix #165.
Browse files Browse the repository at this point in the history
TextMate grammer cannot move across multiple lines. Use the suggestion
workaround mentioned in this issue:
microsoft/vscode-textmate#41
  • Loading branch information
seanwu1105 committed Dec 17, 2021
1 parent 4356a68 commit 0a865bf
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 4 deletions.
51 changes: 51 additions & 0 deletions src/test/assets/qml/new-line-js-block.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
UserButton {
id: plotButton
x: typeColumnLayout.x + 20
y: typeColumnLayout.y + typeColumnLayout.height + 20
font.pixelSize: topItem.pixelSize + 1
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
text: checked? qsTr("停止") : qsTr("绘图")
property bool waiting: false
onClicked :
{
if(!waiting)
{
waiting = true
if(checked)
{

for(let [key, value] of ObjCreation.objs)
{
log.write(Verbose.Debug, `Charts Object: ${key}`)
}
}
else
{
log.write(Verbose.Debug, "try close plot thread.")
checked = true
plot.stop()
}
}
}

onCreated : {
if(!waiting)
{
waiting = true
if(checked)
{

for(let [key, value] of ObjCreation.objs)
{
log.write(Verbose.Debug, `Charts Object: ${key}`)
}
}
else
{
log.write(Verbose.Debug, "try close plot thread.")
checked = true
plot.stop()
}
}
}
}
14 changes: 10 additions & 4 deletions syntaxes/qml.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,18 @@
},
{
"description": "A block of JavaScript code as value.",
"begin": "(?<=\\w)\\s*\\:\\s*\\{",
"end": "\\}",
"contentName": "meta.embedded.block.js",
"begin": "(?<=\\w)\\s*\\:(?=\\s*\\{?\\s*$)",
"end": "(?<=\\})",
"patterns": [
{
"include": "source.js"
"begin": "\\{",
"end": "\\}",
"contentName": "meta.embedded.block.js",
"patterns": [
{
"include": "source.js"
}
]
}
]
},
Expand Down

0 comments on commit 0a865bf

Please sign in to comment.