Skip to content

feat: add borderstyle option - #2445

Merged
CatsDeservePets merged 17 commits into
gokcehan:masterfrom
CatsDeservePets:drawborders
Mar 21, 2026
Merged

CatsDeservePets merged 17 commits into
gokcehan:masterfrom
CatsDeservePets:drawborders

Conversation

@CatsDeservePets

@CatsDeservePets CatsDeservePets commented Mar 20, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds a new option borderstyle. It extends the capabilities of lf's drawbox option to allow for ranger like border designs.

The following values are allowed: box (default), roundbox (replaces set roundbox), round, outline, roundoutline and separators.

[nodrawbox] separators
off separators
box outline
box outline
roundbox roundoutline
roundbox roundoutline
Previous Description

This PR is essentially a 1:1 implementation of ranger's draw_borders option and should not be considered finale.

From ranger's man page:

draw_borders [string]
Draw borders around or between the columns? Possible values are:

none           no borders of any sort
outline        draw an outline around all the columns
separators     draw only vertical lines between columns
both           both of the above

set draw_borders none equals set drawbox false/set nodrawbox
set draw_borders both equals set drawbox true/set drawbox
Note: set draw_borders equals set drawbox false/set nodrawbox (ranger interprets it as an empty string which is equal to none)

Due to the existing drawbox option being of type bool, extending it while maintaining backward compatibility would be awkward.

Therefore, it was suggested to deprecate it in favour of a new enum option. However, this goes against lfs philosophy and I consider drawbox being a core feature of lf.

none outline
none outline
separators both
separators both

@CatsDeservePets CatsDeservePets added new Pull requests that add new behavior breaking Pull requests that introduce breaking changes labels Mar 20, 2026
@CatsDeservePets

CatsDeservePets commented Mar 20, 2026 •

Copy link
Copy Markdown
Collaborator Author

Hello @joelim-work! What are your thoughts on this?

@joelim-work joelim-work left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My main concern with this exact implementation is that removing drawbox is a breaking change, and I expect there to be many users as well. Now you can no longer toggle borders using something like set drawbox!. I am probably fine with another enum string option like borderstyle or similar that takes effect only if drawbox is enabled, and perhaps it could be merged with roundbox too.

@CatsDeservePets CatsDeservePets added this to the r42 milestone Mar 20, 2026
@CatsDeservePets
CatsDeservePets marked this pull request as ready for review March 20, 2026 14:35
@CatsDeservePets CatsDeservePets changed the title feat: add Ranger like drawborders option feat: add borderstyle option Mar 20, 2026

@joelim-work joelim-work left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, I had a couple of very minor comments but they are very trivial. Free free to merge.

Comment thread eval.go
Comment thread opts.go Outdated
@CatsDeservePets
CatsDeservePets merged commit f1a1097 into gokcehan:master Mar 21, 2026
32 checks passed
@CatsDeservePets
CatsDeservePets deleted the drawborders branch March 22, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Pull requests that introduce breaking changes new Pull requests that add new behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature request] Equivalent of Ranger's set draw_borders separators setting

2 participants