From: Rene K. <rka...@us...> - 2004-10-28 14:30:52
|
Update of /cvsroot/jmol/Jmol/src/org/openscience/jmol/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24580 Modified Files: ScriptWindow.java Log Message: Fixed it so that when typing above the command line the caret will get set after the character that was just inserted on the commandline (at the end). I assume that it was a feature that one could type when not in the command line... Index: ScriptWindow.java =================================================================== RCS file: /cvsroot/jmol/Jmol/src/org/openscience/jmol/app/ScriptWindow.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- ScriptWindow.java 28 Oct 2004 13:45:57 -0000 1.21 +++ ScriptWindow.java 28 Oct 2004 14:30:30 -0000 1.22 @@ -413,6 +413,7 @@ // or in the 'command line' using the proper font, and the newline is processed. public void insertString(int offs, String str, AttributeSet a) throws BadLocationException { +// System.out.println("insertString("+offs+","+str+",attr)"); int ichNewline = str.indexOf('\n'); if (ichNewline > 0) str = str.substring(0, ichNewline); @@ -421,7 +422,7 @@ offs = getLength(); } super.insertString(offs, str, attUserInput); -// consoleTextPane.setCaretPosition(getLength()); + consoleTextPane.setCaretPosition(offs+str.length()); } if (ichNewline >= 0) { consoleTextPane.enterPressed(); @@ -441,6 +442,7 @@ public void remove(int offs, int len) throws BadLocationException { +// System.out.println("remove("+offs+","+len+")"); if (offs < offsetAfterPrompt) { len -= offsetAfterPrompt - offs; if (len <= 0) @@ -448,11 +450,12 @@ offs = offsetAfterPrompt; } super.remove(offs, len); - consoleTextPane.setCaretPosition(offs); +// consoleTextPane.setCaretPosition(offs); } public void replace(int offs, int length, String str, AttributeSet attrs) throws BadLocationException { +// System.out.println("replace("+offs+","+length+","+str+",attr)"); if (offs < offsetAfterPrompt) { if (offs + length < offsetAfterPrompt) { offs = getLength(); |