Skip to content

Commit edcde73

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents c34e85d + ac2d15d commit edcde73

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/components/CodeMirror.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ const opt: hoverOptions = {
6565
break
6666
case "sd":
6767
label = l.args[0].toString()
68-
deviceId = label
68+
deviceId = env.getAlias(label, true)
6969
prop = l.args[1].toString()
7070
break
7171
case "ld":
7272
label = l.args[1].toString()
73-
deviceId = label
73+
deviceId = env.getAlias(label, true)
7474
prop = l.args[2].toString()
7575
break
7676
}
7777
if (deviceId && prop) {
78-
new_text = `${label}[${prop}] = ` + env.getDeviceProp(deviceId, prop)
78+
new_text = `${label}[${prop}] = ` + env.getDeviceProp(deviceId.toString(), prop)
7979
}
8080
}
8181
}

src/core/Env.ts

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ class Env extends DevEnv<{ update: () => void; update_code: () => void }> {
4747
this.preAlias.set(l?.args[0]?.toString(), l?.args[1])
4848
}
4949
})
50+
this.lines
51+
.filter((l) => l?.fn === "define")
52+
.forEach((l) => {
53+
if (l?.args[0] && l?.args[1]) {
54+
this.preAlias.set(l?.args[0]?.toString(), Number(l?.args[1]))
55+
}
56+
})
5057
this.emit("update")
5158
}
5259

0 commit comments

Comments
 (0)