1

Handle files with no extensions

This commit is contained in:
Alex Yatskov 2022-10-03 20:22:04 -07:00
parent 64346078d3
commit b0c825af3a

View File

@ -36,18 +36,20 @@ 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
if flip_path then
vim.cmd(string.format('e %s', flip_path))
end
end
end
return {