From 6a810701c32db7155bcec29507d8346fa3d9fb67 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Thu, 16 Nov 2023 13:24:56 +0800 Subject: [PATCH] docs: add more bounds checking to the full border --- docs/tips.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/tips.md b/docs/tips.md index c035804c..c8441727 100644 --- a/docs/tips.md +++ b/docs/tips.md @@ -16,12 +16,15 @@ You can implement a full border for Yazi via the UI plugin. Copy the preset [`Manager:render` function](https://github.com/sxyazi/yazi/blob/main/yazi-plugin/preset/components/manager.lua) to any place, for example `~/.config/yazi/ui.lua`, then apply the following patch: ```diff -@@ -10,16 +10,26 @@ function Manager:render(area) +@@ -10,16 +10,28 @@ function Manager:render(area) }) :split(area) + local bar = function(c, x, y) -+ return ui.Bar(ui.Rect { x = math.max(0, x), y = math.max(0, y), w = 1, h = 1 }, ui.Position.TOP):symbol(c) ++ return ui.Bar( ++ ui.Rect { x = math.max(0, x), y = math.max(0, y), w = math.min(1, area.w), h = math.min(1, area.h) }, ++ ui.Position.TOP ++ ):symbol(c) + end + return utils.flat {