refactor!: switch to th (#87)

This commit is contained in:
三咲雅 · Misaki Masa
2025-03-12 19:33:37 +08:00
committed by GitHub
parent 1aa9cf7e34
commit 2a35325c7f
2 changed files with 19 additions and 19 deletions

View File

@@ -39,38 +39,38 @@ run = "git"
You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with: You can customize the [Style](https://yazi-rs.github.io/docs/plugins/layout#style) of the status sign with:
- `THEME.git.modified` - `th.git.modified`
- `THEME.git.added` - `th.git.added`
- `THEME.git.untracked` - `th.git.untracked`
- `THEME.git.ignored` - `th.git.ignored`
- `THEME.git.deleted` - `th.git.deleted`
- `THEME.git.updated` - `th.git.updated`
For example: For example:
```lua ```lua
-- ~/.config/yazi/init.lua -- ~/.config/yazi/init.lua
THEME.git = THEME.git or {} th.git = th.git or {}
THEME.git.modified = ui.Style():fg("blue") th.git.modified = ui.Style():fg("blue")
THEME.git.deleted = ui.Style():fg("red"):bold() th.git.deleted = ui.Style():fg("red"):bold()
``` ```
You can also customize the text of the status sign with: You can also customize the text of the status sign with:
- `THEME.git.modified_sign` - `th.git.modified_sign`
- `THEME.git.added_sign` - `th.git.added_sign`
- `THEME.git.untracked_sign` - `th.git.untracked_sign`
- `THEME.git.ignored_sign` - `th.git.ignored_sign`
- `THEME.git.deleted_sign` - `th.git.deleted_sign`
- `THEME.git.updated_sign` - `th.git.updated_sign`
For example: For example:
```lua ```lua
-- ~/.config/yazi/init.lua -- ~/.config/yazi/init.lua
THEME.git = THEME.git or {} th.git = th.git or {}
THEME.git.modified_sign = "M" th.git.modified_sign = "M"
THEME.git.deleted_sign = "D" th.git.deleted_sign = "D"
``` ```
## License ## License

View File

@@ -138,7 +138,7 @@ local function setup(st, opts)
opts = opts or {} opts = opts or {}
opts.order = opts.order or 1500 opts.order = opts.order or 1500
local t = THEME.git or {} local t = th.git or {}
local styles = { local styles = {
[CODES.ignored] = t.ignored and ui.Style(t.ignored) or ui.Style():fg("darkgray"), [CODES.ignored] = t.ignored and ui.Style(t.ignored) or ui.Style():fg("darkgray"),
[CODES.untracked] = t.untracked and ui.Style(t.untracked) or ui.Style():fg("magenta"), [CODES.untracked] = t.untracked and ui.Style(t.untracked) or ui.Style():fg("magenta"),