Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion lua/diffview/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local Diff2Hor = lazy.access("diffview.scene.layouts.diff_2_hor", "Diff2Hor") --
local Diff2Ver = lazy.access("diffview.scene.layouts.diff_2_ver", "Diff2Ver") ---@type Diff2Ver|LazyModule
local Diff3 = lazy.access("diffview.scene.layouts.diff_3", "Diff3") ---@type Diff3|LazyModule
local Diff3Hor = lazy.access("diffview.scene.layouts.diff_3_hor", "Diff3Hor") ---@type Diff3Hor|LazyModule
local Diff3Ver = lazy.access("diffview.scene.layouts.diff_3_ver", "Diff3Ver") ---@type Diff3Hor|LazyModule
local Diff3Ver = lazy.access("diffview.scene.layouts.diff_3_ver", "Diff3Ver") ---@type Diff3Ver|LazyModule
local Diff3Mixed = lazy.access("diffview.scene.layouts.diff_3_mixed", "Diff3Mixed") ---@type Diff3Mixed|LazyModule
local Diff4 = lazy.access("diffview.scene.layouts.diff_4", "Diff4") ---@type Diff4|LazyModule
local Diff4Mixed = lazy.access("diffview.scene.layouts.diff_4_mixed", "Diff4Mixed") ---@type Diff4Mixed|LazyModule
Expand Down
6 changes: 3 additions & 3 deletions lua/diffview/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,8 @@ 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'.")
break
end
break
end

local option_names = {
Expand Down Expand Up @@ -640,7 +640,7 @@ function M.setup(user_config)
-- Validate layouts
local view = M._config.view
local standard_layouts = { "diff1_plain", "diff2_horizontal", "diff2_vertical", -1 }
local merge_layuots = {
local merge_layouts = {
"diff1_plain",
"diff3_horizontal",
"diff3_vertical",
Expand All @@ -650,7 +650,7 @@ function M.setup(user_config)
}
local valid_layouts = {
default = standard_layouts,
merge_tool = merge_layuots,
merge_tool = merge_layouts,
file_history = standard_layouts,
}

Expand Down
9 changes: 4 additions & 5 deletions lua/diffview/hl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,11 @@ function M.get_style(groups, no_trans)
local res = {}

for _, attr in ipairs(style_attrs) do
if hl[attr] then table.insert(res, attr)
end
if hl[attr] then table.insert(res, attr) end
end

if #res > 0 then
return table.concat(res, ",")
end
if #res > 0 then
return table.concat(res, ",")
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lua/diffview/scene/views/diff/file_panel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ end
---Get the file entry under the cursor.
---@return (FileEntry|DirData)?
function FilePanel:get_item_at_cursor()
if not self:is_open() and self:buf_loaded() then return end
if not (self:is_open() and self:buf_loaded()) then return end

local line = api.nvim_win_get_cursor(self.winid)[1]
local comp = self.components.comp:get_comp_on_line(line)
Expand All @@ -260,7 +260,7 @@ end
---@return RenderComponent?
function FilePanel:get_dir_at_cursor()
if self.listing_style ~= "tree" then return end
if not self:is_open() and self:buf_loaded() then return end
if not (self:is_open() and self:buf_loaded()) then return end

local line = api.nvim_win_get_cursor(self.winid)[1]
local comp = self.components.comp:get_comp_on_line(line)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ end
---Get the log or file entry under the cursor.
---@return (LogEntry|FileEntry)?
function FileHistoryPanel:get_item_at_cursor()
if not self:is_open() and self:buf_loaded() then return end
if not (self:is_open() and self:buf_loaded()) then return end

local cursor = api.nvim_win_get_cursor(self.winid)
local line = cursor[1]
Expand Down
8 changes: 4 additions & 4 deletions lua/diffview/vcs/adapters/hg/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -940,15 +940,15 @@ function HgAdapter:parse_revs(rev_arg, opt)
right = HgRev(RevType.COMMIT, to)
else
local node, code, stderr = self:exec_sync({"log", "--limit=1", "--template={node}", "--rev=" .. rev_arg}, self.ctx.toplevel)
if code ~= 0 and node then
utils.err(fmt("Failed to parse rev %s: %s", utils.str_quote(rev_arg), stderr))
if not code or code ~= 0 then
utils.err(fmt("Failed to parse rev %s: %s", utils.str_quote(rev_arg), table.concat(stderr or {}, "\n")))
return
Comment thread
dlyongemallo marked this conversation as resolved.
end
left = HgRev(RevType.COMMIT, node[1])

node, code, stderr = self:exec_sync({"log", "--limit=1", "--template={node}", "--rev=reverse(" .. rev_arg .. ")"}, self.ctx.toplevel)
if code ~= 0 and node then
utils.err(fmt("Failed to parse rev %s: %s", utils.str_quote(rev_arg), stderr))
if not code or code ~= 0 then
utils.err(fmt("Failed to parse rev %s: %s", utils.str_quote(rev_arg), table.concat(stderr or {}, "\n")))
return
Comment thread
dlyongemallo marked this conversation as resolved.
end

Expand Down