Closed Zeioth closed 2 weeks ago
Hi, this is the expected behavior.
The bg
of separator_style
is used to control the "inner" area, while fg
is used to control the "outer" area:
Perhaps we can explore changing this behavior, but I'm not sure if there's a better way to achieve the current effect while also providing greater flexibility. Curious your thoughts!
Thank you for referencing the lua code. I've been able to fix it by changing the lines with style.bg
by THEME.status.separator_style.fg
Because I'm not using separators, in my case this is a good solution.
But yeah we probably want to have reserved words for this in yazi.toml
instead of reusing existing ones such as
[status]
size = { fg = "#c6d0f5", bg = "#414868" }
percentage = { fg = "#c6d0f5", bg = "#414868" }
or alternatively just
[status]
information = { fg = "#c6d0f5", bg = "#414868" }
I don't really want to use specific names like "size" or "percentage" to name them, because some users don't need to display size and percentage, and instead replace them with other content by rewriting the UI. At this point, "size" is no longer applicable. Is there a more abstract name available?
Then I would suggest grouping both (size and %) like
[status]
# this line would control the colors of the inner pills (by default, size and %)
information = { fg = "#c6d0f5", bg = "#414868" }
In the same way we currently group mode
and line_number
under mode_normal = { fg = "", bg = "" }
.
Maybe you prefer another most descriptive name instead like inner_pills
. That's up to your criteria.
@Zeioth Apologies for the noise. But how did you make the border work for 2 panes? The code at full-border only works for 3 borders and I can't make it work for 2 panes. Thanks in advance!
@kohane27 is just a modified version of the example you have in the docs
Paste this on your init.lua
and you will see the borders optimized for 2 columns:
function Manager:render(area)
local chunks = self:layout(area)
local bar = function(c, x, y)
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({
-- Borders
ui.Border(area, ui.Border.ALL):type(ui.Border.ROUNDED),
ui.Bar(chunks[1], ui.Bar.RIGHT),
ui.Bar(chunks[3], ui.Bar.LEFT),
-- Left vertical bar
bar("┌", chunks[1].right - 1, chunks[1].y),
bar("└", chunks[1].right - 1, chunks[1].bottom - 1),
-- Central vertical bar
bar("┬", chunks[2].right, chunks[2].y),
bar("┴", chunks[2].right, chunks[1].bottom - 1),
-- Right vertical bar
bar("┐", chunks[3].right - 1, chunks[3].y),
bar("┘", chunks[3].right - 1, chunks[1].bottom - 1),
-- Parent
Parent:render(chunks[1]:padding(ui.Padding.xy(1))),
-- Current
Current:render(chunks[2]:padding(ui.Padding.xy(1))),
-- Preview
Preview:render(chunks[3]:padding(ui.Padding.xy(1))),
})
end
You also need this on your yazi.toml
[manager]
ratio = [ 0, 4, 8 ]
I think I misunderstand the place for the discussion thus I am recommenting things in https://github.com/sxyazi/yazi/issues/1228#issuecomment-2196192386 and https://github.com/sxyazi/yazi/issues/1228#issuecomment-2196248087:
I will be glad if I can be any help. I think it will be good to divide that secondary area from mode area. Because it is connected with the mode area, adding normal, set and unset properties for that secondary area will be necessary.
Moreover, I think the main issue is with the separators as it has not already been using its style in separator close to the mode area. There are few things that can be done: """
- Straightforward option, adding each and every possible to its own style which means for 3 mode, 2 area and 2 side, there will be total of 12 style.
If sides (open and close) considered as a one in style section, it will reduce the total of styles to 6.
If mode area's separators left as it is, there wouldn't need for that area's separator with styles. Thus, it will reduce the total of styles to 3. More specifically, secondary area's normal, set and unset mode's separators.
If secondary area's separators styles works like the current mode area's separators style, separators will not need style properties.
Another approach is adding properties for separator. If some properties like separator_follow_mode and separator_follow_secondary which are take boolean values exist, they can be used as a bridge between 4th option and 1st or 2nd option.
If the modes are not considered it can greatly reduce the number of styles needed. Which means the other options can be applied without considering following modes styles.
""" In the end, I would recommend 4th because it is simplest one and will fill the needs for nearly all users. For comparing with lualine, I couldn't find a way to specifically set a unique color to separators. From what I understand it uses the component which are connected with it similar to the 4th option.
And for the color choosing, I would recommend using black as in terminal 16 colors in main area's foreground color and secondary area's background color as default. That's because unless user use light theme, it will be really best option. However, if the user selected their background color as black, the secondary area will mixed with the background. Also, it cannot have bright blue color because I checked some color schemes in here and I saw that most of the bright black color is not good with colors. Thus, I tried some colors in lualine with gruvbox color scheme and I think using black in both area's foreground, bright white in secondary area's background and mode area's background color as currently mode colors. It will be similar to this:
Let's reopen that issue and close this since that has a better description.
What system are you running Yazi on?
Linux Wayland
What terminal are you running Yazi in?
foot version: 1.17.2 +pgo +ime +graphemes -assertions
Did you try the latest code to see if this problem got fixed?
Tried, but the problem still
yazi --debug
outputDescribe the bug
The foreground color of
theme.toml > separator_style
seems to be ignored.If we try to set it to red![screenshot_2024-04-25_19-37-49_094409845](https://github.com/sxyazi/yazi/assets/3357792/77f0b415-8115-41d0-9d48-5e2123291146)
Only the background is affected, the foreground is ignored.![screenshot_2024-04-25_19-37-31_407510390](https://github.com/sxyazi/yazi/assets/3357792/575548ab-2589-4dce-80d1-279c1afa2a2e)
Expected Behavior
The foreground color specified in
theme.toml
is applied.To Reproduce
Copy this on
theme.toml
Configuration
No response
Anything else?
No response