CARVIEW |
Select Language
HTTP/2 200
date: Thu, 31 Jul 2025 11:49:17 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/vim/vim.git
etag: W/"ff1356e252c0a85f9f8031b9b4b7fc50"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=RHHAJ0H1vJS%2Bpvnx%2F6WHN%2FHRb6WUOiNbiY%2BlwzMeya00BVHoHJvVdBPwhJL0%2Fs3AuK%2BfSBySSbFQa7SIXiTPcxJWW7p%2FzPu59%2FQVIiWksrihluoaasCQOkCvbmd82csl5m6%2FeCDCTchXj3KyEcTIjRTXoK8woti2VuC4qUw41kL1zyJYybxBb%2BhVeqWvMPUULdBWAisAutWUqisxyQPK7ic3zi7%2F%2F5phAhCyYtd66s2K7Ok9RnH6XdxN2JW1andfblYAxf5q5ixk2tfp794cpw%3D%3D--NmDYQYQotkc%2FZXmL--Y3iTx4shtCkdw%2BI8ebreBg%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.2079961956.1753962555; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 11:49:15 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 11:49:15 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: 811E:111CDC:97B692:B4D89F:688B583B
patch 9.1.1243: diff mode is lacking for changes within lines · vim/vim@9943d47 · GitHub
Dismiss banner
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit 9943d47
patch 9.1.1243: diff mode is lacking for changes within lines
Problem: Diff mode's inline highlighting is lackluster. It only
performs a line-by-line comparison, and calculates a single
shortest range within a line that could encompass all the
changes. In lines with multiple changes, or those that span
multiple lines, this approach tends to end up highlighting
much more than necessary.
Solution: Implement new inline highlighting modes by doing per-character
or per-word diff within the diff block, and highlight only the
relevant parts, add "inline:simple" to the defaults (which is
the old behaviour)
This change introduces a new diffopt option "inline:<type>". Setting to
"none" will disable all inline highlighting, "simple" (the default) will
use the old behavior, "char" / "word" will perform a character/word-wise
diff of the texts within each diff block and only highlight the
differences.
The new char/word inline diff only use the internal xdiff, and will
respect diff options such as algorithm choice, icase, and misc iwhite
options. indent-heuristics is always on to perform better sliding.
For character highlight, a post-process of the diff results is first
applied before we show the highlight. This is because a naive diff will
create a result with a lot of small diff chunks and gaps, due to the
repetitive nature of individual characters. The post-process is a
heuristic-based refinement that attempts to merge adjacent diff blocks
if they are separated by a short gap (1-3 characters), and can be
further tuned in the future for better results. This process results in
more characters than necessary being highlighted but overall less visual
noise.
For word highlight, always use first buffer's iskeyword definition.
Otherwise if each buffer has different iskeyword settings we would not
be able to group words properly.
The char/word diffing is always per-diff block, not per line, meaning
that changes that span multiple lines will show up correctly.
Added/removed newlines are not shown by default, but if the user has
'list' set (with "eol" listchar defined), the eol character will be be
highlighted correctly for the specific newline characters.
Also, add a new "DiffTextAdd" highlight group linked to "DiffText" by
default. It allows color schemes to use different colors for texts that
have been added within a line versus modified.
This doesn't interact with linematch perfectly currently. The linematch
feature splits up diff blocks into multiple smaller blocks for better
visual matching, which makes inline highlight less useful especially for
multi-line change (e.g. a line is broken into two lines). This could be
addressed in the future.
As a side change, this also removes the bounds checking introduced to
diff_read() as they were added to mask existing logic bugs that were
properly fixed in #16768.
closes: #16881
Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>1 parent 06774a2 commit 9943d47Copy full SHA for 9943d47
File tree
Expand file treeCollapse file tree
55 files changed
+1855
-113
lines changedFilter options
- runtime
- doc
- syntax
- src
- proto
- testdir
- dumps
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Expand file treeCollapse file tree
55 files changed
+1855
-113
lines changed+24-9Lines changed: 24 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
226 | 226 |
| |
227 | 227 |
| |
228 | 228 |
| |
229 |
| - | |
230 |
| - | |
231 |
| - | |
232 |
| - | |
233 |
| - | |
234 |
| - | |
235 |
| - | |
236 |
| - | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
237 | 252 |
| |
238 | 253 |
| |
239 | 254 |
| |
|
+24-7Lines changed: 24 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
2910 | 2910 |
| |
2911 | 2911 |
| |
2912 | 2912 |
| |
2913 |
| - | |
| 2913 | + | |
| 2914 | + | |
2914 | 2915 |
| |
2915 | 2916 |
| |
2916 | 2917 |
| |
| |||
2975 | 2976 |
| |
2976 | 2977 |
| |
2977 | 2978 |
| |
| 2979 | + | |
| 2980 | + | |
| 2981 | + | |
| 2982 | + | |
| 2983 | + | |
| 2984 | + | |
| 2985 | + | |
| 2986 | + | |
| 2987 | + | |
| 2988 | + | |
| 2989 | + | |
| 2990 | + | |
| 2991 | + | |
| 2992 | + | |
| 2993 | + | |
2978 | 2994 |
| |
2979 | 2995 |
| |
2980 | 2996 |
| |
| |||
4392 | 4408 |
| |
4393 | 4409 |
| |
4394 | 4410 |
| |
4395 |
| - | |
4396 |
| - | |
4397 |
| - | |
4398 |
| - | |
| 4411 | + | |
| 4412 | + | |
| 4413 | + | |
| 4414 | + | |
4399 | 4415 |
| |
4400 | 4416 |
| |
4401 | 4417 |
| |
| |||
4447 | 4463 |
| |
4448 | 4464 |
| |
4449 | 4465 |
| |
4450 |
| - | |
| 4466 | + | |
| 4467 | + | |
4451 | 4468 |
| |
4452 | 4469 |
| |
4453 | 4470 |
| |
|
+4-1Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
5832 | 5832 |
| |
5833 | 5833 |
| |
5834 | 5834 |
| |
| 5835 | + | |
| 5836 | + | |
| 5837 | + | |
5835 | 5838 |
| |
5836 | 5839 |
| |
5837 | 5840 |
| |
|
+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8205 | 8205 |
| |
8206 | 8206 |
| |
8207 | 8207 |
| |
| 8208 | + | |
8208 | 8209 |
| |
8209 | 8210 |
| |
8210 | 8211 |
| |
|
+13-7Lines changed: 13 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
| 1 | + | |
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| |||
41553 | 41553 |
| |
41554 | 41554 |
| |
41555 | 41555 |
| |
| 41556 | + | |
| 41557 | + | |
| 41558 | + | |
| 41559 | + | |
| 41560 | + | |
| 41561 | + | |
| 41562 | + | |
| 41563 | + | |
| 41564 | + | |
| 41565 | + | |
41556 | 41566 |
| |
41557 | 41567 |
| |
41558 | 41568 |
| |
| |||
41570 | 41580 |
| |
41571 | 41581 |
| |
41572 | 41582 |
| |
41573 |
| - | |
41574 |
| - | |
41575 |
| - | |
41576 |
| - | |
41577 | 41583 |
| |
41578 | 41584 |
| |
41579 | 41585 |
| |
| |||
41590 | 41596 |
| |
41591 | 41597 |
| |
41592 | 41598 |
| |
41593 |
| - | |
41594 | 41599 |
| |
41595 | 41600 |
| |
41596 | 41601 |
| |
| |||
41702 | 41707 |
| |
41703 | 41708 |
| |
41704 | 41709 |
| |
41705 |
| - | |
| 41710 | + | |
| 41711 | + | |
41706 | 41712 |
| |
41707 | 41713 |
| |
41708 | 41714 |
| |
|
+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
126 |
| - | |
| 126 | + | |
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
|
+3Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
476 | 476 |
| |
477 | 477 |
| |
478 | 478 |
| |
| 479 | + | |
479 | 480 |
| |
| 481 | + | |
| 482 | + | |
480 | 483 |
| |
481 | 484 |
| |
482 | 485 |
| |
|
You can’t perform that action at this time.
0 commit comments