On 2015-01-20, Gary Johnson wrote:
> I've been using Hari Krishna Dara's tagselect.vim plugin, which uses
> his genutils.vim library plugin, for some time.  I use it several
> times a week.  Since upgrading to Vim 7.4.580, I've started getting
> this error from the Tjump command:
> 
>     Error detected while processing function 
> <SNR>31_SelectTagUnderCursor..<SNR>31_SelectTagCount..<SNR>31_SelectTag..CloseWindow..RestoreActiveWindow:
>     line   10:
>     E16: Invalid range: 2 wincmd w
> 
> I don't understand the plugin well enough to explain exactly what
> it's doing, but it appears to be trying to re-open a hidden,
> unlisted buffer.  Here is the result of executing ":ls!" when the
> error appears.
> 
> :ls!
>   1 %a   "gui_gtk.c"                    line 269
>   2u a   "[Tag Select]"                 line 1
>   3u  -  "repeat.txt"                   line 417
> 
> Since this used to work and doesn't work now, it looks to me like a
> bug.
> 
> If this isn't sufficient information to find the cause of and fix
> this bug, I can work on finding a small set of commands that
> reproduce it without needing the plugins.
> 
> To reproduce this error on Linux, you can cd to Vim's src directory,
> execute "ctags -R", then run vim and execute ":Tjump ADD_ICON", then
> select the first tag in the list.  I chose ADD_ICON arbitrarily as
> the first tag I saw in the tags file with two entries.  I don't
> think it matters which tag you select; the first one is easy because
> you just hit <Enter>.  Of course you'll need the tagselect.vim and
> genutils.vim plugins.

I believe I've found the problem and a solution.

The error is generated at this command,

    exec s:prevWinnr'wincmd w'

at line 10 of the RestoreActiveWindow() function in the genutils.vim
plugin whenever the function attempts to move the cursor to a window
that no longer exists.  Until recently, that command failed
silently.  That failure did not matter to the tagselect.vim plugin.

Patch 7.4.565 fixed the problem of the :wincmd command not reporting
out-of-range window numbers.  Since that patch, attempting ":wincmd
w" to a non-existent window generates an E16 error message.

Since the error used to be ignored without any adverse effects, the
solution I used is to continue to ignore the error by prefixing that
command with :silent!:

    silent! exec s:prevWinnr'wincmd w'

Regards,
Gary

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui