[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gambas-bugtracker] Bug #3246: Could there be a LimitEnd to accompany the Limit feature of TextEditor?


http://gambaswiki.org/bugtracker/edit?object=BUG.3246&from=L21haW4-

Bruce STEERS reported a new bug.

Summary
-------

Could there be a LimitEnd to accompany the Limit feature of TextEditor?

Type             : Request
Priority         : Low
Gambas version   : Master
Product          : Unknown


Description
-----------

I understand how with gambas class files the procedures are separated by "Limits" and found using the FindNextLimit() method.

And because gambas Procedures have no code in between them a Procedure can be found on 1 single line, where the function starts.

This is different for sh files as code can be written in between the functions so some kind of EndLimit is needed to specify it

I added this to the sh.highlight file to enable procedure folding in sh files...

  limit
  from /[A-Za-z0-9_]+\(\)/ to /^}$/ with sh

it works but the functions MUST end with a } on it's own line or it gets confused (probably my poor regex).
the downside is the "}" line is also considered a Limit and 

using a similar modal to gambas works better (looks better when folded) by defining a Limit as where each function starts.

  from /[A-Za-z0-9_]+\(\)/ to /[A-Za-z0-9_]+\(\)/ with sh

But then any code between the functions is considered part of the previous function and the last function goes to the end of the file.

So if there could be some way to define an end to a Limit as well as the standard start of another function it would be great to allow folding in any other highlighter mode that does not follow the gambas "no code between functions" modal.

With respects
Bruce


System information
------------------

n/a



----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----