-
Notifications
You must be signed in to change notification settings - Fork 36
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
[Feature request] Add option to control or disable indentation of paragraphs in terminal output #129
Comments
If you have control of the software from source, you can edit term.h line 167 to be
This is the style applied by terminal output to regular text. I think a better feature request would be to read in a file, if provided, that styles the text in a non-hard-coded way. |
Thanks for the response! Honestly, in my opinion the details of the implementation for this feature don't matter that much from the end user point of view: it could be a command line flag, it could be a user-provided file containing information about the style, it could be some sort of configuration file in |
I'm needing this too. I'm using lowdown to preview files in fzf, but the indentation really breaks things apart. There's the Should the value of |
Ok, a more elegant fix is in the works. First, I'm introducing --term-hpadding, which does what the default term.h body value did: introduce a left-padding that cuts into the --term-width. It defaults to 4 to preserve existing layouts. While here, I fixed some off-by-ones for cleaner output and am also clarifying:
At some point, I want to introduce RTL capabilities, so this isn't quite future-proof yet, as --term-hmargin and --term-padding don't affect the right-hand side of the output. |
This introduces an ABI change to `struct lowdown_opts`. Split out the terminal-related members of `lowdown_opts` into `lowdown_opts_term` and push processing of its variables directly into term.c, where it belongs. References #129
Would it be possible to add a command line option which disables the indentation of normal paragraphs in
-tterm
output? I'm thinking about something like--term-no-indent
for disabling indentation globally, or--term-indent=code,lists,paragraphs,tables...
to specify exactly what should be indented if we need more granularity.My use case for this is using lowdown for previewing markdown files in vifm (but I guess the same applies for almost every terminal file manager), and having so much empty space between the file list and the preview looks ugly and needlessly shrinks the space for the actual text (I'm attaching a couple of screenshots to show what I mean). I know that I could just pipe the output into
sed 's/^ *//g'
to remove the leading white spaces, but this lacks granularity (it doesn't differentiate between paragraphs, lists, code blocks etc.) and needs an external utility to accomplish something that IMO could be an option in lowdown itself.Anyway, thanks for the great piece of software!
The text was updated successfully, but these errors were encountered: