Show tooltip only over visible highlights
@@ -497,6 +497,18 @@ class TooltipController(sublime_plugin.EventListener):
if (
persist.settings.get('show_hover_region_report') and
view.id() not in State['quiet_views']
+ ):
+ idle = view.id() in State['idle_views']
+ if any(
+ region.contains(point)
+ for key in get_regions_keys(view)
+ if (
+ '.Highlights.' in key and
+ # Select visible highlights; when `idle` all regions
+ # are visible, otherwise all *not* demoted regions.
+ (idle or DEMOTE_WHILE_BUSY_MARKER not in key)
+ )
+ for region in view.get_regions(key)
):
open_tooltip(view, point)
