Christian Brabandt wrote:

> On Mo, 06 Mär 2017, Vitor Antunes wrote:
> 
> > Well, at least the original issue would be fixed. When do you think
> > you will have your change merged?
> 
> I am attaching an updated patch including some tests. Don't know when 
> Bram comes to including this.

Thanks for looking into this.


>  /*
> + * Return the number of whitespace bytes in front of a given line
> + */
> +    int
> +get_whitespace_line_start(linenr_T lnum)
> +{
> +    char_u *l1, *l2;
> +
> +    l1 = l2 = ml_get(lnum);
> +    while (vim_iswhite(*l2))
> +     ++l2;

This can use skipwhite().  There are several other places where this
computation is done, e.g. in misc1.c, open_line():

        p = ml_get_curline();
        ai_col = (colnr_T)(skipwhite(p) - p);

Similar one a bit further down.

Would be good to put this function close to skipwhite() to make it
easeri to find.

> +    /* if indent kicked in, the firstline might have changed
> +     * but only do that, if the indent actually increased */
> +    ind_post = get_whitespace_line_start(curwin->w_cursor.lnum);
> +    if (curbuf->b_op_start.col > ind_pre && ind_post > ind_pre)
> +    {
> +     bd.textcol += ind_post - ind_pre;
> +     bd.start_vcol += ind_post - ind_pre;
> +    }

Why only for when the indent increases?


-- 
>From "know your smileys":
 :'-D   Laughing so much that they're crying

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui