sayanarijit / xplr

A hackable, minimal, fast TUI file explorer
https://xplr.dev
MIT License
4.08k stars 74 forks source link

style being ignored #640

Closed JosefLitos closed 1 year ago

JosefLitos commented 1 year ago

I tried to customize the colors to match my NvimTree looks, but it seems that some options ignore their style setting.

try:

xplr.config.general.selection.item.style = {fg = "Magenta", add_modifiers = {"Underlined"}}
xplr.config.general.table.row.style = {fg = "Magenta"}
xplr.config.general.table.row.cols = {
    {format = "builtin.fmt_general_table_row_cols_1", style = {fg = "Magenta"}},
    {format = "builtin.fmt_general_table_row_cols_0", style = {fg = "Magenta"}},
}
xplr.config.general.table.header.cols = {{format = "│", style = {fg = "Magenta"}}}
xplr.config.general.table.tree = {
    {format = "│", style = {fg = "Magenta"}},
    {format = "│", style = {fg = "Magenta"}},
    {format = "└", style = {fg = "Magenta"}},
}
sayanarijit commented 1 year ago

For files, LS_COLORS and the style defined in xplr config.node_types will override ui style.

JosefLitos commented 1 year ago

I haven't changed anything in the node_types section, though. The defaults look to me as nothing special is being set. Although I am not sure if that is what you meant, or if that was just file specific. Also, what does file refer to - filename being displayed?

sayanarijit commented 1 year ago

Right... If you can post a screenshot marking the regions with issue, would be great for debugging.

sayanarijit commented 1 year ago

Pushed some fixes to https://github.com/sayanarijit/xplr/commit/d01b6f0cd4bc380836958ddef91d74705e4ea7e5, though, I'm not sure if this will fix everything. Since the priority for these styles are lower than per file specific style ($LS_COLORS and node_types).

JosefLitos commented 1 year ago

It should be obvious when you apply the provided configuration - nothing is magenta although multiple things should be.

I added "Underline" to the selection to emphasize that it truly ignores the entire style table. Anyway, here is the picture:

image

sayanarijit commented 1 year ago

Try these changes with

LS_COLORS="" xplr -C styles.lua
sayanarijit commented 1 year ago

Pushed another fix: https://github.com/sayanarijit/xplr/commit/f440b56fe6a1f9bee72cc97cbc879477e95554d7

JosefLitos commented 1 year ago

Everything works with latest commit, except the table.tree styles. (I updated the config to include those a little later)

Also, this is probably intentional, but could the tree chars be rendered as a separate column? currently it disappears when fmt_general_table_row_cols_1 is not used (not a problem - everyone needs to know the filenames, but just an idea). That way filename column style wouldn't be applied to the tree marks.

sayanarijit commented 1 year ago

~Good point. Let's see how to do it.~

Actually, a separate column won't probably work, since it'd be too far in a wide screen.

sayanarijit commented 1 year ago

BTW, we're going to port the default Lua functions to the Rust side as built-in defaults for performance. So, let's wait for the new implementation.

JosefLitos commented 1 year ago

Sounds great. Thanks for the quick responses.

sayanarijit commented 1 year ago

Closing this wrt https://github.com/sayanarijit/xplr/issues/641