Vim7 snapshot 0079: Some highlights work differently than before

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Vim7 snapshot 0079: Some highlights work differently than before

A.J.Mechelynck
Bug or feature?

New in gvim 7.00aa snapshot 0079

*Search* highlight
"guifg" attribute for "Search" highlight is no more expressed. Example:
Search for a string in an HTML file. If the value is found within a
quoted string, it will be highlighted in magenta on yellow (fg for
htmlString which links to Constant; bg for Search).

How can I revert to the behaviour for snapshots 0078 and earlier (where
the above example would have shown black on yellow highlight)? Setting
explicitly ":hi Search guifg=Black" doesn't work.


*IncSearch* highlight
"IncSearch" highlight previously was white on black. Now the background
is whatever is the foreground colour of the highlight group valid at
that position. I'm not sure how the foreground colour is set. When
searching for a pattern which spans several syntax groups, the effect is
IMO disturbing (different parts of the incrementally matched pattern are
highlighted differently). Here also, how can I revert to the previous
behaviour (other than by downgrading)?


Best regards,
Tony.

Reply | Threaded
Open this post in threaded view
|

Re: Vim7 snapshot 0079: Some highlights work differently than before

Bram Moolenaar

Tony Mechelynck wrote:

> Bug or feature?
>
> New in gvim 7.00aa snapshot 0079
>
> *Search* highlight
> "guifg" attribute for "Search" highlight is no more expressed. Example:
> Search for a string in an HTML file. If the value is found within a
> quoted string, it will be highlighted in magenta on yellow (fg for
> htmlString which links to Constant; bg for Search).
>
> How can I revert to the behaviour for snapshots 0078 and earlier (where
> the above example would have shown black on yellow highlight)? Setting
> explicitly ":hi Search guifg=Black" doesn't work.

The guifg color should be used, if specified.  It's in the todo list.

> *IncSearch* highlight
> "IncSearch" highlight previously was white on black. Now the background
> is whatever is the foreground colour of the highlight group valid at
> that position. I'm not sure how the foreground colour is set. When
> searching for a pattern which spans several syntax groups, the effect is
> IMO disturbing (different parts of the incrementally matched pattern are
> highlighted differently). Here also, how can I revert to the previous
> behaviour (other than by downgrading)?

Same problem.

--
hundred-and-one symptoms of being an internet addict:
29. Your phone bill comes to your doorstep in a box.

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: Vim7 snapshot 0079: Some highlights work differently than before

Bram Moolenaar

I wrote:

> Tony Mechelynck wrote:
>
> > Bug or feature?
> >
> > New in gvim 7.00aa snapshot 0079
> >
> > *Search* highlight
> > "guifg" attribute for "Search" highlight is no more expressed. Example:
> > Search for a string in an HTML file. If the value is found within a
> > quoted string, it will be highlighted in magenta on yellow (fg for
> > htmlString which links to Constant; bg for Search).
> >
> > How can I revert to the behaviour for snapshots 0078 and earlier (where
> > the above example would have shown black on yellow highlight)? Setting
> > explicitly ":hi Search guifg=Black" doesn't work.
>
> The guifg color should be used, if specified.  It's in the todo list.

This patch appears to solve the reported problems with Search and Visual
highlighting:

*** screen.c~ Sat Jun  4 19:54:53 2005
--- screen.c Sun Jun  5 14:38:22 2005
***************
*** 3580,3586 ****
     if (area_attr == 0 && search_attr == 0)
  char_attr = syntax_attr;
     else
! char_attr = hl_combine_attr(char_attr, syntax_attr);
  }
 
  /* Check spelling (unless at the end of the line).
--- 3580,3586 ----
     if (area_attr == 0 && search_attr == 0)
  char_attr = syntax_attr;
     else
! char_attr = hl_combine_attr(syntax_attr, char_attr);
  }
 
  /* Check spelling (unless at the end of the line).


The Blue background for Visual highlighting often looks ugly in the GUI.
Try this patch:

--- syntax.c 4 Jun 2005 22:02:44 -0000 1.20
+++ syntax.c 5 Jun 2005 12:40:13 -0000
@@ -6028,7 +6028,7 @@
  "Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue",
  "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
  "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue",
- "Visual term=reverse ctermbg=Blue guibg=Blue",
+ "Visual term=reverse ctermbg=Blue guibg=Grey",
  "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue",
  "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta",
  "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan",
@@ -6053,7 +6053,7 @@
  "Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan",
  "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
  "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan",
- "Visual term=reverse ctermbg=Blue guibg=Blue",
+ "Visual term=reverse ctermbg=Blue guibg=Grey",
  "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue",
  "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta",
  "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan",

--
Give a man a computer program and you give him a headache,
but teach him to program computers and you give him the power
to create headaches for others for the rest of his life...
        R. B. Forest

 /// Bram Moolenaar -- [hidden email] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///
Reply | Threaded
Open this post in threaded view
|

Re: Vim7 snapshot 0079: Some highlights work differently than before

A.J.Mechelynck
Bram Moolenaar wrote:

> I wrote:
>
>
>>Tony Mechelynck wrote:
>>
>>
>>>Bug or feature?
>>>
>>>New in gvim 7.00aa snapshot 0079
>>>
>>>*Search* highlight
>>>"guifg" attribute for "Search" highlight is no more expressed. Example:
>>>Search for a string in an HTML file. If the value is found within a
>>>quoted string, it will be highlighted in magenta on yellow (fg for
>>>htmlString which links to Constant; bg for Search).
>>>
>>>How can I revert to the behaviour for snapshots 0078 and earlier (where
>>>the above example would have shown black on yellow highlight)? Setting
>>>explicitly ":hi Search guifg=Black" doesn't work.
>>
>>The guifg color should be used, if specified.  It's in the todo list.
>
>
> This patch appears to solve the reported problems with Search and Visual
> highlighting:
>

[...]

> The Blue background for Visual highlighting often looks ugly in the GUI.
> Try this patch:
>
[...]

gvim, snapshot 0079 without the patch:

Visual: blue bg, fg of underlying syntax group
        :hi Visual guibg=#CCCCCC
                changes bg to 80% grey
IncSearch bg = underlying fg; fg= I'm not sure
        :hi IncSearch guibg=black guifg=white
                gives bg=underlying fg; fg= I'm not sure
        :hi IncSearch gui=none guibg=black guifg=white
                gives bg=black; fg=underlying fg
Search bg=yellow, fg=underlying fg
        :hi Search guifg=black
                no change

With the patch:
Visual: grey bg, underlying fg (IMHO better) :)
IncSearch: bg=underlying fg, fg=underlying bg
        :hi IncSearch guibg=black guifg=white
                bg=white fg=black
        :hi IncSearch gui=none guibg=black guifg=white
                bg=black fg=white
Search: bg=yellow, fg=underlying fg
        :hi Search guifg=black
                bg=yellow fg=black

Summary: the patch seems to work -- except that for IncSearch,
"gui=reverse" set by ":hi clear" seems to be applied _after_ a later
explicit guibg= guifg= setting. Maybe that is intended. Workaround: use
gui=none before declaring the explicit higlight.

Within the next hour (or less) I'll package the just-compiled patched
binaries with the rest of the distribution and upload it.


Best regards,
Tony.