Added support for in/excluding empty lines from being matched as trailing whitespace
This commit is contained in:
parent
a790a620e5
commit
c355e75eca
|
@ -32,7 +32,9 @@ trailing_spaces_enabled = bool(ts_settings.get('trailing_spaces_enabled',
|
||||||
|
|
||||||
# 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):
|
||||||
return view.find_all('[ \t]+$')
|
include_empty_lines = bool(ts_settings.get('trailing_spaces_include_empty_lines',
|
||||||
|
DEFAULT_IS_ENABLED))
|
||||||
|
return view.find_all('[ \t]+$' if include_empty_lines else '(?<=\S)[\t ]+$')
|
||||||
|
|
||||||
|
|
||||||
# Highlight trailing spaces
|
# Highlight trailing spaces
|
||||||
|
|
|
@ -6,5 +6,8 @@
|
||||||
"trailing_spaces_file_max_size" : 1048576,
|
"trailing_spaces_file_max_size" : 1048576,
|
||||||
|
|
||||||
// By default plugin is enabled or disabled (true|false)
|
// By default plugin is enabled or disabled (true|false)
|
||||||
"trailing_spaces_enabled" : true
|
"trailing_spaces_enabled" : true,
|
||||||
|
|
||||||
|
// By default empty lines are cleared
|
||||||
|
"trailing_spaces_include_empty_lines" : true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user