aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-11 16:52:34 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-11 16:52:34 +1200
commit6ffc76012ca5716c272c54c6dce8d783d21cc144 (patch)
tree7da8c7a0fdf6c801b40bcf5329b0ee0000e5687e
parentMerge branch 'release/v0.3.0' (diff)
parentBump VERSION (diff)
downloadvim-keep-position-6ffc76012ca5716c272c54c6dce8d783d21cc144.tar.gz
vim-keep-position-6ffc76012ca5716c272c54c6dce8d783d21cc144.zip
Merge branch 'release/v0.4.0'HEADv0.4.0master
* release/v0.4.0: Adjust order of command attributes Remove range support
-rw-r--r--VERSION2
-rw-r--r--autoload/keep_position.vim6
-rw-r--r--doc/keep_position.txt11
-rw-r--r--plugin/keep_position.vim4
4 files changed, 5 insertions, 18 deletions
diff --git a/VERSION b/VERSION
index 0d91a54..1d0ba9e 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.3.0
+0.4.0
diff --git a/autoload/keep_position.vim b/autoload/keep_position.vim
index 7ff0228..a2f2ed4 100644
--- a/autoload/keep_position.vim
+++ b/autoload/keep_position.vim
@@ -1,7 +1,5 @@
-function! keep_position#(command, range, start, end) abort
+function! keep_position#(command) abort
let view = winsaveview()
execute a:command
- if !a:range || (a:start >= line("'[") && a:end <= line("']"))
- call winrestview(view)
- endif
+ call winrestview(view)
endfunction
diff --git a/doc/keep_position.txt b/doc/keep_position.txt
index 05f69bc..25de36f 100644
--- a/doc/keep_position.txt
+++ b/doc/keep_position.txt
@@ -20,17 +20,6 @@ especially ones that work on the entire buffer:
>
:KeepPosition %!tidy
<
-You will generally want to use this command as above, without a range.
-However, if you do specify a range, it will only preserve the view if the last
-change to the buffer--presumably made by your nominated command--entirely
-encompassed the given range. This is checked with the |'[| and |']| marks.
-
-The author uses the range functionality to make a "conditional jump"; only
-jump to the changes the given command makes if it didn't affect the entire
-buffer, e.g.:
->
- :nnoremap u :<C-U>%KeepPosition undo<CR>
-<
AUTHOR *keep_position-author*
Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.
diff --git a/plugin/keep_position.vim b/plugin/keep_position.vim
index 68adb54..6f6c398 100644
--- a/plugin/keep_position.vim
+++ b/plugin/keep_position.vim
@@ -11,5 +11,5 @@ endif
let loaded_keep_position = 1
" User command definition refers to autoloaded function
-command! -bar -nargs=+ -complete=command -range KeepPosition
- \ call keep_position#(<q-args>, <range>, <line1>, <line2>)
+command! -bar -complete=command -nargs=+ KeepPosition
+ \ call keep_position#(<q-args>)