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

inappropriate type conversion in rtags#JumpToHandler

Open ziny0902 opened this issue 4 years ago • 1 comments

vim 8.2 think lnum and col as string in rtags#JumpToHandler Therefore call cursor(lnum, col) cause exception(E474) in rtags#jumpToLocationInternal. But neovim can covert it to number properly.

I have to fix it as below code:

function! rtags#JumpToHandler(results, args)
                                        ...
        let [jump_file, lnum, col; rest] = split(location, ':')

        let lnum = str2nr(lnum)
        let col = str2nr(col)
                                      ...

ziny0902 avatar Feb 17 '21 15:02 ziny0902

Hi, Good info. I did something similar in my fork -

function! rtags#jumpToLocationInternal(file, line, col)
    try
        if a:file != expand("%:p")
            exe "e ".a:file
        endif
        "call cursor(a:line, a:col)
        let curlistpos = [a:line, a:col]
        call cursor(curlistpos)

I try to maintain rtags some for a while in my fork. thx, -m

mckellygit avatar Feb 17 '21 18:02 mckellygit