Re:Vim Text Objects : The Definitive Guide
by thristian on Tuesday October 18, 2011 @05:40AM
(#3124559)
Since brackets come in matchable pairs and double quotes do not, and because brackets can be nested while double quotes cannot, it wouldn't surprise me if this were a deliberate difference. If the user hits "di(" on a line and there's no "(" before the cursor, you can search backwards over previous lines looking for an unmatched "(" without too much worry you'll get confused by a stray "(" and delete something the user didn't expect. If the user hits 'di"' on a line and there's no '"' before the cursor, searching any further is quite likely to hit a false positive and do something ridiculous (like deleting all the code between two string literals).
Re:Vim Text Objects : The Definitive Guide
by cdavoren on Tuesday October 18, 2011 @06:03AM
(#3124619)
That's a fair interpretation. I'd be more comfortable if this difference were reflected in the documentation - it could at least state that if no previous quote is found, the next quote on the line will be used.
Edit: Actually, the description for i" implies that its behaviour should be the same. Which one works correctly, I wonder?