ZeroBrane Studio Lua IDE v0.70 is out

General discussion about LÖVE, Lua, game development, puns, and unicorns.
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by paulclinger »

baconhawka7x wrote:Loving this! One feature that it doesn't have that would be nice is a hotkey to switch files, like in sublime text 2 you can push crtl+p and you type what file you want to go to and push enter, way more convenient then going to your mouse and clicking what file you want to go to, especially with larger projects. Just a small bit of feedback, though:D

Great job though, I am a definite fan/hardcore user now.
@baconhawka7x, thank you for the feedback! This is certainly coming, I just can't say when ;). This is one of the most frequently requested features (along with auto-complete for user functions/methods and outline/symbol view), so I definitely keep that in mind. Paul.
SkymarshallHeff
Prole
Posts: 10
Joined: Mon Jun 23, 2014 6:32 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by SkymarshallHeff »

Apologies for the slight threadcromancy:

One feature I love and miss most from Visual Studio/NetBeans etc is user defined code regions. Some users hate them, some don't. Would it be possible to have an equivalent in ZeroBrane? I wanted to implement the functionality in Notepad++ but the easiest way of doing it was for some reason removed in newer versions, which now require you write a lexer in C (or was it C++?) which I just can't be bothered to do. For those unfamiliar with what I'm talking about (or maybe my explanation just sucks) check this:

Before: Image

After: Image

The #region and #endregion tags are ignored by the compiler (but not the stuff between them - folding is strictly for in-IDE organisation), allowing you to fold code where you want and give it a meaningful name. I found it useful when I was working on classes that were somewhat big - instead of trying to remember where I'd left an event, I simply had a region of events (which may have sub-regions if there were many events that could be further logically grouped).

Now that particular way of doing things is neat, but it requires the compiler be actively aware of what #region means and to ignore it for compilation. This can't really be done for Lua/Love (well, maybe, but that's another drama) so maybe the NetBeans way of doing it might be more easily implemented.

NetBeans example (sorry I don't have it installed at the moment):

Code: Select all

//<editor-fold desc="consts">
string a = "random string";
int b = 7;
//</editor-fold>
It accomplishes the same thing, but declares the fold within a Java-style comment, so that it works in all Java compilation environments (I think Notepad++ respects the editor-fold tags as well, which is neat).

Replicating the behaviour in Lua could be something like:

Code: Select all

--<fold name="consts">
scale = 1;
sys = "undefined";
width = 0;
height = 0;
--</fold>
Appropriate use of regions can greatly clarify your objects/scripts etc while keeping your code organised and allowing you to focus on what you specifically want to do instead of wading through context irrelevant code.

Also if ZeroBrane already supports this concept, sorry for the longish post :P
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by paulclinger »

shatterblast wrote:I love this software. Is there a guide or FAQ on how to use the debug feature? I started with Java and the Eclipse IDE, but I never got far enough as far as debugging one's own software.
Thank you, @shatterblast. There is a short high-level overview here; there are also love-specific details for debugging and live coding. If there is anything in particular that needs to be covered, please let me know.
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by paulclinger »

SkymarshallHeff wrote:The #region and #endregion tags are ignored by the compiler (but not the stuff between them - folding is strictly for in-IDE organisation), allowing you to fold code where you want and give it a meaningful name.
ZeroBrane Studio currently doesn't include this functionality, but it may be possible to support it (although, I'll probably do it as a plugin). I may use '--#region consts' and '--#endregion', but the collapsed block will probably still show --#region consts (and not just 'consts').
SkymarshallHeff
Prole
Posts: 10
Joined: Mon Jun 23, 2014 6:32 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by SkymarshallHeff »

paulclinger wrote:
SkymarshallHeff wrote:The #region and #endregion tags are ignored by the compiler (but not the stuff between them - folding is strictly for in-IDE organisation), allowing you to fold code where you want and give it a meaningful name.
ZeroBrane Studio currently doesn't include this functionality, but it may be possible to support it (although, I'll probably do it as a plugin). I may use '--#region consts' and '--#endregion', but the collapsed block will probably still show --#region consts (and not just 'consts').
That would be more than enough to make me cry tears of joy :D
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by paulclinger »

> That would be more than enough to make me cry tears of joy

