YS-L / csvlens

Command line csv viewer
MIT License
2.49k stars 40 forks source link

Horizontal scrolling #11

Closed elferherrera closed 3 months ago

elferherrera commented 2 years ago

Is it planned to have horizontal scrolling?

YS-L commented 2 years ago

Do you mean scrolling horizontally by one window instead of one column? I just added support for this in main branch.

polarathene commented 4 months ago

cargo install csvlens, simple test file has an odd width set instead of what's available:

image

I was not able to scroll horizontally to view the contents of the third column "VALUE". Best I could manage was:

The other keys that are meant to help scroll don't seem to work for me. This is with a Fedora 40 Docker container running on Ubuntu 22.04 (via WSL2 on Windows Terminal). So perhaps something with the environment is off 🤷‍♂️

YS-L commented 4 months ago

@polarathene That is actually the expected behavior - horizontal scrolling here refers to scrolling the columns (e.g. showing more columns to the right) rather than scrolling the content within a column. The latter is not supported.

I'm curious whether the alternatives you mentioned work, or is there some reason they are not ideal? Feel free to open a new feature request.

polarathene commented 4 months ago

@polarathene That is actually the expected behavior

Is it also expected to truncate the third column there instead of using the available unused width? Did it reach an implicit max width for a column?

I'm curious whether the alternatives you mentioned work, or is there some reason they are not ideal?

They work, but:

I'd imagine that I could have pressed something to get a pop-over window rendered, overlaying the columns view to present the data in a more accessible manner, then return back to the column view to navigate to another cell and inspect that if the contents is quite long (may not be easy to tell though, beyond toggling wordwrap?).

YS-L commented 3 months ago

Is it also expected to truncate the third column there instead of using the available unused width? Did it reach an implicit max width for a column?

Yes, there is an implicit max width to prevent any columns from taking too much space, so that is expected. It can probably be improved though for cases like this where there are not many columns.

They work, but:

Indeed, Cell + Enter was intended for piping out of csvlens rather than viewing the content. I was mainly curious about the first two options, but I think what you said makes sense. Previewing a truncated cell had been requested by other users before, so it's probably something that will be useful but is currently missing.

Previewing in a pop-over window is an interesting idea, thanks! To clarify, are you referring to some kind of overlay that is near the selected cell, or something like a modal at the center of the screen that switches the focus entirely to the content of that particular cell?

YS-L commented 3 months ago

@polarathene I opened a separate issue for this: https://github.com/YS-L/csvlens/issues/83

Feel free to leave your comments there. I will close this issue since this was about something else that should be resolved now. Thanks again!