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):
85
85
# Returns both the list of regions which map to trailing spaces and the list of
86
86
# regions which are to be highlighted, as a list [matched, highlightable].
87
87
def find_trailing_spaces (view ):
88
- sel = view .sel ()[0 ]
89
- line = view .line (sel .b )
90
88
include_empty_lines = bool (ts_settings .get ("trailing_spaces_include_empty_lines" ,
91
89
DEFAULT_IS_ENABLED ))
92
90
include_current_line = bool (ts_settings .get ("trailing_spaces_include_current_line" ,
@@ -96,7 +94,10 @@ def find_trailing_spaces(view):
96
94
97
95
offending_lines = view .find_all (regexp if include_empty_lines else no_empty_lines_regexp )
98
96
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 :
100
101
return [offending_lines , offending_lines ]
101
102
else :
102
103
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