From 83df446cd91ba1924fd8dcc2a5b69ac39995c66d Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 23 Aug 2015 07:37:06 -0400 Subject: [PATCH] working on #3003 and #3702 (issues with compound edits and undo) --- app/src/processing/app/ui/Editor.java | 25 ++++++++++++------------- todo.txt | 12 ++++++++---- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/app/src/processing/app/ui/Editor.java b/app/src/processing/app/ui/Editor.java index afb19d5f7..81182421d 100644 --- a/app/src/processing/app/ui/Editor.java +++ b/app/src/processing/app/ui/Editor.java @@ -1911,10 +1911,20 @@ public abstract class Editor extends JFrame implements RunnerListener { /** - * Use before a manipulating text to group editing operations together as a - * single undo. Use stopCompoundEdit() once finished. + * Use before a manipulating text to group editing operations together + * as a single undo. Use stopCompoundEdit() once finished. */ public void startCompoundEdit() { + // Call endTextEditHistory() before starting a new CompoundEdit, + // because there's a timer that's possibly set off for 3 seconds after + // which endTextEditHistory() is called, which means that things get + // messed up. Hence, manually call this method so that auto-format gets + // undone in one fell swoop if the user calls auto-formats within 3 + // seconds of typing in the last character. Then start a new compound + // edit so that the auto-format can be undone in one go. + // https://github.com/processing/processing/issues/3003 + endTextEditHistory(); + stopCompoundEdit(); compoundEdit = new CompoundEdit(); caretUndoStack.push(textarea.getCaretPosition()); @@ -2216,17 +2226,6 @@ public abstract class Editor extends JFrame implements RunnerListener { if (formattedText.equals(source)) { statusNotice(Language.text("editor.status.autoformat.no_changes")); } else { - /* - * Call endTextEditHistory() before starting a new CompoundEdit, - * because there's a timer that's possibly set off for 3 seconds after - * which endTextEditHistory() is called, which means that things get - * messed up. Hence, manually call this method so that auto-format gets - * undone in one fell swoop if the user calls auto-formats within 3 - * seconds of typing in the last character. Then start a new compound - * edit so that the auto-format can be undone in one go. - * (Refer to issue #3003) - */ - endTextEditHistory(); startCompoundEdit(); // replace with new bootiful text diff --git a/todo.txt b/todo.txt index 04356f6ab..27f712012 100644 --- a/todo.txt +++ b/todo.txt @@ -10,11 +10,18 @@ X prompt to install Xcode coming up on Export to Application X http://stackoverflow.com/questions/15371925/how-to-check-if-command-line-tools-is-installed X "xcode-select -p" returns 0 if they exist (and the dir) or 2 if they don't X no special case added for 10.8, but it's on the way out +X move processing.mode.java.pdex.XQErrorTable to processing.ui.ErrorTable +X need to make the list abstract, also "scroll to line" feature +X fix red in sidebar, the squiggly line beneath code contribs X Undo does not move to the correct location in the editor window X https://github.com/processing/processing/issues/707 X https://github.com/processing/processing/pull/3660 +_ Undo sometimes causes the editor to go blank +_ https://github.com/processing/processing/issues/3003 +X https://github.com/processing/processing/pull/3693 +X https://github.com/processing/processing/pull/3702 gsoc X Foundation libraries disapear from CM after restart @@ -127,7 +134,7 @@ _ replace about screen (1x and 2x versions) _ change 'alpha' to correct name _ also change the revision in the "about processing" dialog _ https://github.com/processing/processing/issues/3665 -_ fix red in sidebar, the squiggly line beneath code +_ different design of squiggly line? _ Error/warning location visualisation not updating when editor resizes _ https://github.com/processing/processing/issues/3619 _ error/warning location is awkward when no scroll bar is in use @@ -155,9 +162,6 @@ _ update EditorButton rollover label when pressing shift or alt _ disable the debug toggle menu while running _ otherwise could run in one mode, then try to stop in another _ recent menu gets huge with other p5 versions on osx -_ move processing.mode.java.pdex.XQErrorTable to processing.ui.ErrorTable -_ need to make the list abstract, also "scroll to line" feature -_ fix up the UI, oy _ show compiling/startup animation after clicking run _ or maybe show an animation for starting up _ rather than post-compile