I was getting the wrong auto-close \end{...} tags when I pressed apple-option-. in my LaTeX document.
The problem turns out to be caused by a bug (or design flaw) in the helper script "$TM_SUPPORT_PATH/bin/checknest.rb", which only recognises a single delimeter per line: in a few places I have a short environment on a single line.
I have applied the attached patch to my copy. I admit that I haven't tested it especially thoroughly, but it seems to work for me.
I hope this is useful.
Robin
Thanks for the patch Robin, unfortunately I get a merge conflict in the third hunk.
Could you run a diff against http://macromates.com/svn/Bundles/trunk/ Support/bin/checknest.rb and give me that?
On 15. Mar 2007, at 20:40, Robin Houston wrote:
I was getting the wrong auto-close \end{...} tags when I pressed apple-option-. in my LaTeX document.
The problem turns out to be caused by a bug (or design flaw) in the helper script "$TM_SUPPORT_PATH/bin/checknest.rb", which only recognises a single delimeter per line: in a few places I have a short environment on a single line.
I have applied the attached patch to my copy. I admit that I haven't tested it especially thoroughly, but it seems to work for me.
I hope this is useful.
Robin <checknest.patch>
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On 3/16/07, Allan Odgaard throw-away-1@macromates.com wrote:
Thanks for the patch Robin, unfortunately I get a merge conflict in the third hunk.
Could you run a diff against http://macromates.com/svn/Bundles/trunk/ Support/bin/checknest.rb and give me that?
Ah, sorry. I was diffing against an old version (1.5.4). Here's the diff against svn.
As well as recognising multiple tags per line, I've also left in the debug option (-d) that I added to help me investigate the problem. It may be useful in the future.
Note that it still doesn't support tags that span *multiple* lines. Although it's legal in Latex to split an environment opener, e.g.
\begin {equation}
nobody ever does. Or at least *I* never do, so it's not a problem for me! (On the other hand, when I'm writing HTML I sometimes split a tag over more than one line, if it has a lot of attributes. Perhaps that's part of the reason the HTML bundle doesn't use checknest.rb for its "Insert Close Tag" command?)
Robin
On 16. Mar 2007, at 13:47, Robin Houston wrote:
[...] As well as recognising multiple tags per line, I've also left in the debug option (-d) that I added to help me investigate the problem. It may be useful in the future.
I have now applied the patch, thanks.
Note that it still doesn't support tags that span *multiple* lines. Although it's legal in Latex to split an environment opener, e.g.
\begin {equation}
nobody ever does. Or at least *I* never do, so it's not a problem for me!
I guess if we really wanted, we could convert newlines to spaces, that would solve it, right!?!
(On the other hand, when I'm writing HTML I sometimes split a tag over more than one line, if it has a lot of attributes. Perhaps that's part of the reason the HTML bundle doesn't use checknest.rb for its "Insert Close Tag" command?)
I actually forgot about checknest.rb when I did the close tag command, so the feasibility was never really evaluated ;)
On 3/17/07, Allan Odgaard throw-away-1@macromates.com wrote:
I guess if we really wanted, we could convert newlines to spaces, that would solve it, right!?!
The real problem is that the file is processed a line at a time. It would be pretty easy, if necessary, to make it instead read the whole file into a string and process that.
Robin