Tom wrote:

> > > > xxxxxxxxxxFxxxxxxxxxxxxxxxExx
> > > > yyyyyyyyyyD
> > > > zzzzzzzzzzzzzzzzzzzzzzzzzzCzzzzz
> 
> > The problem is caused by setting the 'lazyredraw' option, it causes the
> > cursor column to be computed.
> 
> This leads to a related question. Given the cursor is at position D,
> is there a way to determine that the "target column" is 27 and not 11?
> I.e. is there a way to temporarily move the cursor someplace else and
> to return to position D without breaking cursor movement?
> 
> I often use something like this
> 
> let p = getpos('.')
> ...
> call setpos('.', p)
> 
> If the cursor is at position D, this will set the column to 11 and the
> cursor will move to position F when pressing k. Is there a way to make
> it move to position E?

You can use winsaveview() and winrestview().

-- 
hundred-and-one symptoms of being an internet addict:
140. You'd rather catch a score on the web than watch the game as
     it is being played on tv.

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