Skip to main content

cycle_reference

Function cycle_reference 

Source
pub fn cycle_reference(
    value: &str,
    start: usize,
    end: usize,
    locale: &Locale,
    language: &Language,
) -> Result<(String, i32, i32), String>
Expand description

Cycles the absolute/relative state of the references touched by the cursor, Excel F4 style: A1 -> $A$1 -> A$1 -> $A1 -> A1.

start and end are cursor positions in characters; a cursor grazing the edge of a reference counts as touching it. Returns the new text together with the new cursor positions:

  • If nothing is cycled the text and cursor are returned unchanged.
  • A collapsed cursor lands collapsed at the end of the cycled reference.
  • A selection spans all the cycled references in the new text.