aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:14:49 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-23 14:14:49 +1200
commitc0b376f4b38cd748652f388f7a86c7a37be358ac (patch)
tree544f299ed1621ad5c9623a14fd1f846d058d112a
parent6cd99a9510897e87fba76721b3c9d148c51a1649 (diff)
parentcf08372cb2a610628704876f5c82d41092152495 (diff)
downloadvim-squeeze-repeat-blanks-c0b376f4b38cd748652f388f7a86c7a37be358ac.tar.gz
vim-squeeze-repeat-blanks-c0b376f4b38cd748652f388f7a86c7a37be358ac.zip
Merge branch 'release/v0.3.0'v0.3.0
* release/v0.3.0: Restore cursor position after run
-rw-r--r--VERSION2
-rw-r--r--autoload/squeeze_repeat_blanks.vim6
2 files changed, 7 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index 0ea3a94..0d91a54 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.2.0
+0.3.0
diff --git a/autoload/squeeze_repeat_blanks.vim b/autoload/squeeze_repeat_blanks.vim
index 1b760b4..9776643 100644
--- a/autoload/squeeze_repeat_blanks.vim
+++ b/autoload/squeeze_repeat_blanks.vim
@@ -2,6 +2,9 @@
" group, deleting the others.
function! squeeze_repeat_blanks#Squeeze(start, end) abort
+ " Save cursor position
+ let pos = getpos('.')
+
" List of line numbers to delete
let deletions = []
@@ -36,6 +39,9 @@ function! squeeze_repeat_blanks#Squeeze(start, end) abort
silent execute num . 'delete'
endfor
+ " Restore cursor position
+ call setpos('.', pos)
+
" Report how many lines were deleted
echomsg len(deletions) . ' deleted'