Merge branch 'master' of git://github.com/ebergama/HighlightWhitespaces into ebergama-master

Conflicts:
	highlight_whitespaces.py
	highlight_whitespaces.sublime-settings
This commit is contained in:
Kemal Hadimli 2013-08-27 12:00:04 +03:00
commit e9d8a6dd6e
2 changed files with 11 additions and 2 deletions

View File

@ -31,6 +31,7 @@ DEFAULT_COLOR_SCOPE_NAME = "invalid"
DEFAULT_IS_ENABLED = True
DEFAULT_CHECK_SPACES = True
DEFAULT_CHECK_TABS = True
DEFAULT_LAST_WHITESPACE = False
#Set whether the plugin is on or off
hws_settings = sublime.load_settings('highlight_whitespaces.sublime-settings')
@ -43,7 +44,12 @@ def is_find_results(view):
# Return an array of regions matching whitespaces.
def find_whitespaces_spaces(view):
return view.find_all(' {2,}')
last_whitespace = bool(hws_settings.get('highlight_last_whitespace',DEFAULT_LAST_WHITESPACE))
regex = ' {2,}'
if last_whitespace:
regex += '| {1,}$'
return view.find_all(regex)
def find_whitespaces_tabs(view):
return view.find_all('\t+')

View File

@ -15,5 +15,8 @@
"highlight_whitespaces_check_spaces": true,
// Whether to check for tabs
"highlight_whitespaces_check_tabs": true
"highlight_whitespaces_check_tabs": true,
// Allow the highlighting of the last whitespace, one or more time
"highlight_last_whitespace": true
}