In one of the recent updates (I think), the default behaviour when hitting return inside a new set of braces seems to have changed.
Previously opening a pair of braces and hitting return would result in the following:
{ // caret here }
Now I get:
{ // caret here}
This is affecting all the grammars I commonly use - PHP, CSS, JS but presumably is global.
Did I inadvertently change a setting somewhere or is this a change of the default TextMate behaviour that I missed?
Either way, is there a way to return to the old behaviour? I have done a few searches and seen some mentions in certain languages that you may be able to build a snippet to fire on enter if the syntax supports specific enough scoping but I'm failing to get it to work for me.
Dom
On Dec 9, 2013, at 7:21 AM, Dominic Morgan dom@d3r.com wrote:
Did I inadvertently change a setting somewhere or is this a change of the default TextMate behaviour that I missed?
This behavior is handled in the Source bundle, make sure you haven’t disabled it in Preferences.
(Text, Source, TextMate, Bundle Support, Themes, and SCM should all be enabled for basic functionality.)
On 10 Dec 2013, at 9:12, Michael Sheets wrote:
This behavior is handled in the Source bundle, make sure you haven’t disabled it in Preferences.
(Text, Source, TextMate, Bundle Support, Themes, and SCM should all be enabled for basic functionality.)
hmh, same with Perl code. All of the bundles listed above are enabled and I still get (^ marks the cursor-position):
hallo( ^)
If I change to C it works as expected:
hello( ^ )
Any other idea? What is the responsible setting for enabling that in C code?
Kind regards, Ingo
On 11 Dec 2013, at 10:32, Ingo Lantschner wrote:
On 10 Dec 2013, at 9:12, Michael Sheets wrote:
This behavior is handled in the Source bundle, make sure you haven’t disabled it in Preferences.
(Text, Source, TextMate, Bundle Support, Themes, and SCM should all be enabled for basic functionality.)
hmh, same with Perl code. All of the bundles listed above are enabled and I still get (^ marks the cursor-position):
hallo( ^)
Since your other email indicates that you also do not have the normal indent disabled for block comments, it does sound like missing default bundles, see https://github.com/textmate/textmate/wiki/Reverting-To-Defaults
If I change to C it works as expected:
hello( ^ )
Any other idea? What is the responsible setting for enabling that in C code?
The snippet itself on the return key is in the source bundle, but it is enabled by having the language grammar scope empty parenthesis. So the issue could also be that you have old grammars?
On 12 Dec 2013, at 05:49, Allan Odgaard mailinglist@textmate.org wrote:
On 11 Dec 2013, at 10:32, Ingo Lantschner wrote:
On 10 Dec 2013, at 9:12, Michael Sheets wrote:
This behavior is handled in the Source bundle, make sure you haven’t disabled it in Preferences.
(Text, Source, TextMate, Bundle Support, Themes, and SCM should all be enabled for basic functionality.)
hmh, same with Perl code. All of the bundles listed above are enabled and I still get (^ marks the cursor-position):
hallo( ^)
Since your other email indicates that you also do not have the normal indent disabled for block comments, it does sound like missing default bundles, see https://github.com/textmate/textmate/wiki/Reverting-To-Defaults
If I change to C it works as expected:
hello( ^ )
Any other idea? What is the responsible setting for enabling that in C code?
The snippet itself on the return key is in the source bundle, but it is enabled by having the language grammar scope empty parenthesis. So the issue could also be that you have old grammars?
TextMate version 2.0-alpha.9497
I'm not the OP, though I think I was the one who brought up the POD indentation problem originally.
I'm getting the same problems as Ingo appears to have with indentation (as described above). I've deleted everything mentioned in https://github.com/textmate/textmate/wiki/Reverting-To-Defaults. I've gone to preferences->bundles and un-ticked Source and Perl to remove them, and then ticked them again (source takes a few seconds to re-install here), but the indentation problem persists with Perl. I tried C and CSS and they're both fine (as described above). I've quit and re-started TM2 but that's not helped - is TM2 supposed to dynamically load/reload bundles or do we need to restart TM2 for changes to be read?
Thank you for any help you can give.
On 17 Dec 2013, at 0:35, Justin Catterall wrote:
[…] I think I was the one who brought up the POD indentation problem originally.
I'm getting the same problems as Ingo appears to have with indentation (as described above).
Can you give a “steps to reproduce”?
[…] is TM2 supposed to dynamically load/reload bundles or do we need to restart TM2 for changes to be read?
It should pick up changes, though it relies on fs-events which for some users are broken. In this case though it is not enough to relaunch TextMate, but one need to manually remove the cache file mentioned on the revert-to-defaults page (and then relaunch).
On Dec 17, 2013, at 1:51 AM, Allan Odgaard mailinglist@textmate.org wrote:
On 17 Dec 2013, at 0:35, Justin Catterall wrote:
[…] I think I was the one who brought up the POD indentation problem originally.
I'm getting the same problems as Ingo appears to have with indentation (as described above).
Can you give a “steps to reproduce”?
[…] is TM2 supposed to dynamically load/reload bundles or do we need to restart TM2 for changes to be read?
It should pick up changes, though it relies on fs-events which for some users are broken. In this case though it is not enough to relaunch TextMate, but one need to manually remove the cache file mentioned on the revert-to-defaults page (and then relaunch).
Would it be appropriate, perhaps, to restore the Reload Bundles menu item? No one is going to want to mess with cache files manually, nor will most people know that this needs to be done. And, as you say yourself, fsevents can't be universally relied upon. 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 17 Dec 2013, at 23:49, Matt Neuburg wrote:
Would it be appropriate, perhaps, to restore the Reload Bundles menu item? No one is going to want to mess with cache files manually, nor will most people know that this needs to be done. And, as you say yourself, fsevents can't be universally relied upon.
It’s worth mentioning that TextMate only relies on fs-events for changes done outside TextMate (to bundles) and that fs-events should normally work (e.g. Time Machine and Spotlight relies on them as well).
But some shortcut to reset things wouldn’t be bad. What I think would be most useful is a “Revert to Defaults”, but it’s also potentially dangerous.
On 17 Dec 2013, at 09:51, Allan Odgaard mailinglist@textmate.org wrote:
On 17 Dec 2013, at 0:35, Justin Catterall wrote:
[…] I think I was the one who brought up the POD indentation problem originally.
I'm getting the same problems as Ingo appears to have with indentation (as described above).
Can you give a “steps to reproduce”?
I follow the steps in https://github.com/textmate/textmate/wiki/Reverting-To-Defaults, though I don't have a ~/Library/Caches/com.macromates.TextMate/BundlesIndex.binary, but I do have a ~/Library/Caches/com.macromates.textmate/BundlesIndex.binary - so I deleted that.
I start TM2, I go to prefs pane and enable the Perl bundle (other bundles enabled: Apache, AppleScript, Bundle Development, Bundle Support, C, CSS, Diff, Git, HTML, Hyperlink Helper, Java, JavaDoc, JavaScript, JavaScript, jQuery, JSON, Lua, Mail, Make, Markdown, Math, Mercurial, Objective C, PHP, Postscript, Property List, Python, Ruby, SCM, Shell Script, Source, SQL, Subversion, Text, Textile, TextMate, Themes, TODO, XML).
In the new document I Options+Shift+Ctrl+p and choose item 1, Perl. I type:
#!/usr/bin/perl
for (0..3) {
A closing } appears with the cursor between the brackets, I hit return. Both the cursor and the closing bracket move down one line with no indentation:
#!/usr/bin/perl
for (0..3) { |}
(cursor position indicated by '|' character.
If I hit Options+Shift+Ctrl+c and select 'C' or 'CSS' indentation works as I would expect:
CSS: .class { | }
C: { | }
Pipe (|) used to signify cursor position again, and spaces used for indenting here.
Incidentally, I don't have a ~/Library/Application Support/Avian folder or file.
I have also removed TM2, then followed the reverting to defaults instructions, then re-installed TM2, but the indentation problem remains.
TextMate version 2.0-alpha.9499 OS X 10.8.5
Any other info that would/may be useful?
[…] is TM2 supposed to dynamically load/reload bundles or do we need to restart TM2 for changes to be read?
It should pick up changes, though it relies on fs-events which for some users are broken. In this case though it is not enough to relaunch TextMate, but one need to manually remove the cache file mentioned on the revert-to-defaults page (and then relaunch).
Fair enough, I'll persist with quit and restart when I make changes, I make them very, very rarely so it's not an issue.
On 18 Dec 2013, at 0:49, Justin Catterall wrote:
[…] Any other info that would/may be useful?
Sorry, I thought it was about incorrect indent in comments (POD).
Braces certainly do not indent as expected here, I am not sure why Michael didn’t pick up that it is missing for Perl when he replied to the OP.
I have asked him to look at the grammar (to add the proper scopes).
On Dec 18, 2013, at 9:40 PM, Allan Odgaard mailinglist@textmate.org wrote:
Braces certainly do not indent as expected here, I am not sure why Michael didn’t pick up that it is missing for Perl when he replied to the OP.
I have asked him to look at the grammar (to add the proper scopes).
Just added the proper scopes for braces and parenthesis, once the bundle updates you should see indenting for those. Reply back if it doesn’t work in any certain cases.
On 19 Dec 2013, at 10:09, Michael Sheets mummer@whitefalls.org wrote:
On Dec 18, 2013, at 9:40 PM, Allan Odgaard mailinglist@textmate.org wrote:
Braces certainly do not indent as expected here, I am not sure why Michael didn’t pick up that it is missing for Perl when he replied to the OP.
I have asked him to look at the grammar (to add the proper scopes).
Just added the proper scopes for braces and parenthesis, once the bundle updates you should see indenting for those. Reply back if it doesn’t work in any certain cases.
Un-ticked Perl bundle. Ticked it again. Ctrl+Shift+Opt+p, '1' for Perl, {\n and now I get good wholesome braces and indents. Thank you.
On 19 Dec 2013, at 11:09, Michael Sheets wrote:
Just added the proper scopes for braces and parenthesis, once the bundle updates you should see indenting for those.
Works fine now - thank you!
On 19 Dec 2013, at 03:40, Allan Odgaard mailinglist@textmate.org wrote:
On 18 Dec 2013, at 0:49, Justin Catterall wrote:
[…] Any other info that would/may be useful?
Sorry, I thought it was about incorrect indent in comments (POD).
Braces certainly do not indent as expected here, I am not sure why Michael didn’t pick up that it is missing for Perl when he replied to the OP.
I have asked him to look at the grammar (to add the proper scopes).
Sorry, Allan, didn't mean to mislead / confuse the situation, it's just that they were both Perl and, I thought, might be related.