fix(test): :CP is now a valid command

This commit is contained in:
Barrett Ruth 2025-09-19 23:34:38 -04:00
parent 77aa5dd4c4
commit a1aa4ccbf9
2 changed files with 8 additions and 4 deletions

View file

@ -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