Skip to content

Commit

Permalink
Avoid moving screen cursor during Vim startup
Browse files Browse the repository at this point in the history
Search for "did_show" in Vim's do_set() to see why this works.

Resolves: #182
  • Loading branch information
tpope committed Jan 5, 2023
1 parent 8e274c2 commit 947f613
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions plugin/sensible.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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 . '?'

This comment has been minimized.

Copy link
@micklynch

micklynch Jan 6, 2023

@tpope I got an error with these changes:

Error detected while processing function <SNR>31_MaySet:
line    2:
E518: Unknown option: termcap
line    1:
E121: Undefined variable: out
E121: Undefined variable: out
E121: Undefined variable: out
E121: Undefined variable: out

Same error on nvim 0.7.2 on Ubuntu and 0.8.2 on MacOS.

This comment has been minimized.

Copy link
@micklynch

micklynch Jan 6, 2023

Commenting out vim-sensible from my init.vim file fixed the problem.

This comment has been minimized.

Copy link
@tpope

tpope Jan 6, 2023

Author Owner

Fixed

This comment has been minimized.

Copy link
@micklynch

micklynch Jan 6, 2023

Confirmed fixed, thanks!

redir END
return out !~# " \\~[\\/][^\n]*$"
endfunction

if s:MaySet('backspace')
Expand Down

0 comments on commit 947f613

Please sign in to comment.