MCPcopy Create free account
hub / github.com/daisy/MathCAT / do_navigate_command

Function do_navigate_command

src/interface.rs:299–310  ·  view source on GitHub ↗

Given a navigation command, the current node is moved accordingly. This is a higher level interface than `do_navigate_keypress` for applications that want to interpret the keys themselves. The valid commands are: Standard move commands: `MovePrevious`, `MoveNext`, `MoveStart`, `MoveEnd`, `MoveLineStart`, `MoveLineEnd` Movement in a table or elementary math: `MoveCellPrevious`, `MoveCellNext`, `Mov

(command: String)

Source from the content-addressed store, hash-verified

297///
298/// When done with Navigation, call with `Exit`
299pub fn do_navigate_command(command: String) -> Result<String> {
300 let command = NAV_COMMANDS.get_key(&command); // gets a &'static version of the command
301 if command.is_none() {
302 bail!("Unknown command in call to DoNavigateCommand()");
303 };
304 let command = *command.unwrap();
305 return MATHML_INSTANCE.with(|package_instance| {
306 let package_instance = package_instance.borrow();
307 let mathml = get_element(&package_instance);
308 return do_navigate_command_string(mathml, command);
309 });
310}
311
312/// Return the MathML associated with the current (navigation) node.
313/// The returned result is the `id` of the node and the offset (0-based) from that node (not yet implemented)

Callers

nothing calls this directly

Calls 2

get_elementFunction · 0.85

Tested by

no test coverage detected