SUMMARY G-Code files for 3D printers that use commands not starting with letter G highlighted not highlight them as commands. There is no any formal distinction between kinds of commands highlighted. E.g. G0, G1, G2, G3 used for travel moves but commands like G90, G92 are control commands (used to set some state in firmware). Control commands can also start with letter M, like M106, M190, etc. Yet all commands starting with G are highlighted as commands (black) and commands starting with M highlighted with orange in default color scheme. There are also commands starting with D, commonly used in Prusa printers which also rendered as fields rather than commands. STEPS TO REPRODUCE 1. Open G-Code file 2. Check if syntax set to G-Code OBSERVED RESULT So-called RepRap-commands starting with M highlighted as fields rather than commands. EXPECTED RESULT Highlight commands starting with M as commands. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 5.25.4 KDE Frameworks Version: 5.96.0 Qt Version: 5.15.5 Graphics Platform: Wayland ADDITIONAL CONTEXT Common G-Code commands: https://reprap.org/wiki/G-code
Created attachment 151245 [details] sample file
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/syntax-highlighting/-/merge_requests/342
Git commit 29d174f194728ad934297d0c0a0fa6f4e251332a by Christoph Cullmann, on behalf of jonathan poelen. Committed on 21/08/2022 at 16:32. Pushed by cullmann into branch 'master'. G-Code: fix number pattern, Mnnn as M-word or M-word (user), add String and... G-Code: fix number pattern, Mnnn as M-word or M-word (user), add String and RepRapFirmware expression Before: ``` G 1 3 0 ^ G-word ^ Number M100 ^ M-word (user) M1001 ^ M-word (user) ^ Number M200 ^ M-word ^ Number ``` Now: ``` G 1 3 0 ^ G-word M100 ^ M-word (user) M1001 ^ M-word M200 ^ M-word ``` M +43 -0 autotests/folding/highlight.ngc.fold M +43 -0 autotests/html/highlight.ngc.dark.html M +43 -0 autotests/html/highlight.ngc.html M +43 -0 autotests/input/highlight.ngc M +43 -0 autotests/reference/highlight.ngc.ref M +126 -72 data/syntax/gcode.xml https://invent.kde.org/frameworks/syntax-highlighting/commit/29d174f194728ad934297d0c0a0fa6f4e251332a