Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

A moved line is a delete and an insert

Myers compares sequences, not contents: moving a line is the cheapest pair of edits that explains the new order, never a single move operation.

The diff

Context: 2 line(s).

1@@ -1,4 +1,4 @@
2-alpha
3 bravo
4 charlie
5 delta
6+alpha

The script

property value
inserted lines 1
deleted lines 1
unchanged lines 3
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.

back