# 语法高亮不支持 \`--word-diff\`

**URL:** <https://meta.discourse.org/t/the-syntax-highlighter-doesnt-support-word-diff-s/387410>\
**Category:** Support\
**Created:** [2025年十一月2日 21:03 UTC](https://meta.discourse.org/t/the-syntax-highlighter-doesnt-support-word-diff-s/387410 "2025-11-02T21:03:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![roke\_julian\_lockhart](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roke_julian_lockhart/32/540179_2.png) [@roke\_julian\_lockhart](https://meta.discourse.org/u/roke_julian_lockhart)\
**Post date:** [2025年十一月2日 21:03 UTC](https://meta.discourse.org/t/the-syntax-highlighter-doesnt-support-word-diff-s/387410/1 "2025-11-02T21:03:55Z")

</div>

例如，`git diff --word-diff old.sh new.sh` 会产生：

> ```diff
> diff --git a/old.sh b/new.sh
> index 18237f5..208b37d 100644
> --- a/old.sh
> +++ b/new.sh
> @@ -1,8 +1,22 @@
> {+GRUB_TIMEOUT="15"+}
> {+ # Original:+} GRUB_TIMEOUT=5
> GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
> {+# Original: Identical+}
> GRUB_DEFAULT="saved"
> {+# Original: Identical+}
> GRUB_DISABLE_SUBMENU="true"
> {+# Original: GRUB_DISABLE_SUBMENU=true+}
> {+GRUB_TERMINAL_OUTPUT="gfxterm"+}
> {+ # Original:+} GRUB_TERMINAL_OUTPUT="console"
> GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-31b94f4a-915c-47ee-af7a-a7c948b23cf4 {+quiet"+}
> {+ # Original: GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-31b94f4a-915c-47ee-af7a-a7c948b23cf4+} rhgb quiet"
> {+GRUB_DISABLE_RECOVERY="false"+}
> {+ # Original:+} GRUB_DISABLE_RECOVERY="true"
> {+GRUB_ENABLE_BLSCFG="true"+}
> {+ # Original:+} GRUB_ENABLE_BLSCFG=true
> {+# Reason: https://discussion.fedoraproject.org/t/missing-boot-entries-with-grub-enable-blscfg-true/70805/3+}
> {+GRUB_GFXMODE="2560x1600,auto"+}
> {+ # Original: None+}
> {+GRUB_DISABLE_OS_PROBER="true"+}
> {+ # Original: None+}
> {+ # Reason: https://github.com/MaddieM4/os-prober/issues/5#issue-777438588+}
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/the-syntax-highlighter-doesnt-support-word-diff-s/387410)._
