mike-ward / lsv

lsv - Vlang implementation of ls
MIT License
21 stars 2 forks source link

Remove blank line after every output line in long listing view #1

Closed Brixy closed 4 months ago

Brixy commented 4 months ago

Thank you for lsv and congrats! It's nice to see such a feature rich ls alternative in V.

As a V user I switched to lsv from eza and noticed a small glitch:

lsv -l draws a blank line after every "output line" if at least one line is longer than the number of columns in you terminal emulator.

This seems to be caused by the trailing spaces drawn after every output line (except the longest line).

mike-ward commented 4 months ago

Can you provide a screen shot?

Brixy commented 4 months ago

Of course. Here's 3 screen shots.

Tested in foot and kitty.

1


2


3

mike-ward commented 4 months ago

Looks like when there are no borders I need to trim the line. The extra spaces are added in case borders are specified. Obviously, when there are no borders, the extra spaces cause issues. Good find!

I think the third option is correct.

Brixy commented 4 months ago

Yes, this makes sense. Thanks!


For the case concerning the borders I have an idea. But this is not part of this issue, rather an enhancement, if this makes sense to you:

bat for example prints borders with the length of the number of columns of the terminal window. It becomes obvious when you increase the width of the window after printing file contents.

The case of a table in lsv is more complex. But it could be possible to achieve something similar if borders -- including pipes -- are truncated, if a line is longer than the number of columns.

bat1

bat2

Brixy commented 4 months ago

Wow. Your recent fixes and enhancements work perfectly. Thanks a lot.