Merge pull request #17 from tleruitte/master
Don't show trailing whitespaces in find results views.
This commit is contained in:
commit
e2a5c3a49e
|
@ -29,6 +29,9 @@ ts_settings = sublime.load_settings('trailing_spaces.sublime-settings')
|
||||||
trailing_spaces_enabled = bool(ts_settings.get('trailing_spaces_enabled',
|
trailing_spaces_enabled = bool(ts_settings.get('trailing_spaces_enabled',
|
||||||
DEFAULT_IS_ENABLED))
|
DEFAULT_IS_ENABLED))
|
||||||
|
|
||||||
|
# Determine if the view is a find results view
|
||||||
|
def is_find_results(view):
|
||||||
|
return "Find Results" in view.settings().get('syntax')
|
||||||
|
|
||||||
# Return an array of regions matching trailing spaces.
|
# Return an array of regions matching trailing spaces.
|
||||||
def find_trailing_spaces(view):
|
def find_trailing_spaces(view):
|
||||||
|
@ -41,7 +44,7 @@ def highlight_trailing_spaces(view):
|
||||||
DEFAULT_MAX_FILE_SIZE)
|
DEFAULT_MAX_FILE_SIZE)
|
||||||
color_scope_name = ts_settings.get('trailing_spaces_highlight_color',
|
color_scope_name = ts_settings.get('trailing_spaces_highlight_color',
|
||||||
DEFAULT_COLOR_SCOPE_NAME)
|
DEFAULT_COLOR_SCOPE_NAME)
|
||||||
if view.size() <= max_size:
|
if view.size() <= max_size and not is_find_results(view):
|
||||||
regions = find_trailing_spaces(view)
|
regions = find_trailing_spaces(view)
|
||||||
view.add_regions('TrailingSpacesHighlightListener',
|
view.add_regions('TrailingSpacesHighlightListener',
|
||||||
regions, color_scope_name,
|
regions, color_scope_name,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user