currentEditingValue method

String currentEditingValue({
  1. bool placeholderWhenEmpty = true,
})

Returns the current editing value (expression), which requires temporarily removing the cursor. When placeholderWhenEmpty is true, a TeX \Box is returned as a placeholder.

Implementation

String currentEditingValue({bool placeholderWhenEmpty = true}) {
  currentNode.removeCursor();
  // Store the expression as a TeX string.
  final expression = root.buildTeXString(
    // By passing null as the cursor color here, we are asserting
    // that the cursor is not part of the tree in a way.
    cursorColor: null,
    placeholderWhenEmpty: placeholderWhenEmpty,
  );
  currentNode.setCursor();

  return expression;
}