This commit is contained in:
sayanarijit 2022-05-26 10:53:15 +00:00
parent 04df816489
commit 166df791a4
4 changed files with 10 additions and 8 deletions

View File

@ -528,14 +528,15 @@ xplr.config.layouts.builtin.default = {
{
CustomContent = {
title = "preview",
body = { DynamicParagraph = { render = "custom.render_layout" } },
body = { DynamicParagraph = { render = "custom.preview_pane.render" } },
},
},
},
},
}
xplr.fn.custom.render_layout = function(ctx)
xplr.fn.custom.preview_pane = {}
xplr.fn.custom.preview_pane.render = function(ctx)
local n = ctx.app.focused_node
if n.canonical then
@ -543,7 +544,7 @@ xplr.fn.custom.render_layout = function(ctx)
end
if n then
if n.is_file and not n.is_symlink then
if n.is_file then
return read(n.absolute_path, ctx.layout_size.height)
else
return stat(n)

View File

@ -3834,14 +3834,15 @@ xplr.config.layouts.builtin.default = {
{
CustomContent = {
title = "preview",
body = { DynamicParagraph = { render = "custom.render_layout" } },
body = { DynamicParagraph = { render = "custom.preview_pane.render" } },
},
},
},
},
}
xplr.fn.custom.render_layout = function(ctx)
xplr.fn.custom.preview_pane = {}
xplr.fn.custom.preview_pane.render = function(ctx)
local n = ctx.app.focused_node
if n.canonical then
@ -3849,7 +3850,7 @@ xplr.fn.custom.render_layout = function(ctx)
end
if n then
if n.is_file and not n.is_symlink then
if n.is_file then
return read(n.absolute_path, ctx.layout_size.height)
else
return stat(n)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long