remove visual grouping
import html
import os
import sublime
-import sublime_plugin
-import copy
-
-from ..lint.const import PLUGIN_NAME, WARN_ERR, WARNING, ERROR
+from ..lint.const import WARN_ERR
from ..lint import util, persist
-from difflib import SequenceMatcher
PANEL_NAME = "sublime_linter_panel"
@@ -26,39 +22,6 @@ OUTPUT_PANEL_SETTINGS = {
"word_wrap": False
}
-STEALTH_KEY = "panel_stealth"
-STEALTH_SCOPE = """ invisible scope: output.lsp.diagnostics meta.diagnostic.body.lsp markup.changed.lsp sublimelinter.mark.warning markup.warning.lsp """
-# current compare cut-off should be at 52 chars
-
-
-def visual_grouping(view, lines):
- """Applies invisibility scope to region to those lines overlapping with content from the previous one. Anchored to the start.
- Minimal length ensures line number and columns are not minced. Errors are always displayed."""
-
- regions = []
- cut_off = 45
- min_len = 8
-
- for i, line in enumerate(lines):
- if i == 0:
- continue
- prev = lines[i - 1]
-
- min_line_len = min(len(prev), len(line))
- cut_off = min_line_len if min_line_len < cut_off else cut_off
-
- s = SequenceMatcher(lambda x: x == ERROR, prev, line)
-
- match = s.find_longest_match(0, cut_off, 0, cut_off)
-
- if match.a == 0 and match.size >= min_len:
- start = view.text_point(i, 0)
- end = view.text_point(i, match.size)
- region = sublime.Region(start, end)
- regions.append(region)
-
- view.add_regions(STEALTH_KEY, regions, STEALTH_SCOPE)
-
def dedupe_views(errors):
if len(errors) == 1:
@@ -202,8 +165,6 @@ def fill_panel(window, types=None, codes=None, linter=None, update=False):
to_render.append("\n") # empty lines between views
- panel.erase_regions(STEALTH_KEY)
panel.run_command("sublime_linter_panel_update", {
"characters": "\n".join(to_render)})
panel.set_read_only(True)
- visual_grouping(panel, to_render)
