Dear all,
I have suddenly experienced wholesale failure of commands in recent builds of TextMate 2. I initially thought it was a bug in a nightly build, so I switched to normal releases and downgraded, but the latest normal release is also showing the problem. I believe I first saw it with r9367, but I can't be sure.
As far as I can tell, no menu actions (at least) are working. For example, in a LaTeX document, both pressing ⌘R or selecting "Typeset and View" from the menu does nothing. It's not just the LaTeX bundle either: selecting "View Scope" from the Bundle Development bundle also does nothing. My snippets seem OK though.
I don't really know where to start with figuring this out, so some help would be appreciated!
All the best, Jon
On Feb 12, 2013, at 12:17 PM, Jon Clayden jon.clayden@gmail.com wrote:
I have suddenly experienced wholesale failure of commands in recent builds of TextMate 2 […] […] I don't really know where to start with figuring this out, so some help would be appreciated!
You may have uninstalled the Bundle Support bundle or another central bundle.
To revert to defaults you can remove the ~/Library/Application Support/TextMate and ~/Library/Application Support/Avian folders (though this also removes potential customizations done to the bundles).
Thanks, Allan, for the response, but moving these two folders elsewhere (and then reinstalling the bundles I use, via TM prefs, but no customisations) does not solve the problem. I haven't made any recent changes to any bundle, and as I mentioned, downgrading was previously effective at solving the issue. I'm on Mountain Lion (10.8.2), if that's relevant.
Regards, Jon
On 13 February 2013 09:20, Allan Odgaard mailinglist@textmate.org wrote:
On Feb 12, 2013, at 12:17 PM, Jon Clayden jon.clayden@gmail.com wrote:
I have suddenly experienced wholesale failure of commands in recent
builds of TextMate 2 […]
[…] I don't really know where to start with figuring this out, so some help
would be appreciated!
You may have uninstalled the Bundle Support bundle or another central bundle.
To revert to defaults you can remove the ~/Library/Application Support/TextMate and ~/Library/Application Support/Avian folders (though this also removes potential customizations done to the bundles).
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Just to follow up, it seems that this may be related to my .tm_properties file. I have
projectDirectory = "${TM_FILEPATH/(/Users/jon/Development/Git/[^/]+).*/$1/}" windowTitle = "${projectDirectory/^.*/([^/]+)$/$1/} — $TM_DISPLAYNAME"
in the directory above the ones I was testing in.
Within those testing directories, TextMate takes up 100% CPU *for each tab I open*, until it uses all four of my cores (with four tabs). And commands don't work (possibly because of the high CPU usage, I guess). But when I move that .tm_properties file away, everything seems to go back to normal. If I put it back, the problem recurs.
I hope this helps pin down the issue.
Jon
On 13 February 2013 11:18, Jon Clayden jon.clayden@gmail.com wrote:
Thanks, Allan, for the response, but moving these two folders elsewhere (and then reinstalling the bundles I use, via TM prefs, but no customisations) does not solve the problem. I haven't made any recent changes to any bundle, and as I mentioned, downgrading was previously effective at solving the issue. I'm on Mountain Lion (10.8.2), if that's relevant.
Regards, Jon
On 13 February 2013 09:20, Allan Odgaard mailinglist@textmate.org wrote:
On Feb 12, 2013, at 12:17 PM, Jon Clayden jon.clayden@gmail.com wrote:
I have suddenly experienced wholesale failure of commands in recent
builds of TextMate 2 […]
[…] I don't really know where to start with figuring this out, so some help
would be appreciated!
You may have uninstalled the Bundle Support bundle or another central bundle.
To revert to defaults you can remove the ~/Library/Application Support/TextMate and ~/Library/Application Support/Avian folders (though this also removes potential customizations done to the bundles).
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Your regexes are probably badly formed. Read more about what makes a regex engine explode here: http://www.regular-expressions.info/catastrophic.html
On 2013-02-13 10:50, Jon Clayden wrote:
Just to follow up, it seems that this may be related to my .tm_properties file. I have
projectDirectory = "${TM_FILEPATH/(/Users/jon/Development/Git/[^/]+).*/$1/}" windowTitle = "${projectDirectory/^.*/([^/]+)$/$1/} — $TM_DISPLAYNAME"
in the directory above the ones I was testing in.
Within those testing directories, TextMate takes up 100% CPU *for each tab I open*, until it uses all four of my cores (with four tabs). And commands don't work (possibly because of the high CPU usage, I guess). But when I move that .tm_properties file away, everything seems to go back to normal. If I put it back, the problem recurs.
I hope this helps pin down the issue.
Jon
On 13 February 2013 11:18, Jon Clayden jon.clayden@gmail.com wrote:
Thanks, Allan, for the response, but moving these two folders elsewhere (and then reinstalling the bundles I use, via TM prefs, but no customisations) does not solve the problem. I haven't made any recent changes to any bundle, and as I mentioned, downgrading was previously effective at solving the issue. I'm on Mountain Lion (10.8.2), if that's relevant.
Regards, Jon
On 13 February 2013 09:20, Allan Odgaard mailinglist@textmate.org wrote:
On Feb 12, 2013, at 12:17 PM, Jon Clayden jon.clayden@gmail.com wrote:
I have suddenly experienced wholesale failure of commands in
recent builds of TextMate 2 […]
[…]
I don't really know where to start with figuring this out, so some help would be appreciated!
You may have uninstalled the Bundle Support bundle or another central bundle.
To revert to defaults you can remove the ~/Library/Application Support/TextMate and ~/Library/Application Support/Avian folders (though this also removes potential customizations done to the bundles).
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate [1]
Links:
[1] http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Brandon wrote...
Your regexes are probably badly formed. Read more about what makes a regex
engine explode here: http://www.regular-**expressions.info/catastrophic.** html http://www.regular-expressions.info/catastrophic.html
The one that jumps out at me is:
windowTitle = "${projectDirectory/^.*/([^/]+**)$/$1/} — $TM_DISPLAYNAME"
I'm pretty sure that you want to escape the second slash that appears in there, as you want it to represent a literal slash, not a regex delimiter.
That is ...../([^/]+)..........
Cheers, Paul
You are right, of course, but the escapes were actually there in the version of the e-mail which I sent - it seems they have been stripped somewhere. So I don't think this is the problem, and having double-checked the versions of the regexes which are in the actual file, I'm fairly sure there is no syntax error in them.
In any case, this doesn't explain why the problem only occurs with recent TM builds. I don't see anything in the release notes about a change in the regex parsing engine.
Jon
On 14 February 2013 00:50, Paul McCann pmccann@gmail.com wrote:
Brandon wrote...
Your regexes are probably badly formed. Read more about what makes a
regex engine explode here: http://www.regular-** expressions.info/catastrophic.**htmlhttp://www.regular-expressions.info/catastrophic.html
The one that jumps out at me is:
windowTitle = "${projectDirectory/^.*/([^/]+**)$/$1/} —
$TM_DISPLAYNAME"
I'm pretty sure that you want to escape the second slash that appears in there, as you want it to represent a literal slash, not a regex delimiter.
That is ...../([^/]+)..........
Cheers, Paul
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Thanks for this link, bmf, very informative :D
-- :: dip --
On Wed, Feb 13, 2013 at 9:10 PM, bmf brandon@fryslie.com wrote:
Your regexes are probably badly formed. Read more about what makes a regex engine explode here: http://www.regular-expressions.info/catastrophic.html
On Feb 13, 2013, at 16:50, Jon Clayden jon.clayden@gmail.com wrote:
Just to follow up, it seems that this may be related to my .tm_properties file. I have
projectDirectory = "${TM_FILEPATH/(/Users/jon/Development/Git/[^/]+).*/$1/}"
Try instead to set it like this:
projectDirectory = "${TM_FILEPATH:?${TM_FILEPATH/(/Users/jon/Development/Git/[^/]+).*/$1/}:$projectDirectory}"
When there is no file path (untitled files) you were setting the project directory to an empty string, which would explain the CPU spike (though I’ll add some code to reject the user’s project directory value if it’s not a valid path).
As the bogus project directory you set is only for untitled files, I wouldn’t think it would limit command execution for when a file with a path is the active.
Allan,
Many thanks - that does fix the symptoms, but I remain puzzled about the original nature of the problem. For total clarity, if I put the old "projectDirectory" line back, then these are my steps to reproduce the problems:
(0. Close all windows in open TextMate, then quit.) 1. Open TextMate. An empty window appears. Close it. 2. File -> Open Recent -> "docs" (a subdirectory of "Git"). A window with an untitled tab appears, with " — untitled" as the window title. CPU usage goes up to 100% (and stays there). 3. Select a .tex file from the project window. Window title is now "docs — myfile.tex", as intended. CPU usage goes up to 200% (and stays there). So the problem seems to spread beyond untitled files. 4. Press ⌘R. Nothing happens.
With the modified .tm_properties, everything is fine. Is the problem with the .tm_properties file blocking the thread that would be used to run the command?
I was aware of the empty part of the window title for untitled files, but it never seemed to cause a problem before, and since I don't work with untitled files for long I wasn't bothered about fixing it from an aesthetic point of view. Either way, it seemed like a harmless thing (until now!).
All the best, Jon
On 15 February 2013 05:05, Allan Odgaard mailinglist@textmate.org wrote:
On Feb 13, 2013, at 16:50, Jon Clayden jon.clayden@gmail.com wrote:
Just to follow up, it seems that this may be related to my
.tm_properties file. I have
projectDirectory =
"${TM_FILEPATH/(/Users/jon/Development/Git/[^/]+).*/$1/}"
Try instead to set it like this:
projectDirectory =
"${TM_FILEPATH:?${TM_FILEPATH/(/Users/jon/Development/Git/[^/]+).*/$1/}:$projectDirectory}"
When there is no file path (untitled files) you were setting the project directory to an empty string, which would explain the CPU spike (though I’ll add some code to reject the user’s project directory value if it’s not a valid path).
As the bogus project directory you set is only for untitled files, I wouldn’t think it would limit command execution for when a file with a path is the active.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Feb 15, 2013, at 11:53 AM, Jon Clayden jon.clayden@gmail.com wrote:
Many thanks - that does fix the symptoms, but I remain puzzled about the original nature of the problem. For total clarity, if I put the old "projectDirectory" line back, then these are my steps to reproduce the problems:
The CPU load is because TM will traverse the file system from current file and up till it finds your project directory (to check for things like ‘.git’, ‘Makefile’, etc.)
When project directory is an empty string then TM will go into infinite loop since no ancestor of current file will ever match the empty string.
No idea about why commands fail to run, but the assumption in the code is that projectDirectory is a well-formed path, so it could probably be several things failing.
Right, OK. That still doesn't seem to fully explain why the CPU load goes up again when I open a file whose project path is correctly set, but I can imagine that there's some kind of domino effect occurring here. Clearly, getting "projectDirectory" right is more important than I had realised. Thanks for explaining.
All the best, Jon
On 15 February 2013 23:32, Allan Odgaard mailinglist@textmate.org wrote:
On Feb 15, 2013, at 11:53 AM, Jon Clayden jon.clayden@gmail.com wrote:
Many thanks - that does fix the symptoms, but I remain puzzled about the
original nature of the problem. For total clarity, if I put the old "projectDirectory" line back, then these are my steps to reproduce the problems:
The CPU load is because TM will traverse the file system from current file and up till it finds your project directory (to check for things like ‘.git’, ‘Makefile’, etc.)
When project directory is an empty string then TM will go into infinite loop since no ancestor of current file will ever match the empty string.
No idea about why commands fail to run, but the assumption in the code is that projectDirectory is a well-formed path, so it could probably be several things failing.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate