From 8b767baa3bf5fb81dcd16eb180df4443892fdd00 Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 10 May 2005 01:17:21 +0000 Subject: [PATCH] fix for line indent highlight from stendahl, also minor naming tweak --- app/Editor.java | 7 ++++--- app/Sketch.java | 10 +++++++++- app/syntax/TextAreaPainter.java | 12 ++++++++++-- core/todo.txt | 2 ++ todo.txt | 9 ++++++++- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/app/Editor.java b/app/Editor.java index fe9cb279a..3ae6e15f7 100644 --- a/app/Editor.java +++ b/app/Editor.java @@ -1642,11 +1642,12 @@ public class Editor extends JFrame } if (newline) { if (lc == lnum) - //st = i+1; st = ii; else if (lc == lnum+1) { - //end = i; - end = ii; + //end = ii; + // to avoid selecting entire, because doing so puts the + // cursor on the next line [0090] + end = ii - 1; break; } } diff --git a/app/Sketch.java b/app/Sketch.java index 49c8df47d..15e38af19 100644 --- a/app/Sketch.java +++ b/app/Sketch.java @@ -26,7 +26,7 @@ package processing.app; import processing.app.preproc.*; import processing.core.*; -import java.awt.FileDialog; +import java.awt.*; import java.io.*; import java.util.*; import java.util.zip.*; @@ -331,6 +331,11 @@ public class Sketch { return; } + if (newName.trim().equals(".java") || + newName.trim().equals(".pde")) { + return; + } + String newFilename = null; int newFlavor = 0; @@ -517,6 +522,9 @@ public class Sketch { // update the tabs editor.header.repaint(); + // force the update on the mac? + Toolkit.getDefaultToolkit().sync(); + //editor.header.getToolkit().sync(); } diff --git a/app/syntax/TextAreaPainter.java b/app/syntax/TextAreaPainter.java index 98eb1f1d7..fb7eeeef3 100644 --- a/app/syntax/TextAreaPainter.java +++ b/app/syntax/TextAreaPainter.java @@ -612,10 +612,18 @@ public class TextAreaPainter extends JComponent implements TabExpander x1 = textArea._offsetToX(line, selectionStart - lineStart); x2 = getWidth(); } else if(line == selectionEndLine) { - x1 = 0; + //x1 = 0; + // hack from stendahl to avoid doing weird side selection thing + x1 = textArea._offsetToX(line, 0); + // attempt at getting the gutter too, but doesn't seem to work + //x1 = textArea._offsetToX(line, -textArea.getHorizontalOffset()); x2 = textArea._offsetToX(line, selectionEnd - lineStart); } else { - x1 = 0; + //x1 = 0; + // hack from stendahl to avoid doing weird side selection thing + x1 = textArea._offsetToX(line, 0); + // attempt at getting the gutter too, but doesn't seem to work + //x1 = textArea._offsetToX(line, -textArea.getHorizontalOffset()); x2 = getWidth(); } diff --git a/core/todo.txt b/core/todo.txt index 7d9813a2d..72f943b61 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -310,6 +310,8 @@ _ polygons perpendicular to axis not drawing _ is this a clipping error? _ probably a triangulation error, because triangles work ok _ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1114158993;start=0 +_ odd error with some pixels from images not drawing properly +_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115681453;start=0 _ when turning smoothing on, internal lines of shapes are visible _ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115487475;start=1 _ simon reports borders on P3D and OPENGL if background() not called diff --git a/todo.txt b/todo.txt index a4ec585f7..ad96b95ca 100644 --- a/todo.txt +++ b/todo.txt @@ -1,9 +1,15 @@ 0090 pde -X working on strange undo problems, allowing a new Document for each tab +X working on strange undo problems, use a new Document for each tab +_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115665414;start=2 +_ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=SoftwareBugs;action=display;num=1115644611 +X don't allow a file to be named .pde or .java +X patch from stendahl for the highlight inset ugliness +X http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Suggestions;action=display;num=1115597365;start=0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + _ runtime exceptions have stopped coming through (on pc only?) _ test with florian example for the exception stuff _ that they don't show up in the error bar @@ -257,6 +263,7 @@ PDE / Editor Header _ make some fancy extendo things because the tabs get too big _ either condense or popdown menu thingy _ ctrl-tab to switch between tabs +_ not always updating on rename (maybe a mac problem?) PDE / Editor Status