From d311b04bd3a667ee5a51a4945fe8ed1bfed1a4f6 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 8 May 2005 15:31:30 +0000 Subject: [PATCH] fixes to the undo, remove thumbs.db in dist --- app/Editor.java | 2 ++ app/Sketch.java | 5 +++++ app/syntax/JEditTextArea.java | 3 +-- build/linux/dist.sh | 1 + build/macosx/dist.sh | 1 + build/windows/dist.sh | 1 + todo.txt | 3 +++ 7 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/Editor.java b/app/Editor.java index f95bc4052..483247e04 100644 --- a/app/Editor.java +++ b/app/Editor.java @@ -237,6 +237,7 @@ public class Editor extends JFrame document.addUndoableEditListener(new UndoableEditListener() { public void undoableEditHappened(UndoableEditEvent e) { if (undo != null) { + //System.out.println(e.getEdit()); undo.addEdit(e.getEdit()); undoAction.updateUndoState(); redoAction.updateRedoState(); @@ -951,6 +952,7 @@ public class Editor extends JFrame public void setText(String currentProgram, int selectionStart, int selectionEnd, UndoManager currentUndo) { + //System.out.println("setting text, changing undo"); this.undo = null; //if (discardUndo) undo.discardAllEdits(); diff --git a/app/Sketch.java b/app/Sketch.java index aa6ccbac4..e09529bbd 100644 --- a/app/Sketch.java +++ b/app/Sketch.java @@ -1069,6 +1069,11 @@ public class Sketch { * */ public void setCurrent(int which) { + if (current == code[which]) { + //System.out.println("already current, ignoring"); + return; + } + // get the text currently being edited if (current != null) { current.program = editor.getText(); diff --git a/app/syntax/JEditTextArea.java b/app/syntax/JEditTextArea.java index de92336b6..6005675a5 100644 --- a/app/syntax/JEditTextArea.java +++ b/app/syntax/JEditTextArea.java @@ -1165,8 +1165,7 @@ public class JEditTextArea extends JComponent painter.invalidateLineRange(selectionStartLine,selectionEndLine); painter.invalidateLineRange(newStartLine,newEndLine); - document.addUndoableEdit(new CaretUndo( - selectionStart,selectionEnd)); + document.addUndoableEdit(new CaretUndo(selectionStart,selectionEnd)); selectionStart = newStart; selectionEnd = newEnd; diff --git a/build/linux/dist.sh b/build/linux/dist.sh index ecbad47d0..14361eb77 100755 --- a/build/linux/dist.sh +++ b/build/linux/dist.sh @@ -54,6 +54,7 @@ dos2unix processing/lib/preferences.txt 2> /dev/null find processing -name "*~" -exec rm -f {} ';' find processing -name ".DS_Store" -exec rm -f {} ';' find processing -name "._*" -exec rm -f {} ';' +find processing -name "Thumbs.db" -exec rm -f {} ';' # clean out the cvs entries find processing -name "CVS" -exec rm -rf {} ';' 2> /dev/null diff --git a/build/macosx/dist.sh b/build/macosx/dist.sh index 13d8403d3..ed43103f1 100755 --- a/build/macosx/dist.sh +++ b/build/macosx/dist.sh @@ -91,6 +91,7 @@ find processing -name "*~" -exec rm -f {} ';' # need to leave ds store stuff cuz one of those is important #find processing -name ".DS_Store" -exec rm -f {} ';' find processing -name "._*" -exec rm -f {} ';' +find processing -name "Thumbs.db" -exec rm -f {} ';' # clean out the cvs entries find processing -name "CVS" -exec rm -rf {} ';' 2> /dev/null diff --git a/build/windows/dist.sh b/build/windows/dist.sh index 58b7f9385..f68d6f784 100755 --- a/build/windows/dist.sh +++ b/build/windows/dist.sh @@ -83,6 +83,7 @@ rm -f processing/lib/*.bak find processing -name "*~" -exec rm -f {} ';' find processing -name ".DS_Store" -exec rm -f {} ';' find processing -name "._*" -exec rm -f {} ';' +find processing -name "Thumbs.db" -exec rm -f {} ';' # chmod +x the crew find processing -name "*.dll" -exec chmod +x {} ';' diff --git a/todo.txt b/todo.txt index c9c4950c9..844990c4f 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,8 @@ 0089 pde X properly rolled the version number in Base +X fix nasty late-breaking undo bug +X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115560243;start=0 +X remove Thumbs.db from examples/reference stuff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .