vimpostor / vim-tpipeline

Embed your vim statusline in tmux
GNU General Public License v3.0
364 stars 10 forks source link

Changes CocDiagnosticEvents are not reflected in tmux status bar #33

Closed nikkegg closed 2 years ago

nikkegg commented 2 years ago

Describe the bug

I am using this plugin together with https://github.com/josa42/vim-lightline-coc

Essentially, it pulls diagnostic events from coc and displays them in my statusline ( I am using lightline.vim) When I embed my statusline into tmux status bar, these events do not get updated.

I have tried capturing coc diagnostic events in the following way, however, this did not help:

augroup lightline#coc
  autocmd!
  autocmd User CocDiagnosticChange call lightline#update()
  autocmd User CocStatusChange call lightline#update()
  autocmd User CocDiagnosticChange call tpipeline#update()  
  autocmd User CocStatusChange call tpipeline#update()  
augroup END

I had this set too:

let g:tpipeline_cursormoved = 1

To reproduce

Configre coc.nvim for a language of your choice and install relevant coc plugin

  1. Install https://github.com/itchyny/lightline.vim
  2. Install https://github.com/josa42/vim-lightline-coc and follow readme steps
  3. Embed statusline in tmux status bar using vim-tpipeline plugin

Write some fuckery LSP does not like and observe how status bar in tmux is not updating.

Visual:

Screenshot 2022-08-17 at 16 26 12

Expected behavior

Status bar in tmux gets updated when CocDiagnosticEvents fire

Vim version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Aug 06 2022 10:35:28) macOS version - arm64 Included patches: 1-150 Compiled by Homebrew

Tmux version

tmux 3.3a

Terminal emulator

Iterm2

Debug output

Error detected while processing function tpipeline#debug#info:
line    3:
E117: Unknown function: nvim_eval_statusline
line    4:
E121: Undefined variable: native
vimpostor commented 2 years ago

Thanks for the detailed bug report, I appreciate it.

I have pushed a change that should fix this, but you will need to continue using the following autocmds in your config:

autocmd User CocDiagnosticChange call tpipeline#update()
autocmd User CocStatusChange call tpipeline#update()

Do not put these autocmds in a group with the name lightline#coc, or otherwise they will get deleted once vim-lightline-coc initializes: https://github.com/josa42/vim-lightline-coc/blob/53465b2c2ce7b6ae3497ad1cdb751dd3d8084d5c/plugin/lightline/coc.vim#L2

nikkegg commented 2 years ago

@vimpostor Worked like a charm, thank you for the awesome plugin and quick response :) 👏