ray-x/navigator.lua

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

revelationnow opened this issue · 0 comments

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