Thursday, July 5, 2012

Re: Change inside quotes without being inside (bug?)

On 05/07/12 09:52, Martin Lundberg wrote:
> I read http://dailyvim.blogspot.se/2008/02/golf.html and in it they come to the conclusion that you don't have to be inside quotes when you do ci" because it jumps to the first quotes and changes it. However ci( does not. Some comments says it's probably a bug in the way ci" works but it hasn't been changed in vim so I'm just curious if someone in here knows if it is a bug or a feature?
>
> -Martin
>

With i( Vim knows that the ( has to be before the cursor and ) after it.
With i" there is no such criterion, especially in languages where line
breaks are legal inside a string. So Vim looks for the nearest (or, with
a count, nth-nearest) quote on either side of the cursor.

Like Tim said (or implied), t'ain't a bug, it's a feature.


Best regards,
Tony.
--
"You are old, father William," the young man said,
"And your hair has become very white;
And yet you incessantly stand on your head --
Do you think, at your age, it is right?"

"In my youth," father William replied to his son,
"I feared it might injure the brain;
But, now that I'm perfectly sure I have none,
Why, I do it again and again."
-- Lewis Carrol

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: