aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-30 20:33:22 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-30 20:40:25 +1300
commit8513d16d685369a3b2f3eaa7f4babfd070b94670 (patch)
treea037d9ff31dff0226121ee4c1847cc8c38536001 /bin
parentAdd some comments to Vim StripTrailingWhitespace() (diff)
downloaddotfiles-8513d16d685369a3b2f3eaa7f4babfd070b94670.tar.gz
dotfiles-8513d16d685369a3b2f3eaa7f4babfd070b94670.zip
Add line deletion to StripTrailingWhitespace()
In addition to its existing functionality of removing trailing spaces from the ends of lines, this change has the function remove lines at the end of the file afterwards if they contain no non-whitespace characters, based on its observations during the line iteration. This uses the older VimL functions line() and col() in preference to the newer winsaveview() and winrestview() to restore the cursor position after the range :delete moves it, so that this will hopefully work even on older versions of Vim; that is not yet tested. I am surprised that there is no line deletion function to match e.g. getline(), setline(), but it does seem to be the case: <https://groups.google.com/d/msg/vim_use/TY9NmJXh8EU/iFjOUg68AekJ>
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions