Page 1 of 1
Just started using Zerobrane
Posted: 14 Jan 2021 12:19
by shoshk
I've been using pspad to develop plugins for a number of years.
For a while I've wished for code folding and today I finally decided to do something about it. Since I see that some people are using Zerobrane, I decided to try it out and after fixing the syntax highlighting colors (the default scheme is too washed out for me), it looks like a nice improvement.
I'd be happy to hear tips or advice on using it with FH.
Thanks
Re: Just started using Zerobrane
Posted: 14 Jan 2021 14:42
by ColeValleyGirl
I find it invaluable for code folding -- like you I've changed the colour scheme.
I also run two copies at once so I can have two files open side by side on a big screen:
To run multiple instances of the IDE, you can start one instance as you normally do, and then start the second instance using this command: zbstudio -cfg "singleinstance=false". If you are on macOS, you may need to use open -n ZeroBraneStudio.app.
Re: Just started using Zerobrane
Posted: 14 Jan 2021 14:55
by shoshk
OK. Now can run 2 copies at once. I just added -cfg to the shortcut.
Now, if only we could debug from here.

Re: Just started using Zerobrane
Posted: 14 Jan 2021 15:13
by ColeValleyGirl
Yeah, and integrate it well with github...
Re: Just started using Zerobrane
Posted: 14 Jan 2021 15:58
by AdrianBruce
Sigh... I haven't
the faintest idea what you're talking about!
I used to do folding of punch cards? Anything like?

Re: Just started using Zerobrane
Posted: 14 Jan 2021 16:35
by shoshk
You folded your punch cards !?!
So, you were the one who kept clogging up the card reader!

Re: Just started using Zerobrane
Posted: 14 Jan 2021 16:39
by LornaCraig
Same here Adrian! (I remember punch cards, too. I never saw anyone fold them but I did once see someone drop a whole tray....)
Re: Just started using Zerobrane
Posted: 14 Jan 2021 16:44
by shoshk
My first job in the tech world was working at the remote computing center at University. We used to refill the paper supply for the line printers, tear-off and distribute student jobs, and, ah, unclog card reader jams. Good times!
Re: Just started using Zerobrane
Posted: 14 Jan 2021 16:46
by shoshk
We saw people dropping decks all the time. We were young and mean and found it quite funny.
Re: Just started using Zerobrane
Posted: 14 Jan 2021 16:51
by ColeValleyGirl
LornaCraig wrote: ↑14 Jan 2021 16:39
Same here Adrian! (I remember punch cards, too. I never saw anyone fold them but I did once see someone drop a whole tray....)
Part of my education at University included the art of crossing a very windy wet courtyard with a tray of punch cards and arriving unscathed at the card reader.... only to learn that the code was wrong and woud have to be redone the next day.
Re: Just started using Zerobrane
Posted: 14 Jan 2021 22:13
by AdrianBruce
The funniest thing that I ever saw with a card punch was when I walked up to the punch and pushed the front cover down over the output hopper to make the circuit that would let me punch. Now, it was possible to lift that lid at exactly the right point after the keys had been pressed but before the card had been punched and stop the process. Someone must have done that because when I pushed the front cover down, the waiting key punches whirred into action and out came a card reading:
Code: Select all
HELP I AM TRAPPED INSIDE A CARD PUNCH AND CANT GET OUT
Collapse of stout party as they say.

