I can't figure this out...
Here's some text:
(this is a parenthesis in quotes "(")
If I put the caret before or after the final quotation and choose Select>Enclosing Brackets, TextMate selects the second opening parenthesis and the closing parenthesis. Also, no text is selected with the caret anywhere else.
How can I teach TextMate that parentheses between quotation marks shouldn't be considered for a match? I want something like "Ignore parentheses that are in strings" but i can't see how to do that...
Thanks
cormullion@mac.com wrote:
I can't figure this out...
Here's some text:
(this is a parenthesis in quotes "(")
If I put the caret before or after the final quotation and choose Select>Enclosing Brackets, TextMate selects the second opening parenthesis and the closing parenthesis. Also, no text is selected with the caret anywhere else.
How can I teach TextMate that parentheses between quotation marks shouldn't be considered for a match? I want something like "Ignore parentheses that are in strings" but i can't see how to do that...
As far as I know, the select enclosing brackets command doesn't know anything about scopes. So you can't really do what you want I don't think.
Incidentally, as a lisper, you should take a look at the extend current parens command in the Experimental bundle. It does some neat stuff.
-Jacob
On 2006-08-09, at 01:21, Jacob Rus wrote:
cormullion@mac.com wrote:
I can't figure this out... Here's some text: (this is a parenthesis in quotes "(") If I put the caret before or after the final quotation and choose Select>Enclosing Brackets, TextMate selects the second opening parenthesis and the closing parenthesis. Also, no text is selected with the caret anywhere else. How can I teach TextMate that parentheses between quotation marks shouldn't be considered for a match? I want something like "Ignore parentheses that are in strings" but i can't see how to do that...
As far as I know, the select enclosing brackets command doesn't know anything about scopes. So you can't really do what you want I don't think.
That's a surprise. I'll have problems if TextMate can't handle this situation. Presumably this would show the same behaviour in another language:
{ s = "Insert a brace: {" }
Incidentally, as a lisper, you should take a look at the extend current parens command in the Experimental bundle. It does some neat stuff.
Thanks, I'll take a look.
On 9/8/2006, at 8:55, cormullion@mac.com wrote:
Here's some text: (this is a parenthesis in quotes "(") If I put the caret before or after the final quotation and choose Select>Enclosing Brackets, TextMate selects the second opening parenthesis and the closing parenthesis [...] That's a surprise. I'll have problems if TextMate can't handle this situation. Presumably this would show the same behaviour in another language:
Yes, the problem can be found in many situations, however, handling it properly requires AI for many cases. E.g. you often put ( in a regexp, 1) in prose, etc.
It can’t just skip strings (and comments) as these might include structured text themselves for which the user need the functionality -- but I do ponder about making it more scope based.