vim-rtags
vim-rtags copied to clipboard
Symbol info command works only in sync mode
With my recent VIM:
vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12)
The symbol info command runs, I can verify that in rdm.log file. I can also verify that rtags#SymbolInfoHandler is called. However the editor blinks and not info is displayed. On the other hand, setting:
s:rtagsAsync = 0
works for me.
First bad revision: c6dcdd4f67484f3e1e94a06a2f56012449fd5528
And it works fine in NeoVim.
The same issue is also present when using ProjectList
For ProjectList I did this -
function! rtags#ProjectList()
"call rtags#ExecuteThen({ '-w' : '' }, [function('rtags#ProjectListHandler')])
let result = rtags#ExecuteRC({ '-w' : '' })
call rtags#ExecuteHandlers(result, [function('rtags#ProjectListHandler')])
endfunction
until I or someone else can figure out the problem with the channel output
like what mckellyln said, change SymboInfo() in rtags.vim to the below will work
function! rtags#SymbolInfo()
"call rtags#ExecuteThen({ '-U' : rtags#getCurrentLocation() }, [function('rtags#SymbolInfoHandler')])
let result = rtags#ExecuteRC({ '-U' : rtags#getCurrentLocation() })
call rtags#ExecuteHandlers(result, [function('rtags#SymbolInfoHandler')])
endfunction
Any update on this?
Hi. I'll go figure it out. I used the synchronous method long ago and left it that way, but I did make some changes to the async code for other reasons and will re-visit this.
I found two issues, 1). the vim job handler did not always get all data, especially if the cmd ended quickly. And 2). the output from the async handler has ^@ (NUL) at the end of each line in the list and the join() then does not echo multiple lines correctly. I fixed these things in my branch, but I also made other changes/improvements. I test with vim thoroughly but not yet with neovim so I need to do that. For now, I would just change the two lines in your copy of the plugin to use sync call for this function as shown above.