File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -85,8 +85,6 @@ def is_find_results(view):
8585# Returns both the list of regions which map to trailing spaces and the list of
8686# regions which are to be highlighted, as a list [matched, highlightable].
8787def find_trailing_spaces (view ):
88- sel = view .sel ()[0 ]
89- line = view .line (sel .b )
9088 include_empty_lines = bool (ts_settings .get ("trailing_spaces_include_empty_lines" ,
9189 DEFAULT_IS_ENABLED ))
9290 include_current_line = bool (ts_settings .get ("trailing_spaces_include_current_line" ,
@@ -96,7 +94,10 @@ def find_trailing_spaces(view):
9694
9795 offending_lines = view .find_all (regexp if include_empty_lines else no_empty_lines_regexp )
9896
99- if include_current_line :
97+ sel = view .sel ()
98+ line = len (sel ) and view .line (sel [0 ].b )
99+
100+ if include_current_line or not line :
100101 return [offending_lines , offending_lines ]
101102 else :
102103 current_offender = view .find (regexp if include_empty_lines else no_empty_lines_regexp , line .a )
You can’t perform that action at this time.
0 commit comments