Jump to content

C mode file

Posted by SpiceWare, in jEdit, SpiceC 06 March 2018 · 862 views

While working on SpiceC I discovered GCC supports 0b notation for binary values.  I don't know when this occurred, but am quite pleased to see it!  Before this change you could only use numbers represented in decimal, hexadecimal, and octal.  At my job we use Visual Studio 2005 and 2012 for the supported and current versions of our software (V13 was developed with 2005, V14 and V15 with 2012).  Neither of those versions of Visual Studio support it.  We've started work on V16 and are currently in the process of figuring out issues(!@#$%^$#) with Visual Studio 2017 not liking our custom User Controls.  I just tested VS2017 and it does support binary!
Because of this I decided to clone jEdit's mode file (syntax highlighting rules) for C and added the binary colorization rule so graphic images within binary numbers become clearer to see:
Attached Image
See this blog entry for how to add the new mode file.  The assembly entry for the catalog file is:

<MODE NAME="C colorized binary"         FILE="c.xml"
Mode file:
Attached File  c.xml.zip (3.2KB)
downloads: 37
Catalog file, for reference:
Attached File  catalog.zip (496bytes)
downloads: 33
Addendum: I was running jEdit 5.3.0. It did not support HiDPI on the Mac:
Attached Image
Just realized 5.4.0 was released a year ago(!) and noticed this in the change log:

- Use new version of JarBundler that also sets LSApplicationCategoryType and
NSHighResolutionCapable. (Björn "Vampire" Kautler)

I wondered if that meant it now supported HiDPI, so installed the update. It does!
Attached Image
Note the difference in the text quality and window buttons at the top-left.  The toolbar icons are still low-def though.  

That's awesome! I wish I could get bbedit to do the same.
  • Report

Thanks!  I figured it out about 4 years ago.  


While I've heard of bbedit, I've never used it. I checked their site and see they do have a way to create syntax highlighting rules, so it might be possible. On this page I see:



Anyone who encounters a problem with our software (or isn’t sure if it’s working correctly), or who would like to request a feature or enhancement, should contact tech support directly for assistance.


so maybe contact them and include link(s) to my screenshots of jEdit in action.

  • Report

It honestly never occurred to me to ask the developers to add the feature.  Since I paid for it, it wouldn't hurt to try, at least.  :)


I may give jEdit a try, despite my resistance to change.  Is it possible to open a file with a terminal command, opening it a running instance of the editor?  That may be what I like best about BBEdit.

  • Report

Should be.  I just made a quick attempt, it launched jEdit but ignored any parameters and filenames.  Might have to run jEdit as a parameter to java or something.

  • Report

Realized I was running the prior version of jEdit, so installed the update. Didn't help with the terminal, it still ignores any parameters and filenames, but it did make the text look significantly better on my 4K monitor! See screenshots added to blog entry.

  • Report

Glad to see you have the jEdit update working.

I had to jump through installing java higher than 1.6 which is what the Macs are determined to stay at.

I followed online guides and finally installed the newer java. The 1.6 is still there too. 

I finally got it to show:  $ java -version

java version "1.8.0_144"

  • Report

jEdit 5.4.0 looks more like a standalone application.


The older version had either the top menu bar different or the application's toolbar different.


I've never mentioned it, but I know nothing about programming in C.

  • Report

Hmm, I don't recall when I updated Java though I did switch from Apple's included version to Oracle's separate install soon after Apple stopped supporting it.


The top menu bar's tied to Utilities->Global Options->jEdit->Appearance->Swing look & feel.  Set that to Mac OS X and the menu's at the top like a normal Mac program.  Any other choice and the menu is attached to the window.  If you look at the older jEdit screenshots I've posted you'll see I figured that out between 2006 and 2012.


I'm sure you'll be able to pick it up - as I pointed out to RT the basic concepts are the same, just the formatting is different.

  • Report

Search My Blog

Recent Comments

Latest Visitors

0 user(s) viewing

0 members, 0 guests, 0 anonymous users