Marko Mahnic wrote:

> Error: E315, keepjumps, scrolloff
> 
> " To Reproduce:
> " Add this file to plugins; start Vim.
> " Open file A (eg. 100) lines and B (eg. 200) lines
> " Do G on both files
> " When switching from B to A (longer to shorter) the message
> " It's a bug ... should appear (in :messages)
> "
> " The error caught is E315 on the line 'let toppos=line('.')
> "
> " The (funny) solution is:
> "   let &scrolloff=&scrolloff
> " (see the code below)
> 
> set scrolloff=3
> function! ScrollOffBug()
>    echom "ScrollOffBug?"
>    " Solution:
>    " let &scrolloff=&scrolloff
>    try
>       let pos = line('.')
>       " error happens next:
>       keepjumps norm! H
>       let toppos = line('.')
>     catch /.*/
>        echom "It's a bug b=" . bufnr('%') . ", so=" . &scrolloff
>     endtry
> endfunc
> 
> au BufEnter * call ScrollOffBug()

I can't reproduce it with the current Vim version.  What Vim version are
you using?

-- 
hundred-and-one symptoms of being an internet addict:
261. You find diskettes in your pockets when doing laundry.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui