diff options
author | Dan Davison <dandavison7@gmail.com> | 2023-05-25 01:18:59 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2023-05-25 01:18:59 -0400 |
commit | 65418aaa3bc064dc7ce34e6d2f231b96a5c6acb9 (patch) | |
tree | eecfbb57686829fbeef64e1e6e29e18bf833561b | |
parent | 17686fe632aef409f5b3cf4235885729aa8f745e (diff) |
Move image
-rw-r--r-- | ARCHITECTURE.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 8e9175d4..4841c75e 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -80,10 +80,6 @@ Delta's `navigate` feature is implemented by constructing an appropriate regex a Here we will follow one code path in detail: [handling diff hunk lines](https://github.com/dandavison/delta/blob/1e1bd6b6b96a3515fd7c70d6b252a25eb9807dc7/src/handlers/hunk.rs#L27) (removed/unchanged/added). This is the most important, and most complex, code path. -<table><tr><td> -<img width="1709" alt="image" src="https://github.com/dandavison/delta/assets/52205/06e868c2-c113-4946-827f-d7a78534d2ba"> -</td></tr></table> - Recall that git diff output contains multiple diff "hunks". A hunk is a sequence of diff lines describing the changes among some lines of code that are close together in the same file. A git diff may have many hunks, from multiple files (and therefore multiple languages). @@ -99,6 +95,10 @@ Now, we are at the end of a subhunk, and we have a sequence of minus lines, and Delta [processes a subhunk](https://github.com/dandavison/delta/blob/d92c3ead769326461ea082632e3aa15ca7700d4e/src/paint.rs#L598) (`paint_minus_and_plus_lines`) as follows: +<table><tr><td> +<img width="1709" alt="image" src="https://github.com/dandavison/delta/assets/52205/06e868c2-c113-4946-827f-d7a78534d2ba"> +</td></tr></table> + 1. **Compute syntax (foreground) styles for the subhunk** We [call](https://github.com/dandavison/delta/blob/d92c3ead769326461ea082632e3aa15ca7700d4e/src/paint.rs#L605-L608) the [syntect](https://github.com/trishume/syntect) library to compute syntax highlighting styles for each of the minus lines, and each of the plus lines, if the minus/plus styles specify syntax highlighting. |