A small patch in a large file
The ordinary case, and the one Myers is fast at: most of the file is untouched. The search ends after as many rounds as there are edits, not as there are lines, which is the whole reason to prefer it to an edit matrix.
The diff
Context: 2 line(s).
1@@ -4,7 +4,6 @@
2
3 func main() {
4- fmt.Println("hello")
5+ name := "world"
6+ fmt.Println("hello", name)
7 }
8
9-// TODO: say who
10-
The script
| property | value |
|---|---|
| inserted lines | 2 |
| deleted lines | 3 |
| unchanged lines | 7 |
| minimal | yes |
Replaying it on the left document reproduces the right one yes, which is the property that holds even when the script is not minimal.