I've just discovered that part of the breakage in the Asciidoc bundle is due to the higher precedence in TextMate 2 of the indentation rules. In particular, I have deduced that I'm being bolluxed by a rule inherited from text.html. The asciidoc grammar is scoped as text.html.asciidoc, wrongly; I intend to change that, but right now I'm still learning my away around.
(There is little doubt that the scoping of the asciidoc grammar as text.html.asciidoc is a huge mistake and lies at the heart of many of my problems. I didn't write this grammar so it isn't my fault; I'm just trying to fix it so it works. Asciidoc has nothing to do with html - even less, indeed, than markdown does. There are some places where asciidoc should behave like xml, but then the solution is presumably to adopt xml behavior in just those places. So all this is going to change. But humor me anyway, for now.)
According to the FAQ on github, I should be able to shelter myself from indentation rules ("you can disable the auto-indentation entirely") by a setting like this:
{ disableIndentCorrections = :true; }
But no matter how I scope that pref (including no scope, text.html, etc.), automatic indentation when I press Return is happening, under the influence of text.html (the caret is in the scope text.html.asciidoc meta.paragraph.asciidoc).
Have I found a bug in TextMate 2, or am I just being misled by the wording in the FAQ?
m.
-- matt neuburg, phd = matt@tidbits.com, http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
On 13 Jan 2014, at 20:09, Matt Neuburg wrote:
But no matter how I scope that pref (including no scope, text.html, etc.), automatic indentation when I press Return is happening, under the influence of text.html (the caret is in the scope text.html.asciidoc meta.paragraph.asciidoc).
I am not sure if this is somehow related or not, but your problem sounds familiar to what I have experienced with Perl POD text. See http://lists.macromates.com/textmate/2013-December/036715.html - in the course of that thread I found at least a work-around (e-mail dated 10. December 2013 08:23). .
On Jan 13, 2014, at 11:22 PM, Ingo Lantschner lists14@lantschner.name wrote:
On 13 Jan 2014, at 20:09, Matt Neuburg wrote:
But no matter how I scope that pref (including no scope, text.html, etc.), automatic indentation when I press Return is happening, under the influence of text.html (the caret is in the scope text.html.asciidoc meta.paragraph.asciidoc).
I am not sure if this is somehow related or not, but your problem sounds familiar to what I have experienced with Perl POD text. See http://lists.macromates.com/textmate/2013-December/036715.html - in the course of that thread I found at least a work-around (e-mail dated 10. December 2013 08:23).
Thanks, Ingo. I have a good workaround, namely to take the asciidoc bundle out from under the influence of the html bundle. What I'm trying to ascertain now is merely whether
{ disableIndentCorrections = :true; }
actually does anything (as claimed by the FAQ) and if so, what. m.
-- matt neuburg, phd = matt@tidbits.com, http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
On 14 Jan 2014, at 23:39, Matt Neuburg wrote:
[…] What I'm trying to ascertain now is merely whether
{ disableIndentCorrections = :true; }
actually does anything (as claimed by the FAQ) and if so, what. m.
It disables indent corrections. Indent corrections happen when you type on a line, and TextMate thinks the indent of the line should be different than what it currently is.
Pressing return creates a new line and that new line gets initial indent according to the active rules and the lines above. This does not count as an “indent correction”.
On Jan 14, 2014, at 1:45 PM, Allan Odgaard mailinglist@textmate.org wrote:
On 14 Jan 2014, at 23:39, Matt Neuburg wrote:
[…] What I'm trying to ascertain now is merely whether
{ disableIndentCorrections = :true; }
actually does anything (as claimed by the FAQ) and if so, what. m.
It disables indent corrections. Indent corrections happen when you type on a line, and TextMate thinks the indent of the line should be different than what it currently is.
Pressing return creates a new line and that new line gets initial indent according to the active rules and the lines above. This does not count as an “indent correction”.
Well, I don't think that that is what is expressed by the FAQ, which says: "You can disable the auto-indentation entirely by adding a new settings item (scoped to the language) as follows: { disableIndentCorrections = :true; }"
I suggest that the FAQ be amended for clarity and accuracy.
(I do not know whether also to suggest an additional setting that does what the FAQ currently says this setting does, but I think it might not be a bad idea. One might want to say, as I did, "shelter me from inherited autoindentation rules, wherever they are coming from.")
m.
-- matt neuburg, phd = matt@tidbits.com, http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
On 16 Jan 2014, at 0:06, Matt Neuburg wrote:
[…] I suggest that the FAQ be amended for clarity and accuracy.
I have updated the FAQ, which for the records is a wiki page editable by anyone with a GitHub account.
(I do not know whether also to suggest an additional setting that does what the FAQ currently says this setting does, but I think it might not be a bad idea. One might want to say, as I did, "shelter me from inherited autoindentation rules, wherever they are coming from.")
I think you should be able to make TextMate behave as desired via the indent rules (wrt. pressing return).