Friday, December 28, 2012

Re: textobj-lastpat plugin: text object not capturing last character of the match?

On Friday, December 28, 2012 2:06:56 PM UTC-6, zpkarol wrote:
> Hi guys, does anyone use textobj-lastpat plugin?
>
>
>
> http://www.vim.org/scripts/script.php?script_id=2355
>
>
>
> I tried it and it seems to have a bug: the text object omits the last
>
> character in a match.
>
> For example, if I start with the following text
>
>
>
> foo bar baz
>
>
>
> Then I do
>
>
>
> /bar<CR>
>
>
>
> The word "bar" is highlighted and the cursor is at first "b" character (as
>
> expected), but when I try, say
>
>
>
> da/
>
>
>
> I end up with this
>
>
>
> foo r baz
>
>
>
> I would expect the following result:
>
>
>
> foo baz
>
>
>
> Is this behavior correct? And if so, how can I achieve what I want, i.e.
>
> have a text object that encompasses the whole match?
>
>
>
> Thx for help!
>

Is your 'selection' option set to 'exclusive'? (This is the default if you have "behave mswin" in your .vimrc). This option causes problems in a *lot* of plugins. Try setting 'selection' to "inclusive". If the problem goes away, alert the plugin maintainer.

--
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: