[Toybox] fold implementation

David Seikel onefang at gmail.com
Fri Apr 4 01:23:57 PDT 2014


On Thu, 03 Apr 2014 21:32:02 -0500 Rob Landley <rob at landley.net> wrote:

> On 04/03/14 19:29, Samuel Holland wrote:
> > On Apr 3, 2014, at 5:56 PM, Rob Landley <rob at landley.net> wrote:
> >> The -u option to fold isn't currently being used...
> >>
> >> Could you describe a little more how unfold would work?
> > 
> > Generally, I write papers and such in a text editor with hard
> > wrapping, like nano, and then transfer them to LibreOffice for
> > formatting. So I go from newline after X columns and a blank line
> > between paragraphs to long lines with a single newline between
> > paragraphs. The simplest algorithm would be to remove all newlines
> > except double newlines (and convert those to single). If -s was
> > specified, we would only remove newlines after spaces and tabs (or
> > unless there was no space in that line). Finally, if -w was
> > specified, we would re-wrap at that width.
> 
> *shrug* sounds good to me. I note that when we implement our toybox's
> editor, it'll probably need something like this.

Seems like a good time to remind you about the "generic editor code"
thread that has my first instalment that's been sitting there for
months with no comment.  Well, one private comment from someone that's
itching to use the more advanced editor, but I'm waiting for you to
deal with the bite sized chunks you asked me for.

The other type of folding is planned as an advanced editing feature.
That's where you fold source code on the screen so that only the top
line of any block of code is visible, the rest get hidden.  That would
either work based on parsing the source code (also needed for syntax
highlighting) or a more simple version based on indentation only.
Either way, that's a bite sized chunk for much later, I hadn't even put
it in the original editor yet.

This sort of folding/unfolding could be added to, especially since
Samuel has written the code already.  B-)

-- 
A big old stinking pile of genius that no one wants
coz there are too many silver coated monkeys in the world.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20140404/8a70b480/attachment-0002.sig>


More information about the Toybox mailing list