@SkymarshallHeff, I took a look, but it turned out to be not as straightforward as I'd like. I ran into some issues at the Scintilla level. Still checking... Paul.
dan369
Prole
Posts: 44
Joined: Tue Apr 15, 2014 10:53 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by dan369 »

Love ZeroBrane, amazing work Paul!
One small suggestion/question (not sure if this functionality is in the IDE or not), I am quite often looking at my resources, changing them etc. So when I'm in the IDE I'd like to quickly open them from my project view however at this moment in time the usual double click on an asset doesn't open it up in the default program rather I have to do a left-click, "Open with Default Program".

Wondering if there is any setting I need to toggle for a double click on an asset so that it will open with the default program rather than the IDE, and if not well it would be a cool feature to have :).
paulclinger
Party member
Posts: 227
Joined: Thu Jun 28, 2012 8:46 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by paulclinger »

dan369 wrote:Love ZeroBrane, amazing work Paul!

Wondering if there is any setting I need to toggle for a double click on an asset so that it will open with the default program rather than the IDE, and if not well it would be a cool feature to have :).
@dan369, thank you for the feedback! Yes, it should be possible with a plugin. Save the following file as openwithdefault.lua into packages/ folder:

Code: Select all

return {
  name = "Open With Default",
  description = "Opens file with Default Program when activated.",
  author = "Paul Kulchenko",
  version = 0.1,
  dependencies = 0.51,

  onFiletreeActivate = function(self, tree, event, item_id)
    local fname = tree:GetItemText(item_id)
    local ext = '.'..wx.wxFileName(fname):GetExt()
    local ft = wx.wxTheMimeTypesManager:GetFileTypeFromExtension(ext)
    if ft then
      tree:SelectItem(item_id)
      tree:AddPendingEvent(wx.wxCommandEvent(wx.wxEVT_COMMAND_MENU_SELECTED, ID_OPENEXTENSION))
      return false
    end
  end,
}
Let me know if the plugin works for you and I'll add it to the plugin repository.

There are also other plugins you may fine useful; for example, openimagefile will show dimensions for an image file and open it directly in ZBS (note that this may conflict with the plugin above).
dan369
Prole
Posts: 44
Joined: Tue Apr 15, 2014 10:53 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by dan369 »

paulclinger wrote:
dan369 wrote:Love ZeroBrane, amazing work Paul!

Wondering if there is any setting I need to toggle for a double click on an asset so that it will open with the default program rather than the IDE, and if not well it would be a cool feature to have :).
@dan369, thank you for the feedback! Yes, it should be possible with a plugin. Save the following file as openwithdefault.lua into packages/ folder:

Code: Select all

return {
  name = "Open With Default",
  description = "Opens file with Default Program when activated.",
  author = "Paul Kulchenko",
  version = 0.1,
  dependencies = 0.51,

  onFiletreeActivate = function(self, tree, event, item_id)
    local fname = tree:GetItemText(item_id)
    local ext = '.'..wx.wxFileName(fname):GetExt()
    local ft = wx.wxTheMimeTypesManager:GetFileTypeFromExtension(ext)
    if ft then
      tree:SelectItem(item_id)
      tree:AddPendingEvent(wx.wxCommandEvent(wx.wxEVT_COMMAND_MENU_SELECTED, ID_OPENEXTENSION))
      return false
    end
  end,
}
Let me know if the plugin works for you and I'll add it to the plugin repository.

There are also other plugins you may fine useful; for example, openimagefile will show dimensions for an image file and open it directly in ZBS (note that this may conflict with the plugin above).
@paulclinger, thanks for getting back to me! Amazing :awesome: the plugin works perfectly, in-fact I didn't even realise ZBS had plugin support :O.. just added around 6 of those :)

Edit:
Another curiosity question ; any information on what is planned for v0.80? And does the IDE have theme support? Always wanted to try out a dark-theme on it :)
User avatar
murks
Party member
Posts: 185
Joined: Tue Jun 03, 2014 4:18 pm

Re: ZeroBrane Studio Lua IDE v0.70 is out

Post by murks »

It already has theme support and there are a number of dark themes available. It's documented on the website. I currently use the 'SciTeLuaIDE' theme.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests