fix(test): :CP is now a valid command
This commit is contained in:
parent
77aa5dd4c4
commit
a1aa4ccbf9
2 changed files with 8 additions and 4 deletions
|
|
@ -75,10 +75,11 @@ function M.restore_layout(state, tile_fn)
|
|||
local source_file
|
||||
if source_files ~= '' then
|
||||
local files = vim.split(source_files, '\n')
|
||||
local valid_extensions = vim.tbl_keys(constants.filetype_to_language)
|
||||
-- Prefer known extensions first, but accept any extension
|
||||
local known_extensions = vim.tbl_keys(constants.filetype_to_language)
|
||||
for _, file in ipairs(files) do
|
||||
local ext = vim.fn.fnamemodify(file, ':e')
|
||||
if vim.tbl_contains(valid_extensions, ext) then
|
||||
if vim.tbl_contains(known_extensions, ext) then
|
||||
source_file = file
|
||||
break
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue