csvlens icon indicating copy to clipboard operation
csvlens copied to clipboard

Horizontal scrolling

Open elferherrera opened this issue 2 years ago • 1 comments

Is it planned to have horizontal scrolling?

elferherrera avatar Jun 15 '22 19:06 elferherrera

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

YS-L avatar Aug 07 '22 17:08 YS-L

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:

  • Pressing TAB to switch to column selection mode which allowed for > to increase width.
  • Typing - + S to toggle word wrap.
  • TAB to cell selection mode and pressing ENTER to quit with that cell output to STDOUT.

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 🤷‍♂️

polarathene avatar May 12 '24 11:05 polarathene

@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.

YS-L avatar May 13 '24 17:05 YS-L

@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:

  • > is rather tedious to increment the width, the line is quite long for the cell.
  • I can't recall any issue with the wordwrap off the top of my head, other than it feeling a bit awkward (I'm guessing this is vim/emacs inspired input, which I'm not familiar with).
  • Cell + ENTER ... well it takes me out of the viewer completely if I just wanted to see the full value and then check another cell.

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?).

polarathene avatar May 15 '24 12:05 polarathene

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 avatar May 16 '24 16:05 YS-L

@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!

YS-L avatar May 16 '24 16:05 YS-L