Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
visual mode re-highlight fix
-switching from and then back to the peekaboo buffer via multiple
`wincmd p` operations fails if the intermediate `gv + redraw` happens
to trigger plugins which visit other windows
-instead, record window number and reset following the operations
-bug likely went unnoticed because the side-effects of latter
buffer modifications aren't that noticeable. however, should the
multiple `wincmd p` operations land you on a window with its buffer's
`modifiable=0` set, then a very visible:

 `E21: Cannot make changes,'modifiable' is off`

error is presented, and the operation a user is attempting (e.g.
"+y etc.) fails ..then you know about it!
  • Loading branch information
elbeardmorez committed Apr 27, 2019
commit b11e58f7782d4e0bd73389f05cba5c298695468f
3 changes: 2 additions & 1 deletion autoload/peekaboo.vim
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ endfunction
" Triggers gv to keep visual highlight on
function! s:gv(visualmode, visible)
if a:visualmode && a:visible
let wnr = bufwinnr('')
wincmd p
normal! gv
redraw
wincmd p
execute wnr 'wincmd w'
else
redraw
endif
Expand Down