Merge pull request #16 from bentruyman/master

Added support for in/excluding empty lines from being matched as trailing whitespace.
This commit is contained in:
Jean-Denis Vauguet 2012-06-18 03:14:40 -07:00
commit d25170415d
2 changed files with 9 additions and 4 deletions

View File

@ -35,7 +35,9 @@ def is_find_results(view):
# Return an array of regions matching trailing spaces.
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

View File

@ -1,10 +1,13 @@
{
// Color is determined by scope
"trailing_spaces_highlight_color" : "invalid",
"trailing_spaces_highlight_color" : "invalid",
// Max file size to search
"trailing_spaces_file_max_size" : 1048576,
"trailing_spaces_file_max_size" : 1048576,
// 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
}