From 947f613a091d93316c47c0249237f4529fef5182 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 5 Jan 2023 18:17:59 -0500 Subject: [PATCH] Avoid moving screen cursor during Vim startup Search for "did_show" in Vim's do_set() to see why this works. Resolves: https://github.com/tpope/vim-sensible/issues/182 --- plugin/sensible.vim | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugin/sensible.vim b/plugin/sensible.vim index 85d581b..3782065 100644 --- a/plugin/sensible.vim +++ b/plugin/sensible.vim @@ -21,14 +21,10 @@ endif " overriding options in the user's vimrc, but still override options in the " system vimrc. function! s:MaySet(option) abort - if exists('*execute') - let out = execute('verbose setglobal ' . a:option . '?') - else - redir => out - silent verbose execute 'setglobal' a:option . '?' - redir END - endif - return out !~# ' \~[\/]' + redir => out + silent verbose execute 'setglobal termcap' a:option . '?' + redir END + return out !~# " \\~[\\/][^\n]*$" endfunction if s:MaySet('backspace')