Skip to content

Commit

Permalink
docs: update full border patch
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Jan 27, 2024
1 parent 907b26f commit abadd00
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ 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 your `~/.config/yazi/init.lua`, then apply the following patch:

```diff
@@ -10,16 +10,29 @@
@@ -10,16 +10,28 @@
})
:split(area)

+ local bar = function(c, x, y)
+ 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.Bar.TOP
+ ):symbol(c)
+ x, y = math.max(0, x), math.max(0, y)
+ return ui.Bar(ui.Rect { x = x, y = y, w = ya.clamp(0, area.w - x, 1), h = math.min(1, area.h) }, ui.Bar.TOP)
+ :symbol(c)
+ end
+
return ya.flat {
Expand Down

0 comments on commit abadd00

Please sign in to comment.