MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / new_pos

Method new_pos

atomic-repository/src/diff_engine.rs:794–801  ·  view source on GitHub ↗

New-file position: the line number for additions, or the deletion boundary (the number of the preceding new line) for removals.

(&self)

Source from the content-addressed store, hash-verified

792 /// New-file position: the line number for additions, or the deletion
793 /// boundary (the number of the preceding new line) for removals.
794 fn new_pos(&self) -> usize {
795 match self.line.status {
796 LineStatus::Added => self.line.new_line_num.unwrap_or(1),
797 _ => {
798 (self.line.old_line_num.unwrap_or(1) as isize - 1 + self.net_before).max(0) as usize
799 }
800 }
801 }
802}
803
804/// The engine's hunks-from-changed-lines core, as a free function (the

Callers 1

hunks_from_changed_linesFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected