Bram Moolenaar, 11.03.2009:
> 
> Markus Heidelberg wrote:
> 
> > Conditions:
> > * diff mode
> > * visual selection (characterwise or blockwise) started on a line with
> >   DiffAdd, DiffChange or DiffText highlighting
> > * cursor column <= start column of the visual selection
> > * console Vim, GUI not in use (reproduced on Linux and Windows)
> >   -> character of the cursor should not be inverted (noinvcur=TRUE in
> >   the sources in win_line())
> > 
> > Now the "Normal" highlighting is used instead of DiffAdd, DiffChange or
> > DiffText from the first column of this line up until the cursor.
> > 
> > To reproduce:
> >     vim -u NONE -U NONE -d -c "normal 7j7lv" misc1.c misc2.c
> 
> Thanks for the reproducible example.
> 
> I don't think the fix is correct though, it uses line_attr for almost
> every position.

I thought this would be avoided by

            if (area_attr != 0)
            else if (search_attr != 0)
            else if (line_attr != 0 &&

Are the extra queries necessary at all? Isn't area_attr or search_attr
set anyway in these cases? From a quick test I can't notice a
difference with this:

-           else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL)
-                               || vcol < fromcol || vcol_prev < fromcol_prev
-                               || vcol >= tocol))
+           else if (line_attr != 0)



> The problem is that "fromcol" can be -1, in which case fromcol_prev is
> to be used.  So this patch should work:
> 
> !                                     || (vcol < fromcol || vcol >= tocol)))

> !                             || vcol < fromcol || vcol_prev < fromcol_prev
> !                             || vcol >= tocol))

Looks better, but now the line_attr is used for the cursor, this wasn't
the case before. I can now see the diff background color under the
cursor. Not sure, what the intention is. The background of hlsearch
(search_attr) for example could always be seen under the cursor.

Markus


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

Raspunde prin e-mail lui