Skip to content

Conversation

eMPee584
Copy link
Contributor

Fixes #3016

How to fix the code duplication? 🤔

Copy link
Member

@toonn toonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this change. Isn't the point of the ACS_* characters that terminal emulators are allowed to draw actual lines rather than characters? So using normal characters for the corners might end up with a weird, continuous line, bit of whitespace around a corner character that doesn't necessarily match the line thickness, etc., no?

You could refactor it into a separate module if you want.

Another option for the setting is we could add a list as the value of draw_borders, boolean values would have the same behavior as now but passing a list would have Ranger use those characters for the corners (probably best to include all the possible line drawing characters, vertical, horizontal, crossing, various T crossings).

@toonn
Copy link
Member

toonn commented Mar 20, 2025

@eMPee584, what do you think of the suggestion of accepting a list of border-drawing characters?

@eMPee584
Copy link
Contributor Author

[…] I've included this in the patch series I posted and removed the duplication by moving _draw_border_rectangle() to view_base. Reading your suggestions again @toonn, I'm all in favor of generalizing it to other border character sets (like double line or bold) but (in favor of 80/20 efficiency) would consider that a rather rare use case and choose to postpone implementation of these until anyone actually needs / asks for it. Would you agree that's a sensible approach? 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question] Borders customization
2 participants