diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-12 23:48:57 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-05-12 23:48:57 +1200 |
commit | 28a22be4942c8af5fec969b2f4cf2edae331fe44 (patch) | |
tree | fb644b971ecce99d0405d1524da420a3561ae6f9 | |
parent | Merge branch 'release/v2.1.0' (diff) | |
parent | Bump VERSION (diff) | |
download | vim-strip-trailing-whitespace-28a22be4942c8af5fec969b2f4cf2edae331fe44.tar.gz vim-strip-trailing-whitespace-28a22be4942c8af5fec969b2f4cf2edae331fe44.zip |
Merge branch 'hotfix/v2.1.1'v2.1.1
* hotfix/v2.1.1:
Bump VERSION
Use less worrisome name for a variable
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | plugin/strip_trailing_whitespace.vim | 12 |
2 files changed, 7 insertions, 7 deletions
@@ -1 +1 @@ -2.1.0 +2.1.1 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 |