Skip to content
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

Allow --width=0 to disable wordwrap #366

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

applejag
Copy link
Contributor

The wordwrapping makes it much more difficult to copy snippets from the terminal. Especially with code blocks.

The best option would be if I could disable wordwrap only for code blocks, but this is an easy long-hanging fruit.

@magnus-ISU
Copy link

Markdown shouldn't word wrap in code blocks at all, I think, though CommonMark should be checked.

I've not really used glow much myself because it doesn't seem to care about how markdown should be displayed (hard line breaks also aren't supported despite a PR existing for a month now? with no issues mentioned left to go) but I would suspect that the correct solution here too would be to not require an argument and just print markdown correctly.

I like the suggestion too though.

@4l1fe
Copy link

4l1fe commented Sep 7, 2022

Join. If i open with the pager -p less i can use it's option -S.

-S or --chop-long-lines
      Causes lines longer than the screen width to be  chopped  (truncated)  rather  than
      wrapped.  That is, the portion of a long line that does not fit in the screen width
      is not shown.  The default is to wrap long lines; that is, display the remainder on
      the next line.

@muesli muesli added the enhancement New feature or request label Oct 12, 2022
@caarlos0 caarlos0 merged commit 96d2a38 into charmbracelet:master Jul 11, 2024
8 of 11 checks passed
@caarlos0
Copy link
Member

thanks!

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 28, 2024
⚠️ **CAUTION: this is a major update, indicating a breaking change!** ⚠️

This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [charmbracelet/glow](https://github.com/charmbracelet/glow) | major | `v1.5.1` -> `v2.0.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>charmbracelet/glow (charmbracelet/glow)</summary>

### [`v2.0.0`](https://github.com/charmbracelet/glow/releases/tag/v2.0.0)

[Compare Source](charmbracelet/glow@v1.5.1...v2.0.0)

### Hello v2!

This release contains a massive amount of bug fixes and rendering improvements, many of which come by way of [Glamour v0.8.0](https://github.com/charmbracelet/glamour/releases/tag/v0.8.0) which was released a few weeks ago.

As a bonus, the latest version of Glamour includes support for Tokyo Night.

```bash
glow -s "tokyo-night"
```

<img alt="Tokyo Night x Glamour" src="https://github.com/charmbracelet/glamour/blob/master/styles/gallery/tokyo-night.png" width="600">

Additionally, the stash feature has been removed.

#### Changelog

##### New!

-   [`d89d79a`](charmbracelet/glow@d89d79a): feat: --preserve-new-lines ([#&#8203;623](charmbracelet/glow#623)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`b1d3772`](charmbracelet/glow@b1d3772): feat: add 'r' to refresh list and document ([#&#8203;624](charmbracelet/glow#624)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`96d2a38`](charmbracelet/glow@96d2a38): feat: allow --width=0 to disable wordwrap ([#&#8203;366](charmbracelet/glow#366)) ([@&#8203;applejag](https://github.com/applejag))
-   [`fe066f2`](charmbracelet/glow@fe066f2): feat: allow config from CHARM_CONFIG_HOME and XDG_CONFIG_HOME ([#&#8203;621](charmbracelet/glow#621)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`9ebe39c`](charmbracelet/glow@9ebe39c): feat: improve gitlab/github readme url ([#&#8203;456](charmbracelet/glow#456)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`f1cf0ba`](charmbracelet/glow@f1cf0ba): feat: man pages ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`597e56b`](charmbracelet/glow@597e56b): feat: open editor in current line ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`d7032fe`](charmbracelet/glow@d7032fe): feat: shell completions ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`2d5bd3b`](charmbracelet/glow@2d5bd3b): feat: show line numbers configuration option ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`0dcf127`](charmbracelet/glow@0dcf127): feat: suspend ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`c991ec4`](charmbracelet/glow@c991ec4): feat: use x/editor ([#&#8203;543](charmbracelet/glow#543)) ([@&#8203;caarlos0](https://github.com/caarlos0))

##### Fixed!

-   [`9c79fa1`](charmbracelet/glow@9c79fa1): fix(ci): remove soft-serve workflow ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))
-   [`bccf3d0`](charmbracelet/glow@bccf3d0): fix(ci): update coverage workflow ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))
-   [`08c564c`](charmbracelet/glow@08c564c): fix: --all bypass .gitignore rules ([#&#8203;285](charmbracelet/glow#285)) ([#&#8203;504](charmbracelet/glow#504)) ([@&#8203;aitva](https://github.com/aitva))
-   [`8e51396`](charmbracelet/glow@8e51396): fix: check other possible readme paths/branches ([#&#8203;450](charmbracelet/glow#450)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`1133e50`](charmbracelet/glow@1133e50): fix: config failing in tests ([#&#8203;625](charmbracelet/glow#625)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`2288311`](charmbracelet/glow@2288311): fix: do not hard fail if no config ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`821d51d`](charmbracelet/glow@821d51d): fix: do not show absolute path as note ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`247c707`](charmbracelet/glow@247c707): fix: glow URL ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`a1a8563`](charmbracelet/glow@a1a8563): fix: handle not being able to create log file ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`b80e831`](charmbracelet/glow@b80e831): fix: handle permission denied ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`54dd62a`](charmbracelet/glow@54dd62a): fix: handle running inside a snap ([#&#8203;527](charmbracelet/glow#527)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`ad01f38`](charmbracelet/glow@ad01f38): fix: improve line no ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`f44e5b5`](charmbracelet/glow@f44e5b5): fix: improve message ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`7e471f1`](charmbracelet/glow@7e471f1): fix: lint issue ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`e4cacf7`](charmbracelet/glow@e4cacf7): fix: mkdir cache dir ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`1407793`](charmbracelet/glow@1407793): fix: pass color profile down to glamour ([#&#8203;626](charmbracelet/glow#626)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`9a3f7a1`](charmbracelet/glow@9a3f7a1): fix: replace string concatenation in loop with string builder ([#&#8203;505](charmbracelet/glow#505)) ([@&#8203;appgurueu](https://github.com/appgurueu))
-   [`cd99146`](charmbracelet/glow@cd99146): fix: update codeowners ([#&#8203;637](charmbracelet/glow#637)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`3f9102d`](charmbracelet/glow@3f9102d): fix: yet another log handling fix ([@&#8203;caarlos0](https://github.com/caarlos0))

##### Deps

-   [`c89c8bd`](charmbracelet/glow@c89c8bd): feat: update glamour ([#&#8203;634](charmbracelet/glow#634)) ([@&#8203;caarlos0](https://github.com/caarlos0))
-   [`4578bc1`](charmbracelet/glow@4578bc1): feat: updating glamour ([#&#8203;631](charmbracelet/glow#631)) ([@&#8203;caarlos0](https://github.com/caarlos0))

##### Other Stuff

-   [`d2e7742`](charmbracelet/glow@d2e7742): chore(ci): enable gofumpt ([@&#8203;aymanbagabas](https://github.com/aymanbagabas))
-   [`736e77d`](charmbracelet/glow@736e77d): feat!: rename module to /v2 ([#&#8203;640](charmbracelet/glow#640)) ([@&#8203;caarlos0](https://github.com/caarlos0))

***

<details>
<summary>Verifying the artifacts</summary>

First, download the [`checksums.txt` file](https://github.com/charmbracelet/glow/releases/download/2.0.0/checksums.txt), for example, with `wget`:

```bash
wget 'https://github.com/charmbracelet/glow/releases/download/v2.0.0/checksums.txt'
```

Then, verify it using [`cosign`](https://github.com/sigstore/cosign):

```bash
cosign verify-blob \
  --certificate-identity 'https://github.com/charmbracelet/meta/.github/workflows/goreleaser.yml@refs/heads/main' \
  --certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \
  --cert 'https://github.com/charmbracelet/glow/releases/download/v2.0.0/checksums.txt.pem' \
  --signature 'https://github.com/charmbracelet/glow/releases/download/v2.0.0/checksums.txt.sig' \
  ./checksums.txt
```

If the output is `Verified OK`, you can safely use it to verify the checksums of other artifacts you downloaded from the release using `sha256sum`:

```bash
sha256sum --ignore-missing -c checksums.txt
```

Done! You artifacts are now verified!

</details>

<a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>

Thoughts? Questions? We love hearing from you. Feel free to reach out on [Twitter](https://twitter.com/charmcli), [The Fediverse](https://mastodon.technology/@&#8203;charm), or on [Discord](https://charm.sh/chat).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants