make_shifts1: Create the map for raw <-> ANSI coordinate conversion

Description Usage Arguments Value

View source: R/map.R

Description

The result of this function can be used with map_raw_to_ansi1() and map_ansi_to_raw1() do the actual conversion between them.

Usage

1

Arguments

re

The positions of the ANSI tags.

Value

A three column matrix. First column is the start coordinates of the tags, in the raw, ANSI-less string. The second column is the coordinates of the tags in the ANSI-styled string. The third column is the shift that applies to the string after the coordinates. I.e. If a row in the matrix is (a, b, c), that means that at position a (in the ANSI-less string), which is position b in the ANSI string, the shift is c. This shift applies to all coordinates before the coordinates in the next row.


r-lib/ansistrings documentation built on March 7, 2020, 10:13 p.m.