MingaEditor.Extension.GitDiff.Hunk (minga_sdk v0.1.2)

Copy Markdown View Source

One change at the rendered diff cursor, independent of the layout.

index is one-based. Change coordinates are zero-based in the base (old_*) and revised texts. Empty text has no lines; nonempty text is split on " " without trimming the trailing empty row. A deletion has count: 0.

Summary

Types

change()

@type change() :: %{
  type: :added | :modified | :deleted,
  start_line: non_neg_integer(),
  count: non_neg_integer(),
  old_start: non_neg_integer(),
  old_count: non_neg_integer(),
  old_lines: [String.t()]
}

t()

@type t() :: %MingaEditor.Extension.GitDiff.Hunk{
  change: change(),
  index: pos_integer(),
  total: pos_integer()
}