Skip to content

Commit c2cf35c

Browse files
committed
feat: add inverse search cursor blink
refer: #3039
1 parent 5c00db0 commit c2cf35c

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

autoload/vimtex/options.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ function! s:init_highlights() abort " {{{1
628628
\ ['VimtexWarning', 'WarningMsg'],
629629
\ ['VimtexError', 'Error'],
630630
\ ['VimtexFatal', 'ErrorMsg'],
631+
\ ['VimtexBlink', 'PMenu'],
631632
\ ['VimtexTocHelp', 'helpVim'],
632633
\ ['VimtexTocHelpKey', 'ModeMsg'],
633634
\ ['VimtexTocHelpLayerOn', 'Statement'],

autoload/vimtex/ui.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,21 @@ function! vimtex#ui#get_winwidth() abort
166166
return winwidth(0) - l:numwidth - l:foldwidth - l:signwidth
167167
endfunction
168168

169+
function! vimtex#ui#blink() abort
170+
call sign_define('vimtexblink', #{ linehl: 'VimtexBlink' })
171+
172+
for i in range(1, 4)
173+
call sign_place(1, 'vimtex', 'vimtexblink', '', #{ lnum: '.' })
174+
redraw
175+
sleep 150m
176+
call sign_unplace('vimtex')
177+
redraw
178+
sleep 150m
179+
endfor
180+
181+
call sign_undefine("vimtexblink")
182+
endfunction
183+
169184

170185
function! s:echo_string(msg, opts) abort
171186
echohl VimtexMsg

autoload/vimtex/view.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ function! vimtex#view#inverse_search(line, filename, column = 0) abort
118118
endif
119119
redraw
120120

121+
call vimtex#ui#blink()
122+
121123
if exists('#User#VimtexEventViewReverse')
122124
doautocmd <nomodeline> User VimtexEventViewReverse
123125
endif

0 commit comments

Comments
 (0)