MCPcopy Index your code
hub / github.com/benfry/processing4 / startCompoundEdit

Method startCompoundEdit

app/src/processing/app/ui/Editor.java:1493–1508  ·  view source on GitHub ↗

Use before a manipulating text to group editing operations together as a single undo. Use stopCompoundEdit() once finished.

()

Source from the content-addressed store, hash-verified

1491 * as a single undo. Use stopCompoundEdit() once finished.
1492 */
1493 public void startCompoundEdit() {
1494 // Call endTextEditHistory() before starting a new CompoundEdit,
1495 // because there's a timer that's possibly set off for 3 seconds after
1496 // which endTextEditHistory() is called, which means that things get
1497 // messed up. Hence, manually call this method so that auto-format gets
1498 // undone in one fell swoop if the user calls auto-formats within 3
1499 // seconds of typing in the last character. Then start a new compound
1500 // edit so that the auto-format can be undone in one go.
1501 // https://github.com/processing/processing/issues/3003
1502 endTextEditHistory(); // also calls stopCompoundEdit()
1503
1504 //stopCompoundEdit();
1505 compoundEdit = new CompoundEdit();
1506 caretUndoStack.push(textarea.getCaretPosition());
1507 caretRedoStack.clear();
1508 }
1509
1510
1511 /**

Callers 10

setTextMethod · 0.95
insertTextMethod · 0.95
setLineTextMethod · 0.95
beginCompoundEditMethod · 0.95
setCodeMethod · 0.95
handleAutoFormatMethod · 0.95
handleIndentOutdentMethod · 0.95
replaceAllMethod · 0.80
renameMethod · 0.80

Calls 4

endTextEditHistoryMethod · 0.95
getCaretPositionMethod · 0.80
pushMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected