@@ -1868,16 +1868,17 @@ local show_signs = function(winid, sign_winids, bar_winid)
18681868 -- A set of columns, to prevent creating multiple signs in the same
18691869 -- location.
18701870 local total_width = 0 -- running sum of sign widths
1871+ local bar_row = bar_props ~= nil
1872+ and row >= bar_props .row
1873+ and row <= bar_props .row + bar_props .height - 1
18711874 -- Treat the bar as if it were a sign, and position subsequent signs
18721875 -- accordingly. This only applies if a scrollbar is shown (e.g., not when
18731876 -- it is hidden from hide_on_intersect or not shown because of an invalid
18741877 -- column).
1875- if bar_props ~= nil
1876- and row >= bar_props .row
1877- and row <= bar_props .row + bar_props .height - 1 then
1878+ if vim .g .scrollview_signs_scrollbar_overlap == ' off' and bar_row then
18781879 total_width = total_width + 1
18791880 end
1880- for _ , properties in ipairs (props_list ) do
1881+ for properties_idx , properties in ipairs (props_list ) do
18811882 local symbol = properties .symbol
18821883 local sign_width = fn .strdisplaywidth (symbol )
18831884 local col = base_col
@@ -1971,6 +1972,13 @@ local show_signs = function(winid, sign_winids, bar_winid)
19711972 if is_float then
19721973 zindex = zindex + config .zindex
19731974 end
1975+ if bar_row and properties_idx == 1 then
1976+ if vim .g .scrollview_signs_scrollbar_overlap == ' over' then
1977+ zindex = zindex + 1
1978+ elseif vim .g .scrollview_signs_scrollbar_overlap == ' under' then
1979+ zindex = zindex - 1
1980+ end
1981+ end
19741982 local sign_config = {
19751983 win = winid ,
19761984 relative = ' win' ,
@@ -1981,7 +1989,7 @@ local show_signs = function(winid, sign_winids, bar_winid)
19811989 width = sign_width ,
19821990 row = row - 1 ,
19831991 col = col - 1 ,
1984- zindex = zindex ,
1992+ zindex = math.max ( 1 , zindex ) ,
19851993 }
19861994 -- Create a new window if none are available for re-use. Also, create a
19871995 -- new window if the base window is a floating window, to avoid Neovim
@@ -2046,6 +2054,22 @@ local show_signs = function(winid, sign_winids, bar_winid)
20462054 target = ' FloatBorder'
20472055 end
20482056 end
2057+ -- Properly highlight a sign over a scrollbar.
2058+ if bar_props ~= nil
2059+ and bar_row
2060+ and vim .g .scrollview_signs_scrollbar_overlap == ' over'
2061+ and properties_idx == 1 then
2062+ target = ' ScrollView'
2063+ if vim .g .scrollview_hover
2064+ and mousemove_received
2065+ and to_bool (fn .exists (' &mousemoveevent' ))
2066+ and vim .o .mousemoveevent then
2067+ if is_mouse_over_scrollview_win (bar_props .scrollview_winid )
2068+ or is_mouse_over_scrollview_win (sign_winid ) then
2069+ target = ' ScrollViewHover'
2070+ end
2071+ end
2072+ end
20492073 target = get_mapped_highlight (winid , target )
20502074 local winhighlight = string.format (
20512075 ' Normal:%s,EndOfBuffer:%s,NormalFloat:%s' , target , target , target )
0 commit comments