Skip to content

Commit

Permalink
Fix: Use "outline" again as fallback in ST3
Browse files Browse the repository at this point in the history
Well, #1741 is basically wrong on every line, don't use drugs and then
code.

- The Sublime change has been introduced with v4074 so it's `>=`
- The conditional must be flipped
  • Loading branch information
kaste committed Jun 10, 2020
1 parent 14e6379 commit b2951b2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions highlight_view.py
Expand Up @@ -68,9 +68,9 @@
WS_ONLY = re.compile(r'^\s+$')
MULTILINES = re.compile('\n')

# Sublime > 4074 supports underline styles on white space
# Sublime >= 4074 supports underline styles on white space
# https://github.com/sublimehq/sublime_text/issues/137
SUBLIME_SUPPORTS_WS_SQUIGGLES = int(sublime.version()) > 4074
SUBLIME_SUPPORTS_WS_SQUIGGLES = int(sublime.version()) >= 4074

State = {
'active_view': None,
Expand Down Expand Up @@ -298,11 +298,9 @@ def _compute_flags(error):
mark_style = style.get_value('mark_style', error, 'none')
selected_text = error['offending_text']
if SUBLIME_SUPPORTS_WS_SQUIGGLES:
# Work around Sublime bug, which cannot draw 'underlines' on spaces
regex = SOME_WS
else:
# In newer Sublime versions, we still prefer outlines over multi-line errors
regex = MULTILINES
else:
regex = SOME_WS
if mark_style in UNDERLINE_STYLES and regex.search(selected_text):
mark_style = FALLBACK_MARK_STYLE

Expand Down

0 comments on commit b2951b2

Please sign in to comment.