Fix: chemin vers les templates incorrectes
This commit is contained in:
parent
0249e9cb61
commit
2d146ff779
@ -16,11 +16,14 @@ end
|
||||
local function header()
|
||||
local filetype = vim.api.nvim_buf_get_option(0, 'filetype')
|
||||
if filetype ~= "" then
|
||||
if file_exists('data/tpl/header-' .. filetype .. '.tpl') then
|
||||
local lines = get_lines_from('data/tpl/header-' .. filetype .. '.tpl')
|
||||
local current_file_fullpath = debug.getinfo(1, "S").source:sub(2)
|
||||
local current_file_path = current_file_fullpath:match("(.*/)")
|
||||
local tpl_path = current_file_path .. '../../data/tpl/header-' .. filetype .. '.tpl'
|
||||
if file_exists(tpl_path) then
|
||||
local lines = get_lines_from(tpl_path)
|
||||
vim.api.nvim_put(lines, "l", false, true)
|
||||
else
|
||||
print("Pas de fichier pour ce filetype")
|
||||
print("Pas de fichier pour ce filetype (" .. tpl_path .. ")")
|
||||
end
|
||||
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user