GNOME Bugzilla – Bug 692822
SPICE syntax highlighting
Last modified: 2021-07-05 11:02:40 UTC
Created attachment 234769 [details] .lang file with syntax highlighting for SPICE Hello (In case it doesn't show, I'm new to this) Searching for SPICE-like syntax highlighting across the 'net I either found none or, those that were, I didn't like, so I made mine. I wrote to the gedit-list and it was suggested I add it here. It's nothing fancy (not what I originally had in mind) but it works just fine and there may be changes from time to time. It's probably something very childish (code-wise) but bear in mind that until some week earlier I had no idea what PCRE means or does. I also made a color scheme to match LTspice's (which served as a reference), which is nothing else than gedit's own kate.xml modified here and there. Now, in the mail it was said to properly format it, I did that comparing it with def.lang, but if anything is wrong just say it and I'll modify it accordingly. I may not answer the next day, but I will. Regards, Vlad
Created attachment 234770 [details] color scheme to match spice.lang It's kate.xml slightly modified, so I don't know how much this one counts.
(While scrolling with the touchpad I clicked "Commit", if something bad happens because of it, you have the cause here, sorry for that)
I have only glanced at the spice lang file but it seems mostly ok. However it is not clear to me why do you need to modify the color scheme file...
(In reply to comment #3) > I have only glanced at the spice lang file but it seems mostly ok. > > However it is not clear to me why do you need to modify the color scheme > file... There's no dependancy of any sort, to each his own. It's simply a personal colour preference (i.e. dark green for comments instead of grey) to make it closer to LTspice's. Better still, I'll attach a test netlist. This way, the way gedit displays it can be compared with LTspice's colour scheme. Ignore the blatant errors, they're on purpose. The program is freeware, closed-source and can be freely downloaded from here: http://ltspice.linear.com/software/LTspiceIV.exe .
Created attachment 235073 [details] test schematic to test the syntax highlighting and colour scheme Just ignore any erroros, they're on purpose, it's just a test schematic.
Created attachment 248793 [details] A newer version. Corrected some .func detection and made it more "by the book" (LTspice-wise). It's probably just a bit faster now.
Created attachment 274937 [details] A newer version - values are highlighted without the "=" sign - corrected the highlighting for "table()" - added *.mod to the list of recognizable extensions (model list)
Created attachment 274938 [details] Corrected colours for gEdit - corrected the colour display for gEdit when "Display right margin at column ..." and "Display line numbers" options are checked
Are there other requirements for this? If yes, could you please enumerate them or link me to a place where I can read them? I have searched a bit and seen another request like mine and it said there to file for a MIME entry in freedesktop.org.xml. I actually headed there to do it but their methods imply specifying a header for *.net, .cir, *.sp (or *.sub, *.lib, *.mod), which I cannot because they are simply ASCII files, nothing more, they can have any character in them. What's more, there is no particular program that opens them up, for example installing LTspice will let it recognize the extensions, installing ngspice will not. PSpice has its own formats but accepts default netlists while Berkeley SPICE does not mingle with extensions, it simply opens them up if they are passed to the program. So, this syntax highlighting is meant to be used by those users of GtkSourceView family who edit their netlists or libraries (the aforementioned extensions) with gEdit (or Mousepad, Scribes, whatever other editor supports GtkSourceView). They are not special extensions but the syntax highlighting can be used to recognize them and... highlight them. They're just like a *.c file, there's no default C programming software that needs these specific extensions, they are simply ASCII (Unicode, whatever) files that hold lines of characters with C-syntax. That's all.
Created attachment 374186 [details] some updates I have to wonder, is this still alive?
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gtksourceview/-/issues/ Thank you for your understanding and your help.