Handle files with no extensions
This commit is contained in:
parent
64346078d3
commit
b0c825af3a
@ -36,12 +36,13 @@ local function hflip()
|
||||
local path = vim.api.nvim_buf_get_name(index)
|
||||
local name, ext = split_ext(path)
|
||||
|
||||
ext = ext:lower()
|
||||
if ext ~= nil then
|
||||
local ext_lower = ext:lower()
|
||||
|
||||
local flip_path
|
||||
if header_exts[ext] then
|
||||
if header_exts[ext_lower] then
|
||||
flip_path = locate_flip_path(name, source_exts)
|
||||
elseif source_exts[ext] then
|
||||
elseif source_exts[ext_lower] then
|
||||
flip_path = locate_flip_path(name, header_exts)
|
||||
end
|
||||
|
||||
@ -49,6 +50,7 @@ local function hflip()
|
||||
vim.cmd(string.format('e %s', flip_path))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
hflip = hflip
|
||||
|
Loading…
Reference in New Issue
Block a user