Skip to content

Commit

Permalink
fixup! Make it config flexibly
Browse files Browse the repository at this point in the history
  • Loading branch information
JohanChane committed Jun 29, 2024
1 parent 583d1a2 commit 08db73f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions lua/fm-nvim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,17 @@ function M.CreateWindow(name, other_params, suffix)
local format_params = {
choose_file = choose_file,
}
local create_win_cmd = M.replace_placeholders(config.tools[name].create_win_cmd_format, format_params)
.. " " .. table.concat(other_params, " ")

local create_win_cmd_format = config.tools[name].create_win_cmd_format
if config.ui.default == "float" then
local create_win_cmd = M.replace_placeholders(create_win_cmd_format, format_params)
.. " " .. table.concat(other_params, " ")
createWin(create_win_cmd, suffix)
elseif config.ui.default == "split" then
local create_split_cmd
local create_split_cmd_format = config.tools[name].create_split_cmd_format
if create_split_cmd_format ~= nil then
create_split_cmd = M.replace_placeholders(create_split_cmd_format, format_params)
.. " " .. table.concat(other_params, " ")
else
create_split_cmd = create_win_cmd
end

local create_split_cmd = M.replace_placeholders(
config.tools[name].create_split_cmd_format or create_win_cmd_format,
format_params
) .. " " .. table.concat(other_params, " ")
createSplit(create_split_cmd, suffix)
end
end
Expand Down

0 comments on commit 08db73f

Please sign in to comment.