diff options
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/strip_trailing_whitespace.vim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugin/strip_trailing_whitespace.vim b/plugin/strip_trailing_whitespace.vim index 5fde8e3..f02f7a0 100644 --- a/plugin/strip_trailing_whitespace.vim +++ b/plugin/strip_trailing_whitespace.vim @@ -55,7 +55,7 @@ endfunction function s:StripHorizontal(start, end) abort " Start a count of lines trimmed - let count = 0 + let stripped = 0 " Iterate through buffer let num = a:start @@ -65,7 +65,7 @@ function s:StripHorizontal(start, end) abort let line = getline(num) if line =~# '\s\+$' call setline(num, substitute(line, '\s*$', '', '')) - let count = count + 1 + let stripped = stripped + 1 endif " Bump for next iteration @@ -74,7 +74,7 @@ function s:StripHorizontal(start, end) abort endwhile " Return the number of lines trimmed - return count + return stripped endfunction @@ -103,14 +103,14 @@ function s:StripVertical() abort " Get the number of lines to delete; if there are any, build a range and " remove them with :delete, suppressing its normal output (we'll do it) - let count = line('$') - eof - if count + let stripped = line('$') - eof + if stripped let range = (eof + 1).',$' silent execute range.'delete' endif " Return the number of lines deleted - return count + return stripped endfunction |