Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output looks unbalanced when using '--style=grid,numbers' without 'header'. #571

Closed
eth-p opened this issue May 25, 2019 · 4 comments · Fixed by #579
Closed

Output looks unbalanced when using '--style=grid,numbers' without 'header'. #571

eth-p opened this issue May 25, 2019 · 4 comments · Fixed by #579
Labels
feature-request New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@eth-p
Copy link
Collaborator

eth-p commented May 25, 2019

The output looks a bit unbalanced when it's only printing the bottom horizontal line.

image

Would it make more sense to only print that final horizontal line when the header component is enabled?

@eth-p eth-p changed the title Output looks unbalanced when using '--style=grid,numbers' without header. Output looks unbalanced when using '--style=grid,numbers' without 'header'. May 25, 2019
@sharkdp
Copy link
Owner

sharkdp commented May 28, 2019

Thank you for reporting this. It does look unbalanced, I agree.

If we skip the line completely, we wouldn't have any separation between different files. I think we should rather add a line on top?

@sharkdp sharkdp added feature-request New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels May 28, 2019
@eth-p
Copy link
Collaborator Author

eth-p commented May 29, 2019

I think ideally we would use one of the following formats:

(All lines):

-----------------------------------
 1 | // This is file A
 2 | // ...
-----------------------------------
 1 | // This is file B
 2 | // ...
-----------------------------------

(Separator lines):

 1 | // This is file A
 2 | // ...
-----------------------------------
 1 | // This is file B
 2 | // ...

The all lines format would look better with multiple files, but it feels a bit excessive to add the horizontal separator lines at the top and bottom for only a single file. Maybe a hybrid approach that uses all lines if more than one input file is given, but no lines otherwise?

$bat fileA.txt
 1 | // This is file A
 2 | // ...

$bat fileA.txt fileB.txt
-----------------------------------
 1 | // This is file A
 2 | // ...
-----------------------------------
 1 | // This is file B
 2 | // ...
-----------------------------------

@sharkdp
Copy link
Owner

sharkdp commented May 31, 2019

I think I actually prefer option 1: all lines. Let's print a grid if the user asks for it 😄

@sharkdp
Copy link
Owner

sharkdp commented Aug 31, 2019

Fixed in bat v0.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants