{ $description "Sets the line number of a line/column pair." } ;
HELP:lines-equal?
{ $values { "loc1""a pair of integers" } { "loc2""a pair of integers" } { "?""a boolean" } }
{ $description "Tests if both line/column pairs have the same line number." } ;
HELP:document
{ $class-description "A document is a " { $link model } " containing editable text, stored as an array of lines. Documents are created by calling " { $link <document> } ". Documents can be edited with editor gadgets; see " { $vocab-link "ui.gadgets.editors" } "." } ;
{ $description "Replaces all text between two line/column number pairs with " { $snippet "string" } ". The string may use either " { $snippet "\\n" } ", " { $snippet "\\r\\n" } " or " { $snippet "\\r" } " line separators." }
{ $errors "Throws an error if " { $snippet "from" } " or " { $snippet "to" } " is out of bounds." }
{ $side-effects "document" } ;
HELP:remove-doc-range
{ $values { "from""a pair of integers" } { "to""a pair of integers" } { "document" document } }
{ $description "Removes all text between two line/column number pairs." }
{ $errors "Throws an error if " { $snippet "from" } " or " { $snippet "to" } " is out of bounds." }
{ $side-effects "document" } ;
HELP:validate-loc
{ $values { "loc""a pair of integers" } { "document" document } { "newloc""a pair of integers" } }
{ $description "Ensures that the line and column numbers in " { $snippet "loc" } " are valid, clamping them to the permitted range if they are not." } ;
{ $description "Sets the contents of the document to a string, which may use either " { $snippet "\\n" } ", " { $snippet "\\r\\n" } " or " { $snippet "\\r" } " line separators." }
{ $side-effects "document" } ;
HELP:clear-doc
{ $values { "document" document } }
{ $description "Removes all text from the document." }
"The " { $vocab-link "documents" } " vocabulary implements " { $emphasis "documents" } ", which are models storing a passage of text as a sequence of lines. Operations are defined for operating on subranges of the text, and " { $link "ui.gadgets.editors" } " can display these models."
"Locations in the document are represented as a line/column number pair, with both indices being zero-based. There are some words for manipulating locations:"