Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor flickering momentarily when autosaving with CursorHold,CursorHoldI, only when Tagbar is enabled #829

Closed
eq0cdk opened this issue Aug 12, 2022 · 1 comment

Comments

@eq0cdk
Copy link

eq0cdk commented Aug 12, 2022

The cursor flickers whenever autosaving is triggered with CursorHold or CursorHoldI. This doesn't happen when Tagbar is disabled. I'm using the vwtags.py script from https://github.com/vimwiki/utils/blob/master/vwtags.py.

This is extremely distracting and disorienting. Please fix this problem.

Tagbar disabled:
https://user-images.githubusercontent.com/101584995/184339114-faa79806-1469-4067-a7e1-68e447fd79ab.mp4

Tagbar enabled:
https://user-images.githubusercontent.com/101584995/184339145-3076d11d-7f8a-4773-ab29-4fd5559eb174.mp4

My vimrc:

"# Automatically save vimwiki files, only if buffer was changed
autocmd CursorHold,CursorHoldI *.wiki,*.md :silent! update

"# Tagbar
let g:tagbar_type_vimwiki = {
	  \   'ctagstype':'vimwiki'
	  \ , 'kinds':['h:header']
	  \ , 'sro':'&&&'
	  \ , 'kind2scope':{'h':'header'}
	  \ , 'sort':0
	  \ , 'ctagsbin':'~/.vim/vwtags.py'
	  \ , 'ctagsargs': 'default'
	  \ }

"## Main settings
let g:tagbar_compact = 2
let g:tagbar_singleclick = 1
let g:tagbar_width = 40
let g:tagbar_silent = 1
let g:tagbar_no_status_line = 1
let g:tagbar_highlight_follow_insert = 1
let g:tagbar_sort = 0
let g:airline#extensions#tagbar#enabled = 0 

"## Autostart tagbar when opening wiki page
autocmd VimEnter *.wiki,*.md nested :call tagbar#autoopen(1)
autocmd BufEnter *.wiki,*.md :silent! w!

"## Autostart tagbar when opening new tab
autocmd TabNew * nested :call tagbar#autoopen(1)

"## Hide colon
autocmd FileType tagbar highlight Colon guifg=Black ctermfg=Black
autocmd FileType tagbar syn match Colon / : header/

"## Other
autocmd FileType tagbar highlight TagbarHighlight guifg=Blue ctermfg=Blue
autocmd FileType tagbar highlight TagbarType guifg=Black ctermfg=Black
@raven42
Copy link
Collaborator

raven42 commented Aug 12, 2022

Unfortunately there is not really anything that can be done for this based on the current design. When the file is changed in the file system, that triggers the update to the file for tagbar and to do that, it first needs to jump to the tagbar window to refresh the contents while ctags is re-run on the now updated file. The only thing I know of to fix this would be to rewrite the parsing portion of tagbar and have that run in a background process as a separate thread. This has been discussed in more detail in #532 but the methods we've tried thus far haven't really worked as a true background process. With vim 9 out now, things like that may change, but I currently don't have an environment to test vim 9.

Closing this and we can track this under #532

@raven42 raven42 closed this as completed Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants