vim-rtags icon indicating copy to clipboard operation
vim-rtags copied to clipboard

Symbol info command works only in sync mode

Open marxin opened this issue 7 years ago • 8 comments

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.

marxin avatar Jan 26 '18 20:01 marxin

First bad revision: c6dcdd4f67484f3e1e94a06a2f56012449fd5528

marxin avatar Jan 26 '18 20:01 marxin

And it works fine in NeoVim.

marxin avatar Jan 27 '18 13:01 marxin

The same issue is also present when using ProjectList

bartlibert avatar Feb 14 '18 09:02 bartlibert

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

mckellyln avatar Apr 11 '18 02:04 mckellyln

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

ziegfeld avatar Jun 06 '18 21:06 ziegfeld

Any update on this?

Barricade avatar Feb 06 '20 14:02 Barricade

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.

mckellyln avatar Feb 06 '20 14:02 mckellyln

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.

mckellyln avatar Feb 07 '20 02:02 mckellyln