From a51fdb60ffbc0aae49d21069426ee722e50ca925 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 9 Apr 2018 13:02:06 -0700 Subject: [PATCH] [vim] fix cursor restoration w/vim-vinegar --- .vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 959b8b8..1b50b4d 100644 --- a/.vimrc +++ b/.vimrc @@ -88,7 +88,8 @@ set virtualedit=block set noshowmode function! RestoreCursor() - if line("'\"") <= line("$") + let pos = line("'\"") + if pos > 0 && pos <= line("$") normal! g`"zz return 1 endif