Re: Just started using Zerobrane
Posted: 15 Jan 2021 05:32
by shoshk
So, after a bit of reminiscing, back to Zerobrane...
I've been fiddling around with the settings - got rid of all those pesky underlines that (I found) made it difficult to read my code, tweaked the syntax coloring a bit more.
Next, I'm wondering if there's a way to control folding. Perhaps to only fold function definitions, for example.
Re: Just started using Zerobrane
Posted: 15 Jan 2021 08:20
by ColeValleyGirl
shoshk wrote: ↑15 Jan 2021 05:32
Next, I'm wondering if there's a way to control folding. Perhaps to only fold function definitions, for example.
Not that I've found and I couldnt spot anything quickly perusing their plugin repository. IDoing so did however remind me that I use the todo plugin (useful for dropping
and other gems of wisdom into the code and seeing all such items in a panel as a tod-do list.
Re: Just started using Zerobrane
Posted: 15 Jan 2021 08:23
by shoshk
Which TODO plugin do you use? I saw several.
Re: Just started using Zerobrane
Posted: 15 Jan 2021 08:27
by ColeValleyGirl
I use todo, and have tweaked the patterns to include TODO: (obvious) FIXME: (bugs) and ENHANCE: (possible additional functionality etc.)
Re: Just started using Zerobrane
Posted: 15 Jan 2021 11:35
by shoshk
I often put TODO in my code. This sounds like a nice feature to add.
Re: Just started using Zerobrane
Posted: 15 Jan 2021 14:02
by shoshk
Added TODO.
I decided to setup an API file. Actually, there will be 2 files - one for the api and the second which will add syntax highlighting for the fh functions.
I've got a very basic API file working. I set it up manually with 3 functions. But I'm going to use some automation.
I plan to create a csv file with the list of functions (and objects, etc) and then write a plugin which generates the api and keywords files.
I figure that I can add to the csv file at my leisure and regenerate the api and keywords files as needed.
I particularly like that I'll be able to run analyze and use it as intended.
Re: Just started using Zerobrane
Posted: 15 Jan 2021 14:25
by ColeValleyGirl
Ooh... I haven't been nearly organised enough/have been far too busy to look at doing an API file, or syntax for the fh functions...
Re: Just started using Zerobrane
Posted: 16 Jan 2021 16:32
by shoshk
I also have a lot to do; I'm working on a major rewrite of our source and data entry plugin to take advantage of new features available in FH7. Plus, after 5 years, there are a number of improvements that we've identified. It's probably among the most fun to be had as a programmer, designing a new system from the ground up.
But I believe that, with a small amount of effort, I can add a feature to Zerobrane which will greatly facilitate my work process.
I estimate that it should take about a half a day to set up the basic framework which will consist of several Excel files and a plugin.
The rest is data entry, which I will do as necessary. At this point, I plan on entering definitions for things that I use. I doubt that I will ever enter everything.
When I've got it going, I will share. I'm hoping to get it started and perhaps done on Monday.
Tomorrow I'm off to get my second vaccination shot.
Re: Just started using Zerobrane
Posted: 16 Jan 2021 16:48
by ColeValleyGirl
Thanks for offering to share -- I *may* be able to contribute some data entry but no promises.
Re: Just started using Zerobrane
Posted: 18 Jan 2021 12:43
by shoshk
I've got the first version of 'FH API and Keywords for Zerobrane' working. It is totally aimed at programmer types. You will need to change the file paths at the beginning of the file to suit your system.
At the moment, I've only defined functions (that I am currently using). I plan on adding module definitions at some point.
Re: Just started using Zerobrane
Posted: 26 Jan 2021 13:33
by Ron Melby
shoshk
I've been fiddling around with the settings - got rid of all those pesky underlines that (I found) made it difficult to read my code, tweaked the syntax coloring a bit more.
can you explain what you did and where, what values you put in as well, I hate those underlines, and could stand some better colors...
thanks.
Re: Just started using Zerobrane
Posted: 26 Jan 2021 14:39
by shoshk
I made a copy of the
tomorrow.lua file, copied the
NotepadPlusPlus definitions and edited to get the following result:
Code: Select all
Shosh = { -- adapted from NotepadPlusPlus)
Background = H'FFFFFF', -- white
CurrentLine = H'E9E2FF', -- pale lilac
Selection = H'C0C0C0', -- light grey
Foreground = H'000000', -- black
Comment = H'008000', -- green
Red = H'FF0000', -- red
Orange = H'FF6900', -- orange
Yellow = H'FF4E00', -- intense orange
Green = H'008000', -- green
Aqua = H'000080', -- dark blue
Blue = H'2123FF', -- blue
Purple = H'8000FF', -- purple
},
edited the
comment and
stringtxt definitions:
Code: Select all
-- wxstc.wxSTC_LUA_COMMENT, wxstc.wxSTC_LUA_COMMENTLINE, wxstc.wxSTC_LUA_COMMENTDOC
comment = {fg = C.Comment, fill = true, i = true},
-- wxstc.wxSTC_LUA_STRING, wxstc.wxSTC_LUA_CHARACTER, wxstc.wxSTC_LUA_LITERALSTRING
stringtxt = {fg = C.Aqua, i = true},
-- wxstc.wxSTC_LUA_STRINGEOL
edited the
varlocal definition:
Code: Select all
varlocal = {fg = C.Foreground, st = wxstc.wxSTC_INDIC_HIDDEN},
Note: wxstc.wxSTC_INDIC_HIDDEN is the magic that gets rid of the underlines. I try to define all my variables as 'local'
I tried to make my global variables bold and red so they would stand out (a global variable is a mistake)
Code: Select all
varglobal = {fg = C.red, b = true},
but Zerobrane seems to be ignoring it.
My
user.lua file looks like this:
Code: Select all
--[[--
Use this file to specify **System** preferences.
Review [examples](+H:\Downloads\ZeroBraneStudio\cfg\user-sample.lua) or check [online documentation](http://studio.zerobrane.com/documentation.html) for details.
--]]--
autoanalyzer = true
console.fontname = 'Consolas'
console.fontsize = 12
default.extension = 'lua'
filetree.showchanges = true
editor.autoreload = true
editor.fontname = 'Consolas'
editor.fontsize = 12
editor.specmap.fh_lua = 'lua'
editor.specmap.wlua = 'lua'
editor.tabwidth = 2
editor.usetabs = true
editor.smartindent = true
editor.indentguide = wxstc.wxSTC_IV_LOOKBOTH --prf
editor.wrapindentmode = wxstc.wxSTC_WRAPINDENT_INDENT --prf
editor.foldcompact = true
editor.foldflags = 0
local luaspec = ide.specs.lua
luaspec.exts[#luaspec.exts+1] = "fh_lua"
acandtip.ignorecase = true
acandtip.startat = 1
acandtip.strategy = 0
acandtip.width = 80
api = {'fhAPI'}
styles = loadfile('cfg/tomorrow-Copy.lua')('Shosh')
stylesoutshell = styles -- apply the same scheme to Output/Console windows
styles.auxwindow = styles.text -- apply text colors to auxiliary windows
Some of what's there doesn't achieve what I wanted, but I managed to get rid of the underlines for the folded code; I believe that is the setting for
editor.foldflags.
Hope this helps.
Re: Just started using Zerobrane
Posted: 26 Jan 2021 18:28
by Ron Melby
thanks, among all the things I am doing I have it saved for working on it.