From 90ee500ed7945cedcbdc45b40de3ab26a762479d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 9 Jul 2017 00:10:33 +0200 Subject: autoload/grappele.vim: Don't save location when using `G` directly Previously, we would save the location of the `G` command regardless of whether it was used with a count or not. Thus, `34G` and `G` would both save locations. Saving the location of `G` isn't really useful, but it's easily accessed. Instead, only save location when using a count with `G`. This allows the Grappele command to be useful even after having pressed `G`. --- autoload/grappele.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/grappele.vim b/autoload/grappele.vim index c82d0c5..c699f0d 100644 --- a/autoload/grappele.vim +++ b/autoload/grappele.vim @@ -1,6 +1,5 @@ function! grappele#Grappele(line) let l:current_buffer = 0 - let s:line = a:line let l:column_position = 0 let l:column_offset = 0 @@ -10,6 +9,8 @@ function! grappele#Grappele(line) " Go to the end of the buffer $ else + let s:line = a:line + call setpos('.', [ \ l:current_buffer, \ a:line, -- cgit v1.2.3