I’m wondering if there is a way to use the code coloring that exits for action code in the Text pane of a note.
Currently, when I try to write code in the Text pane of a code note, the text format is simply that of the default $Text. By the term “code note,” I’m referring to a note that contains code that I’d like to run in a bunch of other notes. One failed attempt to address this color coding goal was to use the built in code prototype, but that does not affect $Text format.
I’ve thought of a couple of workarounds,
Write code in the rule or edict sections of a code note instead of in the text pane, and disable the rule from running in the code note. I haven’t tested this, but I expect that I could set a rule in some other note that runs the rule in the code note.
Write code in the rule or edict sections of a code note, then cut and paste the code into the Text pane. This preserves the color coding, though it’s not exactly an elegant solution.
Use a separate text editor. This may work in many cases, but at least with Visual Studio Code and Tinderbox in dark mode, this does not work well. The dark color of the text background from Visual Studio Code gets copied into TinderBox, where the background dark color doesn’t match. Yuck!
Of those three alternatives, #1 is most appealing to me, but it would be nice to be able to write code directly in a nice big Text Pane and have it pick up coding syntax colors. Is this possible?