I would assume that the following would assign a scope to an empty line, but it's not working. Any ideas? Is this possible?
{ name = 'splay.empty'; match = '^$'; },
Il giorno 17/dic/05, alle ore 22:22, Oliver Taylor ha scritto:
I would assume that the following would assign a scope to an empty line, but it's not working. Any ideas? Is this possible?
{ name = 'splay.empty'; match = '^$'; },
IIRC you have to match the \n as well in order to match the whole line
Actually... allan will have to back me up on this but I think it's impossible. An empty line has nothing on it but the ending return, and then only if it's not the last line. Therefore there is nothing to actually be matched, because the insertion point gets the scope of the char before the point, on an empty line it would be the scope of the previous lines return which you can't match because TM can only match one line at a time.
So actually I guess the answer is your match is valid... but because there is no real character to match it makes it useless in practice. At least I think... :)
Just to make sure we all agree, as far as regex (only) goes, matching an empty line is just ^$
-- Sune.
Il giorno 18/dic/05, alle ore 02:37, Sune Foldager ha scritto:
Just to make sure we all agree, as far as regex (only) goes, matching an empty line is just ^$
yep, we agree :) on a related note I recall (while tweaking Python grammar) that one has to match the "\n" in order for the scope to extend to the right -- that is evident in case one wants to assign a background color to the scope.
On 18/12/2005, at 2:10, Michael Sheets wrote:
Actually... allan will have to back me up on this but I think it's impossible. An empty line has nothing on it but the ending return, and then only if it's not the last line. Therefore there is nothing to actually be matched [...]
Indeed, yes.