* Just started using Zerobrane

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Just started using Zerobrane

Post 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
Shosh Kalson
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Just started using Zerobrane

Post 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.
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post 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. ;)
Shosh Kalson
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Just started using Zerobrane

Post by ColeValleyGirl »

Yeah, and integrate it well with github...
User avatar
AdrianBruce
Megastar
Posts: 2090
Joined: 09 Aug 2003 21:02
Family Historian: V7
Location: South Cheshire
Contact:

Re: Just started using Zerobrane

Post by AdrianBruce »

Sigh... I haven't the faintest idea what you're talking about! ;)

I used to do folding of punch cards? Anything like? :D
Adrian
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post by shoshk »

You folded your punch cards !?!

So, you were the one who kept clogging up the card reader! :lol:
Shosh Kalson
User avatar
LornaCraig
Megastar
Posts: 3190
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Re: Just started using Zerobrane

Post 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....)
Lorna
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post 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!
Shosh Kalson
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post by shoshk »

We saw people dropping decks all the time. We were young and mean and found it quite funny.
Shosh Kalson
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Just started using Zerobrane

Post 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.
User avatar
AdrianBruce
Megastar
Posts: 2090
Joined: 09 Aug 2003 21:02
Family Historian: V7
Location: South Cheshire
Contact:

Re: Just started using Zerobrane

Post 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. :lol:
Adrian
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post 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.
Shosh Kalson
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Just started using Zerobrane

Post 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

Code: Select all

--TODO: Fix this bit
and other gems of wisdom into the code and seeing all such items in a panel as a tod-do list.
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post by shoshk »

Which TODO plugin do you use? I saw several.
Shosh Kalson
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Just started using Zerobrane

Post by ColeValleyGirl »

I use todo, and have tweaked the patterns to include TODO: (obvious) FIXME: (bugs) and ENHANCE: (possible additional functionality etc.)
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post by shoshk »

I often put TODO in my code. This sounds like a nice feature to add.
Shosh Kalson
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post 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.
Shosh Kalson
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Just started using Zerobrane

Post 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...
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post 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.
Shosh Kalson
User avatar
ColeValleyGirl
Megastar
Posts: 5464
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Just started using Zerobrane

Post by ColeValleyGirl »

Thanks for offering to share -- I *may* be able to contribute some data entry but no promises.
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post 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.
Attachments
Build for Zerobrane.fh_lua
(2.97 KiB) Downloaded 99 times
fhApi-functions.csv
(674 Bytes) Downloaded 87 times
Shosh Kalson
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Just started using Zerobrane

Post 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.
FH V.6.2.7 Win 10 64 bit
avatar
shoshk
Superstar
Posts: 280
Joined: 13 May 2015 16:28
Family Historian: V7
Location: Mitzpe Jericho, Israel

Re: Just started using Zerobrane

Post 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.
Shosh Kalson
User avatar
Ron Melby
Megastar
Posts: 917
Joined: 15 Nov 2016 15:40
Family Historian: V6.2

Re: Just started using Zerobrane

Post by Ron Melby »

thanks, among all the things I am doing I have it saved for working on it.
FH V.6.2.7 Win 10 64 bit
Post Reply