From 8d1485d4275393f15b245c9f97d5410f309d8cde Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 8 Aug 2018 15:01:03 +1200 Subject: Don't jump if zero or no move --- vim/after/ftplugin/mail.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vim/after') diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 657c98ca..1ad4294b 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -99,8 +99,10 @@ function! s:NewBlank(start, count, up) abort let l:num += a:up ? -1 : 1 endwhile - " Move to line (needs jumps and marks setting) - execute 'normal '.l:num.'G' + " Move to line if nonzero and not equal to the current line + if l:num && l:num != line('.') + execute 'normal '.l:num.'G' + endif endfunction -- cgit v1.2.3