Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
style format
  • Loading branch information
protiumx committed Dec 3, 2023
commit 065435b5dfa113a9affc94bb2fab77929a040b74
20 changes: 10 additions & 10 deletions lua/diffview/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,9 @@ function M.extend_keymaps(...)
end

local merged = vim.tbl_extend("force", unpack(
vim.tbl_map(function(v)
return v.expanded
end, contexts)
vim.tbl_map(function(v)
return v.expanded
end, contexts)
))

return vim.tbl_values(merged)
Expand Down Expand Up @@ -518,7 +518,7 @@ function M.setup(user_config)
if not notified then
utils.warn(
("'%s.{%s}' has been deprecated. See ':h diffview.changelog-136'.")
:format( panel_name, fmt_enum(old_win_config_spec, true))
:format(panel_name, fmt_enum(old_win_config_spec, true))
)
notified = true
end
Expand All @@ -543,7 +543,7 @@ function M.setup(user_config)
}
for _, name in ipairs(top_options) do
if user_log_options[name] ~= nil then
utils.warn( "Global config of 'file_panel.log_options' has been deprecated. See ':h diffview.changelog-271'.")
utils.warn("Global config of 'file_panel.log_options' has been deprecated. See ':h diffview.changelog-271'.")
end
break
end
Expand All @@ -560,7 +560,7 @@ function M.setup(user_config)
if user_log_options[name] ~= nil then
utils.warn(
("'file_history_panel.log_options.{%s}' has been deprecated. See ':h diffview.changelog-151'.")
:format( fmt_enum(option_names, true))
:format(fmt_enum(option_names, true))
)
break
end
Expand Down Expand Up @@ -593,7 +593,7 @@ function M.setup(user_config)

for _, kind in ipairs(vim.tbl_keys(valid_layouts)) do
if not vim.tbl_contains(valid_layouts[kind], view[kind].layout) then
utils.err( ("Invalid layout name '%s' for 'view.%s'! Must be one of (%s)."):format(
utils.err(("Invalid layout name '%s' for 'view.%s'! Must be one of (%s)."):format(
view[kind].layout,
kind,
fmt_enum(valid_layouts[kind])
Expand All @@ -612,16 +612,16 @@ function M.setup(user_config)
t[name]
)
for k, _ in pairs(t[name]) do
if t[name][k] == ""
then t[name][k] = nil
if t[name][k] == "" then
t[name][k] = nil
end
end
end
end

for event, callback in pairs(M._config.hooks) do
if type(callback) == "function" then
M.user_emitter:on(event, function(_, ...)
M.user_emitter:on(event, function (_, ...)
callback(...)
end)
end
Expand Down
6 changes: 4 additions & 2 deletions lua/diffview/scene/views/file_history/render.lua
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ local function render_entries(panel, parent, entries, updating)
local dels = tostring(entry.stats.deletions)
local l = 7
local w = l - (#adds + #dels)
if w < 1 then l = (#adds + #dels) - ((#adds + #dels) % 2) + 2 end
if w < 1 then
l = (#adds + #dels) - ((#adds + #dels) % 2) + 2
end
max_len_stats = l > max_len_stats and l or max_len_stats
end
end
Expand Down Expand Up @@ -210,7 +212,7 @@ local function prepare_panel_cache(panel)
pl:vim_fnamemodify(panel.adapter.ctx.toplevel, ":~"),
panel:infer_width() - 6
)
or pl:vim_fnamemodify(panel.adapter.ctx.toplevel, ":~")
or pl:vim_fnamemodify(panel.adapter.ctx.toplevel, ":~")
c.args = table.concat(panel.log_options.single_file.path_args, " ")
end

Expand Down