Skip to content

When opening files with line number, language lookup fails and shows an error #281

@revelationnow

Description

@revelationnow

When opening a file:

nvim test.cpp:20

Error detected while processing BufEnter Autocommands for "*":
Error executing lua callback: .../start/navigator.lua/lua/navigator/lspclient/clients.lua:530: E474: Invalid argument
stack traceback:
[C]: in function 'nvim_buf_set_option'
.../start/navigator.lua/lua/navigator/lspclient/clients.lua:530: in function 'setup'
.../start/navigator.lua/lua/navigator/lspclient/clients.lua:643: in function 'on_filetype'
...m/site/pack/packer/start/navigator.lua/lua/navigator.lua:308: in function <...m/site/pack/packer/start/navigator.lua/lua/navigator.lua:307>

Fix would be to identify any colons in the extension and calculate the ext variable to be just the extension and not also the line number

local ext = vfn.expand('%:e')
if string.match(ext, ":") then
  ext = string.match(ext,"(.*);")
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions