Matchit plugin modifying virtualedit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Matchit plugin modifying virtualedit

David Fishburn-2
:ver
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 24 2017 13:37:57)
MS-Windows 32-bit GUI version with OLE support
Included patches: 1-233

I have realized virtualedit keeps getting set on me, so I ran:

:verbose set virtualedit?
  virtualedit=all
        Last set from c:\vim\vim80\pack\dist\opt\matchit\plugin\matchit.vim

Briefly looking it, there are many calls to:

  function! s:Match_wrapper(word, forward, mode) range
    " In s:CleanUp(), :execute "set" restore_options .
    let restore_options = (&ic ? " " : " no") . "ignorecase"
    if exists("b:match_ignorecase")
      let &ignorecase = b:match_ignorecase
    endif
    let restore_options = " ve=" . &ve . restore_options
    set ve=
    ...
    return s:CleanUp(restore_options, a:mode, startline, startcol, mid.'\|'.fin)
    ...

So, it looks this shouldn't be happening.
Is anyone else running into this?

I triggered it by simply hitting % on a { in a Java file.

Thanks,
David



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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Matchit plugin modifying virtualedit

Bram Moolenaar

David Fishburn wrote:

> :ver
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 24 2017 13:37:57)
> MS-Windows 32-bit GUI version with OLE support
> Included patches: 1-233
>
> I have realized virtualedit keeps getting set on me, so I ran:
>
> :verbose set virtualedit?
>   virtualedit=all
>         Last set from c:\vim\vim80\pack\dist\opt\matchit\plugin\matchit.vim
>
> Briefly looking it, there are many calls to:
>
>   function! s:Match_wrapper(word, forward, mode) range
>     " In s:CleanUp(), :execute "set" restore_options .
>     let restore_options = (&ic ? " " : " no") . "ignorecase"
>     if exists("b:match_ignorecase")
>       let &ignorecase = b:match_ignorecase
>     endif
>     let restore_options = " ve=" . &ve . restore_options
>     set ve=
>     ...
>     return s:CleanUp(restore_options, a:mode, startline, startcol,
> mid.'\|'.fin)
>     ...
>
> So, it looks this shouldn't be happening.
> Is anyone else running into this?
>
> I triggered it by simply hitting % on a { in a Java file.

It's very possible that it's set somewhere else.  The problem is that
the matchit plugin always sets it empty, also when it already was empty.

          let restore_options = " ve=" . &ve . restore_options
          set ve=

This should be change to:

        if &ve != ''
          let restore_options = " ve=" . &ve . restore_options
          set ve=
        endif

Should also happen for 'ignorecase'.

--
hundred-and-one symptoms of being an internet addict:
169. You hire a housekeeper for your home page.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Matchit plugin modifying virtualedit

David Fishburn-2
...
> I triggered it by simply hitting % on a { in a Java file.

It's very possible that it's set somewhere else.  The problem is that
the matchit plugin always sets it empty, also when it already was empty.

          let restore_options = " ve=" . &ve . restore_options
          set ve=

This should be change to:

        if &ve != ''
          let restore_options = " ve=" . &ve . restore_options
          set ve=
        endif

Should also happen for 'ignorecase'.


I tested the "if &ve !=" change and that does appear to solve my issue.

Thanks,
David


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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Matchit plugin modifying virtualedit

Bram Moolenaar

David Fishburn wrote:

> > ...
> > > I triggered it by simply hitting % on a { in a Java file.
> >
> > It's very possible that it's set somewhere else.  The problem is that
> > the matchit plugin always sets it empty, also when it already was empty.
> >
> >           let restore_options = " ve=" . &ve . restore_options
> >           set ve=
> >
> > This should be change to:
> >
> >         if &ve != ''
> >           let restore_options = " ve=" . &ve . restore_options
> >           set ve=
> >         endif
> >
> > Should also happen for 'ignorecase'.
> >
> >
> I tested the "if &ve !=" change and that does appear to solve my issue.

It also didn't change where it's set from?  Then it must have had a
value when the plugin was loaded.

--
hundred-and-one symptoms of being an internet addict:
177. You log off of your system because it's time to go to work.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Matchit plugin modifying virtualedit

Benji Fisher-3
David, Bram:

     Thanks for the bug report and the fix.  Please try the attached version.  (This list accepts attachments, doesn't it ...)

-- 
Benji

On Tue, Mar 21, 2017 at 11:30 AM, Bram Moolenaar <[hidden email]> wrote:

David Fishburn wrote:

> > ...
> > > I triggered it by simply hitting % on a { in a Java file.
> >
> > It's very possible that it's set somewhere else.  The problem is that
> > the matchit plugin always sets it empty, also when it already was empty.
> >
> >           let restore_options = " ve=" . &ve . restore_options
> >           set ve=
> >
> > This should be change to:
> >
> >         if &ve != ''
> >           let restore_options = " ve=" . &ve . restore_options
> >           set ve=
> >         endif
> >
> > Should also happen for 'ignorecase'.
> >
> >
> I tested the "if &ve !=" change and that does appear to solve my issue.

It also didn't change where it's set from?  Then it must have had a
value when the plugin was loaded.

--
hundred-and-one symptoms of being an internet addict:
177. You log off of your system because it's time to go to work.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

matchit.vim (41K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Matchit plugin modifying virtualedit

Christian Brabandt
Hi Benji!

On So, 26 Mär 2017, Benji Fisher wrote:

>      Thanks for the bug report and the fix.  Please try the attached version.  
> (This list accepts attachments, doesn't it ...)

Thanks for that. Would you mind looking at those issues as well:

https://github.com/vim/vim/pull/955
https://github.com/neovim/neovim/issues/5691
(caused by hard-coding the 'v' as I have said here:
https://github.com/neovim/neovim/issues/5691#issuecomment-263922644)

Best,
Christian
--
Die Lebensqualität steigt, wo die Beine etwas mehr und die Ellenbogen
etwas weniger gebraucht werden.
                -- Erhard Eppler

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Matchit plugin modifying virtualedit

Bram Moolenaar
In reply to this post by Benji Fisher-3

Benji Fisher wrote:

> David, Bram:
>
>      Thanks for the bug report and the fix.  Please try the attached
> version.  (This list accepts attachments, doesn't it ...)

Looks good to me, thanks.

--
How do I set the laser printer to stun?

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.