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) There can be a gap in the Visual highlighted area, where the cursor goes. We should not use the area highlighting there. > > 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. We should not have Visual highlighting at the cursor position (under some conditions), but I think we can always have the area highlighting under the cursor. So I would think it's an improvement. Unless someone can describe a situation where this is a problem. -- 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/ \\\ \\\ 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 -~----------~----~----~----~------~----~------~--~---
