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