Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

inappropriate type conversion in rtags#JumpToHandler #129

Open
ziny0902 opened this issue Feb 17, 2021 · 1 comment
Open

inappropriate type conversion in rtags#JumpToHandler #129

ziny0902 opened this issue Feb 17, 2021 · 1 comment

Comments

@ziny0902
Copy link

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)
                                      ...
@mckellygit
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants