Christian Brabandt wrote:

> Hi Martin!
> 
> On Di, 09 Feb 2016, Martin Kunev wrote:
> 
> > I'm using vim 7.4.1229 on Gentoo.
> > 
> > In input mode, navigating near braces changes cursor position
> > unexpectedly.
> > 
> > I enter the following code in a new file:
> > 
> > if (a) { }
> > 
> > In input mode, navigating up from column 2 on the last line moves the
> > cursor to column 1 on the previous line (before the curly brace).
> > 
> > Commenting the lines related to getcurpos() in matchparen.vim fixes
> > the problem.
> 
> Can you check, if this patch fixes it?
> 
> diff --git a/src/eval.c b/src/eval.c
> --- a/src/eval.c
> +++ b/src/eval.c
> @@ -12449,8 +12449,11 @@ getpos_both(
>  #endif
>                                                               (varnumber_T)0);
>         if (getcurpos)
> +       {
> +           update_curswant();
>             list_append_number(l, curwin->w_curswant == MAXCOL ?
>                     (varnumber_T)MAXCOL : (varnumber_T)curwin->w_curswant + 
> 1);
> +       }
>      }
>      else
>         rettv->vval.v_number = FALSE;

Only noticed this after sending out my fix.  We could do both of them.

I was trying to write a test for the fix, but autocommands are not
triggered when there is typeahead.  We probably need some kind of
special support for tests to pretend there is no typeahead.  Perhaps
inserting some special character, e.g. "\<Wait>".  Would work a bit like
<Nop> but make char_avail() return false.

-- 
hundred-and-one symptoms of being an internet addict:
202. You're amazed to find out Spam is a food.

 /// Bram Moolenaar -- [email protected] -- 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_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