Skip to content

Commit

Permalink
docs: update the username/hostname tip
Browse files Browse the repository at this point in the history
  • Loading branch information
sxyazi committed Mar 9, 2024
1 parent ea95414 commit 03ff15e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,10 @@ Copy the [`Status:render()` method](https://github.com/sxyazi/yazi/blob/latest/y
Copy the [`Header:render()` method](https://github.com/sxyazi/yazi/blob/latest/yazi-plugin/preset/components/header.lua) _*only*_ to your `~/.config/yazi/init.lua`, and apply the following patch:

```diff
@@ -1,3 +1,10 @@
@@ -76,11 +76,18 @@
:split(area)
end

+function Header:host()
+ if ya.target_family() ~= "unix" then
+ return ui.Line {}
Expand All @@ -249,15 +252,12 @@ Copy the [`Header:render()` method](https://github.com/sxyazi/yazi/blob/latest/y
function Header:render(area)
self.area = area

@@ -6,7 +13,7 @@
:constraints({ ui.Constraint.Percentage(50), ui.Constraint.Percentage(50) })
:split(area)

- local left = ui.Line { self:cwd() }
+ local left = ui.Line { self:host(), self:cwd() }
local right = ui.Line { self:tabs() }
local right = ui.Line { self:count(), self:tabs() }
- local left = ui.Line { self:cwd(math.max(0, area.w - right:width())) }
+ local left = ui.Line { self:host(), self:cwd(math.max(0, area.w - right:width())) }
return {
ui.Paragraph(chunks[1], { left }),
ui.Paragraph(area, { left }),
ui.Paragraph(area, { right }):align(ui.Paragraph.RIGHT),
```

## Make Yazi even faster than fast
Expand Down

0 comments on commit 03ff15e

Please sign in to comment.