Skip to content

Commit

Permalink
feat: add inverse search cursor blink
Browse files Browse the repository at this point in the history
refer: #3039
  • Loading branch information
lervag committed Dec 28, 2024
1 parent 96aa257 commit e4e5d9f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions autoload/vimtex/options.vim
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ function! s:init_highlights() abort " {{{1
\ ['VimtexWarning', 'WarningMsg'],
\ ['VimtexError', 'Error'],
\ ['VimtexFatal', 'ErrorMsg'],
\ ['VimtexBlink', 'PMenu'],
\ ['VimtexTocHelp', 'helpVim'],
\ ['VimtexTocHelpKey', 'ModeMsg'],
\ ['VimtexTocHelpLayerOn', 'Statement'],
Expand Down
15 changes: 15 additions & 0 deletions autoload/vimtex/ui.vim
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,21 @@ function! vimtex#ui#get_winwidth() abort
return winwidth(0) - l:numwidth - l:foldwidth - l:signwidth
endfunction

function! vimtex#ui#blink() abort
call sign_define('vimtexblink', #{ linehl: 'VimtexBlink' })

for i in range(1, 4)
call sign_place(1, 'vimtex', 'vimtexblink', '', #{ lnum: '.' })
redraw
sleep 150m
call sign_unplace('vimtex')
redraw
sleep 150m
endfor

call sign_undefine("vimtexblink")
endfunction


function! s:echo_string(msg, opts) abort
echohl VimtexMsg
Expand Down
2 changes: 2 additions & 0 deletions autoload/vimtex/view.vim
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ function! vimtex#view#inverse_search(line, filename, column = 0) abort
endif
redraw

call vimtex#ui#blink()

if exists('#User#VimtexEventViewReverse')
doautocmd <nomodeline> User VimtexEventViewReverse
endif
Expand Down

0 comments on commit e4e5d9f

Please sign in to comment.