Gitility.Diff.Line (Gitility v0.2.0)

Copy Markdown View Source

One line of a hunk. content is raw bytes without the leading origin marker; old_line/new_line are 1-based, nil on the side where the line does not exist. no_newline is true when this is the final line on its side and that side has no trailing newline, equivalent to Git's \ No newline at end of file marker.

Summary

Types

t()

A raw patch line with explicit line numbers and trailing-newline state.

Types

origin()

@type origin() :: :context | :addition | :deletion

t()

@type t() :: %Gitility.Diff.Line{
  content: binary(),
  new_line: pos_integer() | nil,
  no_newline: boolean(),
  old_line: pos_integer() | nil,
  origin: origin()
}

A raw patch line with explicit line numbers and trailing-newline state.