Repository navigation
Conversation
055a982 to
bf9bf92
Compare
|
I started using this today and it seems to work fine. Once I'm happy I haven't regressed anything, I'll merge it. Any additional testing help appreciated. |
|
The direct mode currently truncates lines unconditionally since that's easier to implement. Perhaps it can respond to the line wrapping too, or just enter the full screen mode if the user wants the wrapper behavior. |
|
I was thinking that direct mode should default to showing things wrapped. It doesn't make much sense to show things unwrapped there as the user can't scroll to the right. Probably it needs a config option, and probably we need to start thinking about a proper config file for streampager. |
|
Related to this. I wonder if we should make the text in the stderr panel wrapped by default. Internally, hintutil prints to there and some hints are quite long. |
f46b8f2 to
a8e639c
Compare
|
Some thoughts:
I'd be hesitant to add a configuration file because the complexity increases disproportionately, but it depends on just many options you think you'll need to grow over time. If you think it will be super simple declarative stuff forever then serde/TOML are pretty easy. However, I just started to move away from those in wezterm because I was feeling constrained when it came to eg: key assignments. I've switched to using lua and wrote some serde glue to keep it almost as simple as TOML to embed and map data to/from lua. This is likely overkill for a pager! |
|
I actually prefer non-wrapping by default, with the ability to wrap if needed. When viewing logs with timestamps at the left they don't get broken up by the wrapped lines, and the graph view in hg/git log also doesn't get chopped up. But I can see I might be unusual there, which is why I think it'll need to be config. The I actually wanted to add config files precisely for keymapping, which is what I planned to work on after wrapping is wrapped up. What problems did you hit that required using |
I kept wanting to use loops to emit bindings for numbers and function keys for jumping directly to tabs because it was a bit of a chore and repeaty to duplicate the lines. I also wanted to allow defining a callback to allow more complex actions; eg: press a single key and have it spawn a set of windows/tabs to re-establish a preferred workspace layout.
|
|
It's also not too difficult to implement some lisp-like language (with true lambda support, but no control flow |
When rendering direct to the terminal always wrap the text at grapheme cluster boundaries. Use the wrapped height reaching the terminal height for the trigger for when to jump to full screen mode.
Add `wrapping_mode` to the config, allowing callers to decide on the default wrapping mode. Users can still switch wrapping mode using the `\` key, this just sets the default. When `-X` is specified, default to line wrapping to match direct mode behaviour. Note that no environment variable is added to control this. We will add a config file to prevent proliferation of env vars.
This change rewrites the screen rendering algorithm to allow wrapping of lines. Lines can be wrapped at grapheme or word boundaries. The wrapping mode is controlled with the
\key.