sayanarijit / xplr

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

cargo: Revert version update on `ansi-to-tui` #702

Closed har7an closed 8 months ago

har7an commented 8 months ago

which apparently causes custom styling to be lost on the currently selected line.

I noticed that the last version increase contained a bunch of dependency updates (#700). One of the updated dependencies was ansi-to-tui, which had a major version increase from 3 to 4. Unfortunately their Changelog isn't up to date, but in the Git history I found this commit which, as far as I can tell, changes the handling of the reset ANSI code, probably justifying the major version increase.

Before the update (or with this patch applied), my active line looks like this:

image

whereas with the current version, I get this:

image

As far as I can tell this change was introduced in 9db8b2cc190c98e532cf511cc9c1b39663f1343b, but at a quick glance I don't see an immediate connection between the code added there and the theming issues I experience now (apart from the version bump in ansi-to-tui). Maybe the code needs to be patched, or the theming in my config is broken? In any case, this PR "fixes" the issue for me.

sayanarijit commented 8 months ago

Thanks for the PR. We might be doing something wrong. I think it's better to fix the actual issue rather than pinning the dependency, since the related breaking change is supposed to be a fix, than a bug.

sayanarijit commented 8 months ago

It's hard to argue what should be the ideal case. Digging deeper, the whole Reset implementation in ratatui feels a bit weird. It's considered as a "color", and not a modifier, but I think it should be its own unique category (neither color, nor modifier). Let's merge this for now as a practical workaround, but maybe creating a discussion (maybe in ratatui) would be a better long term solution.