[ZeroBrane Studio] Re: couple of questions

  • From: Paul K <paul@xxxxxxxxxxxxx>
  • To: zerobrane@xxxxxxxxxxxxx
  • Date: Tue, 5 Nov 2013 17:07:42 -0800

Hi Geoff,

> I was a bit shocked to discover you had removed the standard Lua 5.1 
> Interpreter :(

It has been replaced by LuaJIT, which is fully ABI compatible with Lua
5.1 while also providing some level of language compatibility with Lua
5.2. May I ask what you are missing in the current setup?

> Could you point me at some instructions as to how I add that back in please ?

You have several options. One would be to get the old
library/executable and use it instead of the current one. You can get
all the binaries from one of the older versions of ZBS
(https://github.com/pkulchenko/ZeroBraneStudio/tree/115924d56797f9d1f3a43df453a1cef8e9a1a581/bin).
You can also install Lua interpreter to some other folder and
configure ZBS to use it with path.lua setting
(http://studio.zerobrane.com/doc-general-preferences.html#interpreter_path)

My assumption was that users are not losing anything with this switch,
but maybe I missed something.

> A second more wacky question for you. How easy or difficult would it be to 
> modify ZBS so that its syntax colour highlighting was for a different 
> language other than Lua ? I am guessing this might be hidden away inside the 
> Scintilla edit component you are using, so therefore would be very awkward to 
> change ?

Yes, it should be possible to get access to other lexers inside
Scintilla. It should be a matter of connecting spec identifiers that
ZBS recognizes with those defined in Scintilla lexers. I recently did
something similar for c/cpp that you may use as a starting point
(spec/cpp.lua).

If you open .cpp file you should see that highlighting if you enable
loading of spec files by adding this to the config file:
load.specs(function(file) return file:find('spec[/\\]cpp%.lua$') end).
I should probably change this to allow new specs to be loaded by
default.

You should still be able to use all the color themes and everything
else color related.

If you want to distribute this, you can wrap this into a plugin that
uses ide:AddSpec and ide:RemoveSpec calls. This may be easier option
as it eliminates the need to modify the config file and to provide
multiple files. Let me know if you need an example on how this can be
done.

Paul.

Other related posts: