document_diff: Print diff between active document and saved version

View source: R/others.R

document_diffR Documentation

Print diff between active document and saved version

Description

Print diff between active document and saved version

Usage

document_diff(
  id = rstudioapi::documentId(FALSE),
  mode = c("auto", "unified", "sidebyside", "context"),
  context = 2,
  ...
)

Arguments

mode

character(1L), one of:

  • “unified”: diff mode used by git diff

  • “sidebyside”: line up the differences side by side

  • “context”: show the target and current hunks in their entirety; this mode takes up a lot of screen space but makes it easier to see what the objects actually look like

  • “auto”: default mode; pick one of the above, will favor “sidebyside” unless getOption("width") is less than 80, or in diffPrint and objects are dimensioned and do not fit side by side, or in diffChr, diffDeparse, diffFile and output does not fit in side by side without wrapping

context

integer(1L) how many lines of context are shown on either side of differences (defaults to 2). Set to -1L to allow as many as there are. Set to “auto” to display as many as 10 lines or as few as 1 depending on whether total screen lines fit within the number of lines specified in line.limit. Alternatively pass the return value of auto_context to fine tune the parameters of the auto context calculation.

...

Additional parameters passed to diffobj::diffFile

Value

Returns NULL invisibly, called for side effects


moodymudskipper/tabs documentation built on June 26, 2022, 10:12 a.m.