Re: [textadept] Folding, lexer.lua

From: mitchell <c....at.caladbolg.net>
Date: Mon, 28 Nov 2011 17:39:02 -0500 (EST)

> Yes, I thought nested folding in multi-line comments is bad, so my
> patch prevent it completely.
> Your patch folds lines 2-3 here:
>
> --[=[
> -- bug or feature?
> --
> ]=]

Feature. I think nested comment folding is useful, at least with [[ ]].

>
> and my doesn't. I'm not sure which behaviour is better.
> And i would avoid use of string.sub if not necessary, maybe smthng like this:
> - if s > 1 and not line:sub(1, s - 1):find('^%s+$') then return 0 end
> + if s > 1 and line:match('^%s*()') < s then return 0 end

Excellent, thank you.

> I will make a small article on wiki later this week (if nothing
> prevents me by that...)

Great!

mitchell
Received on Mon 28 Nov 2011 - 17:39:02 EST

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 12:20:22 EST