MCPcopy Create free account
hub / github.com/Eeive/Evcode-ide / new_edit_clears_redo_history

Function new_edit_clears_redo_history

src/editor/buffer.rs:512–523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

510
511 #[test]
512 fn new_edit_clears_redo_history() {
513 let mut buffer = EditorBuffer::from_str("ab");
514 buffer.set_cursor(0, 1);
515 buffer.insert_char('X');
516 buffer.undo();
517 assert_eq!(buffer.text(), "ab");
518
519 buffer.insert_char('Y');
520 assert_eq!(buffer.text(), "aYb");
521 assert!(!buffer.redo(), "redo must be empty after a new edit");
522 assert_eq!(buffer.text(), "aYb");
523 }
524
525 #[test]
526 fn redo_nothing_when_stack_empty() {

Callers

nothing calls this directly

Calls 3

set_cursorMethod · 0.80
insert_charMethod · 0.45
undoMethod · 0.45

Tested by

no test coverage detected