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

Add --max-syntax-highlighting-length, set to 400 #1746

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

th1000s
Copy link
Collaborator

@th1000s th1000s commented Jul 10, 2024

  • Add --max-syntax-highlighting-length, set to 400

    --max-line-length increased to 3000, highlighting now stops after 400
    characters. In that case the highlighting may be incorrect until it
    is reset for the next hunk.

  • Add truncate_str_short() which always returns a prefix of the input

    Document that the input of truncate_str() may be cut on a double width
    char ("fullwidth") - then the output is no longer a prefix of the input.

    truncate_str_short() could be faster by not constructing the result and
    instead only returning an index, but it will be used in rare edge cases so
    reusing existing logic is good enough.

    Common code moved to truncate_str_impl().

    Assume (with fallback) that graphemes are at most 2 wide.
    Fewer allocations.
    Tests.


See #290

Some rough benchmarking shows it is faster when truncating lines. But note that this has a good chance of ruining the highlighting of the following lines.

@th1000s th1000s mentioned this pull request Jul 10, 2024
Document that the input of `truncate_str()` may be cut on a double width
char ("fullwidth") - then the output is no longer a prefix of the input.

`truncate_str_short()` could be faster by not constructing the result and
instead only returning an index, but it will be used in rare edge cases so
reusing existing logic is good enough.

Common code moved to `truncate_str_impl()`.

Assume (with fallback) that graphemes are at most 2 wide.
Fewer allocations.
Tests.
@th1000s th1000s changed the title Add --max-syntax-highlighting-length Add --max-syntax-highlighting-length, set to 400 Jul 21, 2024
@th1000s th1000s marked this pull request as ready for review July 21, 2024 19:11
src/cli.rs Outdated
)]
/// Stop syntax highlighting lines after this many characters.
///
/// To always highlighting entire lines set to zero - but note that delta will be slow on very
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// To always highlighting entire lines set to zero - but note that delta will be slow on very
/// To always highlight entire lines set to zero - but note that delta will be slow on very

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Ignore, I made this change and force-pushed to your last commit)

--max-line-length increased to 3000, highlighting now stops after 400
characters. In that case the highlighting may be incorrect until it
is reset for the next hunk.
@dandavison dandavison merged commit 21695da into dandavison:main Jul 22, 2024
13 checks passed
@dandavison
Copy link
Owner

Great, thanks! I tried it out a bit manually and I see (as you said somewhere else) that incorrect highlighting after a truncated line is quite common both on this branch and released main. (Is it feasible to fix that by resetting the highlighter manually in such cases?)

@th1000s
Copy link
Collaborator Author

th1000s commented Jul 31, 2024

HighlightLines itself doesn't provide a reset option, so the between-hunks resetting has to be made available in the relevant function. And it could still be wrong if an opening quote is never closed. Other options would be to tolerate one or two overly long lines here and there, and/or to not even start highlighting those lines. I'd wait and see for now, I think these lines are quite rare :)

tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 20, 2024
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [dandavison/delta](https://github.com/dandavison/delta) | minor | `0.17.0` -> `0.18.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>dandavison/delta (dandavison/delta)</summary>

### [`v0.18.0`](https://github.com/dandavison/delta/releases/tag/0.18.0)

[Compare Source](dandavison/delta@0.17.0...0.18.0)

As usual, tons of excellent contributions, all but one not by me! [@&#8203;th1000s](https://github.com/th1000s) has made a huge number of important and difficult improvements to delta and helped with many issues over the few years since the project started, and so I'm happy to say that he's co-maintaining the project with me nowadays. Thanks to all contributors for the improvements below!

#### What's Changed

-   Link to Repository from Manual by [@&#8203;bash](https://github.com/bash) in dandavison/delta#1657
-   Stop highlighting unchanged whitespace by [@&#8203;phillipwood](https://github.com/phillipwood) in dandavison/delta#1659
-   Add .gitattributes rules for rust files by [@&#8203;phillipwood](https://github.com/phillipwood) in dandavison/delta#1245
-   Repair --default-language, and highlight using full filename by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1549
-   tests: prevent parallel env var access by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1681
-   CI: fix macOS build by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1696
-   Only use `nosort` in bash <4.4 by [@&#8203;martinml](https://github.com/martinml) in dandavison/delta#1683
-   Don't read git files when --no-gitconfig is given + unused variables by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1728
-   tests: add insta for snapshot testing by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1739
-   tests: set terminal width to 43 by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1741
-   Fix panic when blame-palette is empty by [@&#8203;thorio](https://github.com/thorio) in dandavison/delta#1737
-   Make relative-paths work with binary files by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1740
-   Fix github links from master to main by [@&#8203;madeddie](https://github.com/madeddie) in dandavison/delta#1709
-   Update `terminal-colorsaurus` by [@&#8203;bash](https://github.com/bash) in dandavison/delta#1699
-   Make less version >= 633 behave like previous versions wrt. Nerd Fonts by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1762
-   Update `catppuccin-latte` casing in `LIGHT_SYNTAX_THEMES` list by [@&#8203;injust](https://github.com/injust) in dandavison/delta#1745
-   deps: bump libc from 0.2.153 to 0.2.155 by [@&#8203;wxpppp](https://github.com/wxpppp) in dandavison/delta#1715
-   Add missing `--file-*-label` option to `--navigate` docs by [@&#8203;injust](https://github.com/injust) in dandavison/delta#1744
-   Fix copy-paste typo by [@&#8203;injust](https://github.com/injust) in dandavison/delta#1767
-   Update syntect to 5.2.0 by [@&#8203;timhillgit](https://github.com/timhillgit) in dandavison/delta#1672
-   Disable light mode detection in tests by [@&#8203;bash](https://github.com/bash) in dandavison/delta#1765
-   Add --max-syntax-highlighting-length, set to 400 by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1746
-   chore: cleanup brew formula file in favor of core tap by [@&#8203;chenrui333](https://github.com/chenrui333) in dandavison/delta#1773
-   wrap --help output, fix rust 1.80 build by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1440
-   Fix delta-toggle shell script by [@&#8203;dandavison](https://github.com/dandavison) in dandavison/delta#1794
-   Do not wrap short help (-h) output by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1800
-   Implement --diff-args by [@&#8203;dandavison](https://github.com/dandavison) in dandavison/delta#1697
-   Handle ambiguous diff header, '--- ' can also be present in a minus hunk by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1787
-   cd: build binaries targeting GNU libc on ubuntu-20.04, not latest by [@&#8203;th1000s](https://github.com/th1000s) in dandavison/delta#1805

#### New Contributors

-   [@&#8203;martinml](https://github.com/martinml) made their first contribution in dandavison/delta#1683
-   [@&#8203;thorio](https://github.com/thorio) made their first contribution in dandavison/delta#1737
-   [@&#8203;madeddie](https://github.com/madeddie) made their first contribution in dandavison/delta#1709
-   [@&#8203;injust](https://github.com/injust) made their first contribution in dandavison/delta#1745
-   [@&#8203;wxpppp](https://github.com/wxpppp) made their first contribution in dandavison/delta#1715
-   [@&#8203;timhillgit](https://github.com/timhillgit) made their first contribution in dandavison/delta#1672
-   [@&#8203;chenrui333](https://github.com/chenrui333) made their first contribution in dandavison/delta#1773

**Full Changelog**: dandavison/delta@0.17.0...0.18.0

</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=-->
renovate bot referenced this pull request in d-issy/dotfiles Aug 23, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [dandavison/delta](https://togithub.com/dandavison/delta) | minor |
`0.17.0` -> `0.18.0` |

---

### Release Notes

<details>
<summary>dandavison/delta (dandavison/delta)</summary>

###
[`v0.18.0`](https://togithub.com/dandavison/delta/releases/tag/0.18.0)

[Compare
Source](https://togithub.com/dandavison/delta/compare/0.17.0...0.18.0)

As usual, tons of excellent contributions, all but one not by me!
[@&#8203;th1000s](https://togithub.com/th1000s) has made a huge number
of important and difficult improvements to delta and helped with many
issues over the few years since the project started, and so I'm happy to
say that he's co-maintaining the project with me nowadays. Thanks to all
contributors for the improvements below!

#### What's Changed

- Link to Repository from Manual by
[@&#8203;bash](https://togithub.com/bash) in
[https://github.com/dandavison/delta/pull/1657](https://togithub.com/dandavison/delta/pull/1657)
- Stop highlighting unchanged whitespace by
[@&#8203;phillipwood](https://togithub.com/phillipwood) in
[https://github.com/dandavison/delta/pull/1659](https://togithub.com/dandavison/delta/pull/1659)
- Add .gitattributes rules for rust files by
[@&#8203;phillipwood](https://togithub.com/phillipwood) in
[https://github.com/dandavison/delta/pull/1245](https://togithub.com/dandavison/delta/pull/1245)
- Repair --default-language, and highlight using full filename by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1549](https://togithub.com/dandavison/delta/pull/1549)
- tests: prevent parallel env var access by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1681](https://togithub.com/dandavison/delta/pull/1681)
- CI: fix macOS build by [@&#8203;th1000s](https://togithub.com/th1000s)
in
[https://github.com/dandavison/delta/pull/1696](https://togithub.com/dandavison/delta/pull/1696)
- Only use `nosort` in bash <4.4 by
[@&#8203;martinml](https://togithub.com/martinml) in
[https://github.com/dandavison/delta/pull/1683](https://togithub.com/dandavison/delta/pull/1683)
- Don't read git files when --no-gitconfig is given + unused variables
by [@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1728](https://togithub.com/dandavison/delta/pull/1728)
- tests: add insta for snapshot testing by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1739](https://togithub.com/dandavison/delta/pull/1739)
- tests: set terminal width to 43 by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1741](https://togithub.com/dandavison/delta/pull/1741)
- Fix panic when blame-palette is empty by
[@&#8203;thorio](https://togithub.com/thorio) in
[https://github.com/dandavison/delta/pull/1737](https://togithub.com/dandavison/delta/pull/1737)
- Make relative-paths work with binary files by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1740](https://togithub.com/dandavison/delta/pull/1740)
- Fix github links from master to main by
[@&#8203;madeddie](https://togithub.com/madeddie) in
[https://github.com/dandavison/delta/pull/1709](https://togithub.com/dandavison/delta/pull/1709)
- Update `terminal-colorsaurus` by
[@&#8203;bash](https://togithub.com/bash) in
[https://github.com/dandavison/delta/pull/1699](https://togithub.com/dandavison/delta/pull/1699)
- Make less version >= 633 behave like previous versions wrt. Nerd Fonts
by [@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1762](https://togithub.com/dandavison/delta/pull/1762)
- Update `catppuccin-latte` casing in `LIGHT_SYNTAX_THEMES` list by
[@&#8203;injust](https://togithub.com/injust) in
[https://github.com/dandavison/delta/pull/1745](https://togithub.com/dandavison/delta/pull/1745)
- deps: bump libc from 0.2.153 to 0.2.155 by
[@&#8203;wxpppp](https://togithub.com/wxpppp) in
[https://github.com/dandavison/delta/pull/1715](https://togithub.com/dandavison/delta/pull/1715)
- Add missing `--file-*-label` option to `--navigate` docs by
[@&#8203;injust](https://togithub.com/injust) in
[https://github.com/dandavison/delta/pull/1744](https://togithub.com/dandavison/delta/pull/1744)
- Fix copy-paste typo by [@&#8203;injust](https://togithub.com/injust)
in
[https://github.com/dandavison/delta/pull/1767](https://togithub.com/dandavison/delta/pull/1767)
- Update syntect to 5.2.0 by
[@&#8203;timhillgit](https://togithub.com/timhillgit) in
[https://github.com/dandavison/delta/pull/1672](https://togithub.com/dandavison/delta/pull/1672)
- Disable light mode detection in tests by
[@&#8203;bash](https://togithub.com/bash) in
[https://github.com/dandavison/delta/pull/1765](https://togithub.com/dandavison/delta/pull/1765)
- Add --max-syntax-highlighting-length, set to 400 by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1746](https://togithub.com/dandavison/delta/pull/1746)
- chore: cleanup brew formula file in favor of core tap by
[@&#8203;chenrui333](https://togithub.com/chenrui333) in
[https://github.com/dandavison/delta/pull/1773](https://togithub.com/dandavison/delta/pull/1773)
- wrap --help output, fix rust 1.80 build by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1440](https://togithub.com/dandavison/delta/pull/1440)
- Fix delta-toggle shell script by
[@&#8203;dandavison](https://togithub.com/dandavison) in
[https://github.com/dandavison/delta/pull/1794](https://togithub.com/dandavison/delta/pull/1794)
- Do not wrap short help (-h) output by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1800](https://togithub.com/dandavison/delta/pull/1800)
- Implement --diff-args by
[@&#8203;dandavison](https://togithub.com/dandavison) in
[https://github.com/dandavison/delta/pull/1697](https://togithub.com/dandavison/delta/pull/1697)
- Handle ambiguous diff header, '--- ' can also be present in a minus
hunk by [@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1787](https://togithub.com/dandavison/delta/pull/1787)
- cd: build binaries targeting GNU libc on ubuntu-20.04, not latest by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1805](https://togithub.com/dandavison/delta/pull/1805)

#### New Contributors

- [@&#8203;martinml](https://togithub.com/martinml) made their first
contribution in
[https://github.com/dandavison/delta/pull/1683](https://togithub.com/dandavison/delta/pull/1683)
- [@&#8203;thorio](https://togithub.com/thorio) made their first
contribution in
[https://github.com/dandavison/delta/pull/1737](https://togithub.com/dandavison/delta/pull/1737)
- [@&#8203;madeddie](https://togithub.com/madeddie) made their first
contribution in
[https://github.com/dandavison/delta/pull/1709](https://togithub.com/dandavison/delta/pull/1709)
- [@&#8203;injust](https://togithub.com/injust) made their first
contribution in
[https://github.com/dandavison/delta/pull/1745](https://togithub.com/dandavison/delta/pull/1745)
- [@&#8203;wxpppp](https://togithub.com/wxpppp) made their first
contribution in
[https://github.com/dandavison/delta/pull/1715](https://togithub.com/dandavison/delta/pull/1715)
- [@&#8203;timhillgit](https://togithub.com/timhillgit) made their first
contribution in
[https://github.com/dandavison/delta/pull/1672](https://togithub.com/dandavison/delta/pull/1672)
- [@&#8203;chenrui333](https://togithub.com/chenrui333) made their first
contribution in
[https://github.com/dandavison/delta/pull/1773](https://togithub.com/dandavison/delta/pull/1773)

**Full Changelog**:
dandavison/delta@0.17.0...0.18.0

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

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

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

---

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

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job log](https://developer.mend.io/github/d-issy/dotfiles).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
izumin5210 referenced this pull request in izumin5210/dotfiles Aug 31, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [dandavison/delta](https://togithub.com/dandavison/delta) | minor |
`0.17.0` -> `0.18.0` |

---

### Release Notes

<details>
<summary>dandavison/delta (dandavison/delta)</summary>

###
[`v0.18.0`](https://togithub.com/dandavison/delta/releases/tag/0.18.0)

[Compare
Source](https://togithub.com/dandavison/delta/compare/0.17.0...0.18.0)

As usual, tons of excellent contributions, all but one not by me!
[@&#8203;th1000s](https://togithub.com/th1000s) has made a huge number
of important and difficult improvements to delta and helped with many
issues over the few years since the project started, and so I'm happy to
say that he's co-maintaining the project with me nowadays. Thanks to all
contributors for the improvements below!

#### What's Changed

- Link to Repository from Manual by
[@&#8203;bash](https://togithub.com/bash) in
[https://github.com/dandavison/delta/pull/1657](https://togithub.com/dandavison/delta/pull/1657)
- Stop highlighting unchanged whitespace by
[@&#8203;phillipwood](https://togithub.com/phillipwood) in
[https://github.com/dandavison/delta/pull/1659](https://togithub.com/dandavison/delta/pull/1659)
- Add .gitattributes rules for rust files by
[@&#8203;phillipwood](https://togithub.com/phillipwood) in
[https://github.com/dandavison/delta/pull/1245](https://togithub.com/dandavison/delta/pull/1245)
- Repair --default-language, and highlight using full filename by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1549](https://togithub.com/dandavison/delta/pull/1549)
- tests: prevent parallel env var access by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1681](https://togithub.com/dandavison/delta/pull/1681)
- CI: fix macOS build by [@&#8203;th1000s](https://togithub.com/th1000s)
in
[https://github.com/dandavison/delta/pull/1696](https://togithub.com/dandavison/delta/pull/1696)
- Only use `nosort` in bash <4.4 by
[@&#8203;martinml](https://togithub.com/martinml) in
[https://github.com/dandavison/delta/pull/1683](https://togithub.com/dandavison/delta/pull/1683)
- Don't read git files when --no-gitconfig is given + unused variables
by [@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1728](https://togithub.com/dandavison/delta/pull/1728)
- tests: add insta for snapshot testing by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1739](https://togithub.com/dandavison/delta/pull/1739)
- tests: set terminal width to 43 by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1741](https://togithub.com/dandavison/delta/pull/1741)
- Fix panic when blame-palette is empty by
[@&#8203;thorio](https://togithub.com/thorio) in
[https://github.com/dandavison/delta/pull/1737](https://togithub.com/dandavison/delta/pull/1737)
- Make relative-paths work with binary files by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1740](https://togithub.com/dandavison/delta/pull/1740)
- Fix github links from master to main by
[@&#8203;madeddie](https://togithub.com/madeddie) in
[https://github.com/dandavison/delta/pull/1709](https://togithub.com/dandavison/delta/pull/1709)
- Update `terminal-colorsaurus` by
[@&#8203;bash](https://togithub.com/bash) in
[https://github.com/dandavison/delta/pull/1699](https://togithub.com/dandavison/delta/pull/1699)
- Make less version >= 633 behave like previous versions wrt. Nerd Fonts
by [@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1762](https://togithub.com/dandavison/delta/pull/1762)
- Update `catppuccin-latte` casing in `LIGHT_SYNTAX_THEMES` list by
[@&#8203;injust](https://togithub.com/injust) in
[https://github.com/dandavison/delta/pull/1745](https://togithub.com/dandavison/delta/pull/1745)
- deps: bump libc from 0.2.153 to 0.2.155 by
[@&#8203;wxpppp](https://togithub.com/wxpppp) in
[https://github.com/dandavison/delta/pull/1715](https://togithub.com/dandavison/delta/pull/1715)
- Add missing `--file-*-label` option to `--navigate` docs by
[@&#8203;injust](https://togithub.com/injust) in
[https://github.com/dandavison/delta/pull/1744](https://togithub.com/dandavison/delta/pull/1744)
- Fix copy-paste typo by [@&#8203;injust](https://togithub.com/injust)
in
[https://github.com/dandavison/delta/pull/1767](https://togithub.com/dandavison/delta/pull/1767)
- Update syntect to 5.2.0 by
[@&#8203;timhillgit](https://togithub.com/timhillgit) in
[https://github.com/dandavison/delta/pull/1672](https://togithub.com/dandavison/delta/pull/1672)
- Disable light mode detection in tests by
[@&#8203;bash](https://togithub.com/bash) in
[https://github.com/dandavison/delta/pull/1765](https://togithub.com/dandavison/delta/pull/1765)
- Add --max-syntax-highlighting-length, set to 400 by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1746](https://togithub.com/dandavison/delta/pull/1746)
- chore: cleanup brew formula file in favor of core tap by
[@&#8203;chenrui333](https://togithub.com/chenrui333) in
[https://github.com/dandavison/delta/pull/1773](https://togithub.com/dandavison/delta/pull/1773)
- wrap --help output, fix rust 1.80 build by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1440](https://togithub.com/dandavison/delta/pull/1440)
- Fix delta-toggle shell script by
[@&#8203;dandavison](https://togithub.com/dandavison) in
[https://github.com/dandavison/delta/pull/1794](https://togithub.com/dandavison/delta/pull/1794)
- Do not wrap short help (-h) output by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1800](https://togithub.com/dandavison/delta/pull/1800)
- Implement --diff-args by
[@&#8203;dandavison](https://togithub.com/dandavison) in
[https://github.com/dandavison/delta/pull/1697](https://togithub.com/dandavison/delta/pull/1697)
- Handle ambiguous diff header, '--- ' can also be present in a minus
hunk by [@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1787](https://togithub.com/dandavison/delta/pull/1787)
- cd: build binaries targeting GNU libc on ubuntu-20.04, not latest by
[@&#8203;th1000s](https://togithub.com/th1000s) in
[https://github.com/dandavison/delta/pull/1805](https://togithub.com/dandavison/delta/pull/1805)

#### New Contributors

- [@&#8203;martinml](https://togithub.com/martinml) made their first
contribution in
[https://github.com/dandavison/delta/pull/1683](https://togithub.com/dandavison/delta/pull/1683)
- [@&#8203;thorio](https://togithub.com/thorio) made their first
contribution in
[https://github.com/dandavison/delta/pull/1737](https://togithub.com/dandavison/delta/pull/1737)
- [@&#8203;madeddie](https://togithub.com/madeddie) made their first
contribution in
[https://github.com/dandavison/delta/pull/1709](https://togithub.com/dandavison/delta/pull/1709)
- [@&#8203;injust](https://togithub.com/injust) made their first
contribution in
[https://github.com/dandavison/delta/pull/1745](https://togithub.com/dandavison/delta/pull/1745)
- [@&#8203;wxpppp](https://togithub.com/wxpppp) made their first
contribution in
[https://github.com/dandavison/delta/pull/1715](https://togithub.com/dandavison/delta/pull/1715)
- [@&#8203;timhillgit](https://togithub.com/timhillgit) made their first
contribution in
[https://github.com/dandavison/delta/pull/1672](https://togithub.com/dandavison/delta/pull/1672)
- [@&#8203;chenrui333](https://togithub.com/chenrui333) made their first
contribution in
[https://github.com/dandavison/delta/pull/1773](https://togithub.com/dandavison/delta/pull/1773)

**Full Changelog**:
dandavison/delta@0.17.0...0.18.0

</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 PR becomes conflicted, or you tick the
rebase/retry checkbox.

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

---

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

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/izumin5210/dotfiles).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: izumin5210-update-aqua-checksum[bot] <169593670+izumin5210-update-aqua-checksum[bot]@users.noreply.github.com>
@CGamesPlay
Copy link

Love this change! I hit this issue surprisingly frequently.

Is there any reason that max-line-length should not be 0 by default? What are the drawbacks of setting that?

@th1000s
Copy link
Collaborator Author

th1000s commented Nov 9, 2024

Since this PR solves the slow-to-highlight problem, the idea behind keeping the limit (increased to 3000) is to make it easy (or even possible at all) to scroll past such a diff line. Or worse, an entire block of those.

What kind of diff do you have in mind where a longer limit would help and still show useful information? I myself see the usual minified js/css files, but also in-line blobs const char* dat = "..."; or entire data files (which are valid ASCII/UTF-8, so git will print them).

@CGamesPlay
Copy link

CGamesPlay commented Nov 9, 2024

Oh, I typically run into this when I turn off line wrapping and scroll right, trying to find the single-word difference in two long lines. Most frequently, this is either in a Markdown file or an NDJSON file. It feels very silly to have a maximum line length when word wrapping is disabled, but if I understand correctly, Delta is actually passing formatted output to less, so it doesn't really know that I have line-wrapping off ("chop long lines" / less -S / also you can toggle it by typing -S in a live less session).

[append]
I guess I could also add to this to say... an ideal tool would elide some of the identical prefix of the line to show the actual diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants