Thread: [Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/actions PyMethodNavigation.java, 1.6, 1.7
Brought to you by:
fabioz
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4313/src/org/python/pydev/editor/actions Modified Files: PyMethodNavigation.java PyFormatStd.java FirstCharAction.java PyOpenAction.java PyShowBrowser.java PyShowOutline.java PyAction.java PySelectWord.java PyGoToDefinition.java OfflineActionTarget.java PyOrganizeImports.java PyConvertTabToSpace.java PyBackspace.java Log Message: Synching to latest changes: Pydev <ul> <li><strong>Editor</strong>: Cursor settings no longer overridden</li> <li><strong>Code-completion</strong>: If __all__ is defined with runtime elements (and not only in a single assign statement), it's ignored for code-completion purposes</li> <li><strong>Debugger</strong>: Pythonpath the same in debug and regular modes (sys.path[0] is the same directory as the file run)</li> <li><strong>Debugger</strong>: Persist choices done in the debugger when files from the debugger are not found</li> <li><strong>Interpreter config</strong>: "email" automatically added to the "forced builtins"</li> <li><strong>Parser</strong>: Correctly recognizing absolute import with 3 or more levels</li> <li><strong>Syntax check</strong>: Option to do only on active editor</li> </ul> Also: tabs changed for spaces Index: PySelectWord.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PySelectWord.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PySelectWord.java 1 Jun 2006 17:45:01 -0000 1.1 --- PySelectWord.java 28 Sep 2008 12:45:41 -0000 1.2 *************** *** 9,27 **** public class PySelectWord extends PyAction{ ! public void run(IAction action) { ! PyEdit pyEdit = getPyEdit(); ! PySelection ps = new PySelection(pyEdit); ! try { ! Tuple<String,Integer> currToken = ps.getCurrToken(); ! if(currToken.o1 != null){ ! int len = currToken.o1.length(); ! if(len > 0){ ! pyEdit.selectAndReveal(currToken.o2, len); ! } ! } ! } catch (Exception e) { ! PydevPlugin.log(e); ! } ! } } --- 9,27 ---- public class PySelectWord extends PyAction{ ! public void run(IAction action) { ! PyEdit pyEdit = getPyEdit(); ! PySelection ps = new PySelection(pyEdit); ! try { ! Tuple<String,Integer> currToken = ps.getCurrToken(); ! if(currToken.o1 != null){ ! int len = currToken.o1.length(); ! if(len > 0){ ! pyEdit.selectAndReveal(currToken.o2, len); ! } ! } ! } catch (Exception e) { ! PydevPlugin.log(e); ! } ! } } Index: PyConvertTabToSpace.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyConvertTabToSpace.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyConvertTabToSpace.java 14 Jun 2008 22:14:55 -0000 1.6 --- PyConvertTabToSpace.java 28 Sep 2008 12:45:41 -0000 1.7 *************** *** 77,81 **** } ! // If all goes well, replace the text with the modified information doc.replace(ps.getStartLine().getOffset(), ps.getSelLength(), strbuf.toString()); return true; --- 77,81 ---- } ! // If all goes well, replace the text with the modified information doc.replace(ps.getStartLine().getOffset(), ps.getSelLength(), strbuf.toString()); return true; Index: PyShowBrowser.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyShowBrowser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyShowBrowser.java 21 Feb 2006 19:27:37 -0000 1.1 --- PyShowBrowser.java 28 Sep 2008 12:45:41 -0000 1.2 *************** *** 8,14 **** public class PyShowBrowser extends PyShowOutline{ ! @Override ! protected String getExtensionName() { ! return ExtensionHelper.PYDEV_GLOBALS_BROWSER; ! } } --- 8,14 ---- public class PyShowBrowser extends PyShowOutline{ ! @Override ! protected String getExtensionName() { ! return ExtensionHelper.PYDEV_GLOBALS_BROWSER; ! } } Index: PyMethodNavigation.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyMethodNavigation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyMethodNavigation.java 23 Feb 2008 18:58:09 -0000 1.6 --- PyMethodNavigation.java 28 Sep 2008 12:45:41 -0000 1.7 *************** *** 24,38 **** public abstract class PyMethodNavigation extends PyAction { ! /** ! * This method will search for the next/previous function (depending on the abstract methods) ! * and will go to the position in the document that corresponds to the name of the class/function definiton. ! */ ! public void run(IAction action) { ! PyEdit pyEdit = getPyEdit(); ! IDocument doc = pyEdit.getDocumentProvider().getDocument(pyEdit.getEditorInput()); ! ITextSelection selection = (ITextSelection) pyEdit.getSelectionProvider().getSelection(); ! boolean searchForward = getSearchForward(); ! int startLine = selection.getStartLine(); --- 24,38 ---- public abstract class PyMethodNavigation extends PyAction { ! /** ! * This method will search for the next/previous function (depending on the abstract methods) ! * and will go to the position in the document that corresponds to the name of the class/function definiton. ! */ ! public void run(IAction action) { ! PyEdit pyEdit = getPyEdit(); ! IDocument doc = pyEdit.getDocumentProvider().getDocument(pyEdit.getEditorInput()); ! ITextSelection selection = (ITextSelection) pyEdit.getSelectionProvider().getSelection(); ! boolean searchForward = getSearchForward(); ! int startLine = selection.getStartLine(); *************** *** 44,48 **** } stmtType goHere = FastParser.firstClassOrFunction(doc, startLine, searchForward); ! NameTok node = getNameNode(goHere); if(node != null){ --- 44,48 ---- } stmtType goHere = FastParser.firstClassOrFunction(doc, startLine, searchForward); ! NameTok node = getNameNode(goHere); if(node != null){ *************** *** 59,75 **** } } ! } ! /** ! * @return true if the search should be forward (next method) and false if it should be backward (previous method) ! */ ! protected abstract boolean getSearchForward(); ! /** ! * @param defNode the ClassDef or FunctionDef from where we want to get the name ! * @return the name of the given statement ! */ protected NameTok getNameNode(stmtType defNode) { ! NameTok node = null; if(defNode != null){ if(defNode instanceof ClassDef){ --- 59,75 ---- } } ! } ! /** ! * @return true if the search should be forward (next method) and false if it should be backward (previous method) ! */ ! protected abstract boolean getSearchForward(); ! /** ! * @param defNode the ClassDef or FunctionDef from where we want to get the name ! * @return the name of the given statement ! */ protected NameTok getNameNode(stmtType defNode) { ! NameTok node = null; if(defNode != null){ if(defNode instanceof ClassDef){ *************** *** 82,87 **** } } ! return node; ! } --- 82,87 ---- } } ! return node; ! } Index: PyOpenAction.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyOpenAction.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PyOpenAction.java 6 Aug 2008 16:23:19 -0000 1.20 --- PyOpenAction.java 28 Sep 2008 12:45:41 -0000 1.21 *************** *** 45,55 **** textEdit.getSelectionProvider().setSelection(sel); } catch (BadLocationException e1) { ! if(textEdit instanceof PyEdit){ ! PyEdit p = (PyEdit) textEdit; ! PydevPlugin.log(IStatus.ERROR, "Error setting selection:"+start+" - "+end+" - "+p.getEditorFile(), e1); ! ! }else{ ! PydevPlugin.log(IStatus.ERROR, "Error setting selection:"+start+" - "+end, e1); ! } } } --- 45,55 ---- textEdit.getSelectionProvider().setSelection(sel); } catch (BadLocationException e1) { ! if(textEdit instanceof PyEdit){ ! PyEdit p = (PyEdit) textEdit; ! PydevPlugin.log(IStatus.ERROR, "Error setting selection:"+start+" - "+end+" - "+p.getEditorFile(), e1); ! ! }else{ ! PydevPlugin.log(IStatus.ERROR, "Error setting selection:"+start+" - "+end, e1); ! } } } *************** *** 65,69 **** } else if (file instanceof IFile) { ! IFile f = (IFile) file; editor = PyOpenEditor.doOpenEditor(f); --- 65,69 ---- } else if (file instanceof IFile) { ! IFile f = (IFile) file; editor = PyOpenEditor.doOpenEditor(f); *************** *** 74,78 **** } else if (file instanceof File) { String absPath = REF.getFileAbsolutePath((File) file); ! IPath path = Path.fromOSString(absPath); editor = PyOpenEditor.doOpenEditor(path); } --- 74,78 ---- } else if (file instanceof File) { String absPath = REF.getFileAbsolutePath((File) file); ! IPath path = Path.fromOSString(absPath); editor = PyOpenEditor.doOpenEditor(path); } Index: PyShowOutline.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyShowOutline.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyShowOutline.java 21 Feb 2006 19:27:37 -0000 1.4 --- PyShowOutline.java 28 Sep 2008 12:45:41 -0000 1.5 *************** *** 17,60 **** public class PyShowOutline extends PyAction{ ! protected IEditorActionDelegate registered; ! /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { ! IEditorActionDelegate participant = getParticipant(); ! if(participant != null){ ! participant.run(action); ! } } public void setActiveEditor(IAction action, IEditorPart targetEditor){ ! IEditorActionDelegate participant = getParticipant(); ! if(participant != null){ ! participant.setActiveEditor(action, targetEditor); ! } } @Override public void selectionChanged(IAction action, ISelection selection) { ! IEditorActionDelegate participant = getParticipant(); ! if(participant != null){ ! participant.selectionChanged(action, selection); ! } } ! protected IEditorActionDelegate getParticipant() { ! if(registered != null){ ! return registered; ! } ! ! registered = (IEditorActionDelegate) ExtensionHelper.getParticipant(getExtensionName()); ! return registered; ! } ! protected String getExtensionName() { ! return ExtensionHelper.PYDEV_QUICK_OUTLINE; ! } } --- 17,60 ---- public class PyShowOutline extends PyAction{ ! protected IEditorActionDelegate registered; ! /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { ! IEditorActionDelegate participant = getParticipant(); ! if(participant != null){ ! participant.run(action); ! } } public void setActiveEditor(IAction action, IEditorPart targetEditor){ ! IEditorActionDelegate participant = getParticipant(); ! if(participant != null){ ! participant.setActiveEditor(action, targetEditor); ! } } @Override public void selectionChanged(IAction action, ISelection selection) { ! IEditorActionDelegate participant = getParticipant(); ! if(participant != null){ ! participant.selectionChanged(action, selection); ! } } ! protected IEditorActionDelegate getParticipant() { ! if(registered != null){ ! return registered; ! } ! ! registered = (IEditorActionDelegate) ExtensionHelper.getParticipant(getExtensionName()); ! return registered; ! } ! protected String getExtensionName() { ! return ExtensionHelper.PYDEV_QUICK_OUTLINE; ! } } Index: PyOrganizeImports.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyOrganizeImports.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PyOrganizeImports.java 16 Jun 2008 00:55:34 -0000 1.19 --- PyOrganizeImports.java 28 Sep 2008 12:45:41 -0000 1.20 *************** *** 44,90 **** */ @SuppressWarnings("unchecked") ! public void run(IAction action) { ! try ! { ! PyEdit pyEdit = getPyEdit(); ! PySelection ps = new PySelection(pyEdit); ! String endLineDelim = ps.getEndLineDelim(); ! final IDocument doc = ps.getDoc(); ! DocumentRewriteSession session = null; ! ! try { ! if (ps.getStartLineIndex() == ps.getEndLineIndex()) { ! //let's see if someone wants to make a better implementation in another plugin... ! List<IOrganizeImports> participants = ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_ORGANIZE_IMPORTS); ! ! for (IOrganizeImports organizeImports : participants) { if(!organizeImports.beforePerformArrangeImports(ps, pyEdit)){ return; } } ! ! session = startWrite(doc); ! ! performArrangeImports(doc, endLineDelim, pyEdit.getIndentPrefs().getIndentationString()); ! ! for (IOrganizeImports organizeImports : participants) { ! organizeImports.afterPerformArrangeImports(ps, pyEdit); ! } ! } else { ! session = startWrite(doc); ! performSimpleSort(doc, endLineDelim, ps.getStartLineIndex(), ps.getEndLineIndex()); ! } ! } finally { ! if(session != null){ ! endWrite(doc, session); ! } ! } ! } ! catch ( Exception e ) ! { PydevPlugin.log(e); ! beep ( e ); ! } } --- 44,90 ---- */ @SuppressWarnings("unchecked") ! public void run(IAction action) { ! try ! { ! PyEdit pyEdit = getPyEdit(); ! PySelection ps = new PySelection(pyEdit); ! String endLineDelim = ps.getEndLineDelim(); ! final IDocument doc = ps.getDoc(); ! DocumentRewriteSession session = null; ! ! try { ! if (ps.getStartLineIndex() == ps.getEndLineIndex()) { ! //let's see if someone wants to make a better implementation in another plugin... ! List<IOrganizeImports> participants = ExtensionHelper.getParticipants(ExtensionHelper.PYDEV_ORGANIZE_IMPORTS); ! ! for (IOrganizeImports organizeImports : participants) { if(!organizeImports.beforePerformArrangeImports(ps, pyEdit)){ return; } } ! ! session = startWrite(doc); ! ! performArrangeImports(doc, endLineDelim, pyEdit.getIndentPrefs().getIndentationString()); ! ! for (IOrganizeImports organizeImports : participants) { ! organizeImports.afterPerformArrangeImports(ps, pyEdit); ! } ! } else { ! session = startWrite(doc); ! performSimpleSort(doc, endLineDelim, ps.getStartLineIndex(), ps.getEndLineIndex()); ! } ! } finally { ! if(session != null){ ! endWrite(doc, session); ! } ! } ! } ! catch ( Exception e ) ! { PydevPlugin.log(e); ! beep ( e ); ! } } *************** *** 92,112 **** * Stop a rewrite session */ ! private void endWrite(IDocument doc, DocumentRewriteSession session) { ! if(doc instanceof IDocumentExtension4){ ! IDocumentExtension4 d = (IDocumentExtension4) doc; ! d.stopRewriteSession(session); ! } ! } ! /** ! * Starts a rewrite session (keep things in a single undo/redo) ! */ ! private DocumentRewriteSession startWrite(IDocument doc) { ! if(doc instanceof IDocumentExtension4){ ! IDocumentExtension4 d = (IDocumentExtension4) doc; ! return d.startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED); ! } ! return null; ! } /** --- 92,112 ---- * Stop a rewrite session */ ! private void endWrite(IDocument doc, DocumentRewriteSession session) { ! if(doc instanceof IDocumentExtension4){ ! IDocumentExtension4 d = (IDocumentExtension4) doc; ! d.stopRewriteSession(session); ! } ! } ! /** ! * Starts a rewrite session (keep things in a single undo/redo) ! */ ! private DocumentRewriteSession startWrite(IDocument doc) { ! if(doc instanceof IDocumentExtension4){ ! IDocumentExtension4 d = (IDocumentExtension4) doc; ! return d.startRewriteSession(DocumentRewriteSessionType.UNRESTRICTED); ! } ! return null; ! } /** *************** *** 117,126 **** */ @SuppressWarnings("unchecked") ! public static void performArrangeImports(IDocument doc, String endLineDelim, String indentStr){ ! List<Tuple3<Integer, String, ImportHandle>> list = new ArrayList<Tuple3<Integer, String, ImportHandle>>(); ! //Gather imports in a structure we can work on. ! PyImportsHandling pyImportsHandling = new PyImportsHandling(doc); ! int firstImport = -1; ! for(ImportHandle imp:pyImportsHandling){ list.add( new Tuple3<Integer, String, ImportHandle>(imp.startFoundLine, imp.importFound, imp) ); --- 117,126 ---- */ @SuppressWarnings("unchecked") ! public static void performArrangeImports(IDocument doc, String endLineDelim, String indentStr){ ! List<Tuple3<Integer, String, ImportHandle>> list = new ArrayList<Tuple3<Integer, String, ImportHandle>>(); ! //Gather imports in a structure we can work on. ! PyImportsHandling pyImportsHandling = new PyImportsHandling(doc); ! int firstImport = -1; ! for(ImportHandle imp:pyImportsHandling){ list.add( new Tuple3<Integer, String, ImportHandle>(imp.startFoundLine, imp.importFound, imp) ); *************** *** 128,139 **** firstImport = imp.startFoundLine; } ! } ! ! //check if we had any import ! if(firstImport == -1){ ! return; ! } ! //sort in inverse order (for removal of the string of the document). Collections.sort(list, new Comparator<Tuple3<Integer, String, ImportHandle>>() { --- 128,139 ---- firstImport = imp.startFoundLine; } ! } ! ! //check if we had any import ! if(firstImport == -1){ ! return; ! } ! //sort in inverse order (for removal of the string of the document). Collections.sort(list, new Comparator<Tuple3<Integer, String, ImportHandle>>() { *************** *** 405,419 **** */ @SuppressWarnings("unchecked") ! public static void performSimpleSort(IDocument doc, String endLineDelim, int startLine, int endLine) { try { ! ArrayList<String> list = new ArrayList<String>(); ! ! StringBuffer lastLine = null; ! for (int i = startLine; i <= endLine; i++) { ! ! String line = PySelection.getLine(doc, i); ! if(lastLine != null){ ! int len = lastLine.length(); if(len > 0 && lastLine.charAt(len-1) == '\\'){ lastLine.append(endLineDelim); --- 405,419 ---- */ @SuppressWarnings("unchecked") ! public static void performSimpleSort(IDocument doc, String endLineDelim, int startLine, int endLine) { try { ! ArrayList<String> list = new ArrayList<String>(); ! ! StringBuffer lastLine = null; ! for (int i = startLine; i <= endLine; i++) { ! String line = PySelection.getLine(doc, i); ! ! if(lastLine != null){ ! int len = lastLine.length(); if(len > 0 && lastLine.charAt(len-1) == '\\'){ lastLine.append(endLineDelim); *************** *** 423,444 **** lastLine = new StringBuffer(line); } ! }else{ ! lastLine = new StringBuffer(line); ! } ! } ! ! if(lastLine != null){ ! list.add(lastLine.toString()); ! } ! ! Collections.sort(list); ! StringBuffer all = new StringBuffer(); ! for (Iterator iter = list.iterator(); iter.hasNext();) { ! String element = (String) iter.next(); ! all.append(element); ! if(iter.hasNext()) ! all.append(endLineDelim); ! } ! int length = doc.getLineInformation(endLine).getLength(); int endOffset = doc.getLineInformation(endLine).getOffset()+length; --- 423,444 ---- lastLine = new StringBuffer(line); } ! }else{ ! lastLine = new StringBuffer(line); ! } ! } ! ! if(lastLine != null){ ! list.add(lastLine.toString()); ! } ! ! Collections.sort(list); ! StringBuffer all = new StringBuffer(); ! for (Iterator iter = list.iterator(); iter.hasNext();) { ! String element = (String) iter.next(); ! all.append(element); ! if(iter.hasNext()) ! all.append(endLineDelim); ! } ! int length = doc.getLineInformation(endLine).getLength(); int endOffset = doc.getLineInformation(endLine).getOffset()+length; Index: PyFormatStd.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyFormatStd.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PyFormatStd.java 17 Aug 2008 00:26:46 -0000 1.21 --- PyFormatStd.java 28 Sep 2008 12:45:41 -0000 1.22 *************** *** 231,266 **** case '+': case '-': ! ! if(c == '-' || c == '+'){ // could also be * ! ! //handle exponentials correctly: e.g.: 1e-6 cannot have a space ! FastStringBuffer localBufToCheckNumber = new FastStringBuffer(); ! for(int j=buf.length()-1;j>=0;j--){ ! char localC = buf.charAt(j); ! if(Character.isJavaIdentifierPart(localC)){ ! localBufToCheckNumber.append(localC); ! }else{ ! break; ! } ! } ! boolean isExponential = true;; ! String partialNumber = localBufToCheckNumber.reverse().toString(); ! int partialLen = partialNumber.length(); ! if(partialLen < 2 || !Character.isDigit(partialNumber.charAt(0))){ ! //at least 2 chars: the number and the 'e' ! isExponential = false; ! }else{ ! //first char checked... now, if the last is an 'e', we must leave it together no matter what ! if(partialNumber.charAt(partialLen-1) != 'e'){ ! isExponential = false; ! break; ! } ! } ! if(isExponential){ ! buf.append(c); ! break; ! } ! //Otherwise, FALLTHROUGH ! } case '/': --- 231,266 ---- case '+': case '-': ! ! if(c == '-' || c == '+'){ // could also be * ! ! //handle exponentials correctly: e.g.: 1e-6 cannot have a space ! FastStringBuffer localBufToCheckNumber = new FastStringBuffer(); ! for(int j=buf.length()-1;j>=0;j--){ ! char localC = buf.charAt(j); ! if(Character.isJavaIdentifierPart(localC)){ ! localBufToCheckNumber.append(localC); ! }else{ ! break; ! } ! } ! boolean isExponential = true;; ! String partialNumber = localBufToCheckNumber.reverse().toString(); ! int partialLen = partialNumber.length(); ! if(partialLen < 2 || !Character.isDigit(partialNumber.charAt(0))){ ! //at least 2 chars: the number and the 'e' ! isExponential = false; ! }else{ ! //first char checked... now, if the last is an 'e', we must leave it together no matter what ! if(partialNumber.charAt(partialLen-1) != 'e'){ ! isExponential = false; ! break; ! } ! } ! if(isExponential){ ! buf.append(c); ! break; ! } ! //Otherwise, FALLTHROUGH ! } case '/': Index: OfflineActionTarget.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/OfflineActionTarget.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OfflineActionTarget.java 14 Jun 2008 22:14:55 -0000 1.7 --- OfflineActionTarget.java 28 Sep 2008 12:45:41 -0000 1.8 *************** *** 60,64 **** */ private boolean fIsStatusFieldExtension; ! private PyEdit fEdit; --- 60,64 ---- */ private boolean fIsStatusFieldExtension; ! private PyEdit fEdit; *************** *** 192,209 **** } else { ! switch (event.character) { // ESC = quit case 0x1B: ! leave(); ! event.doit= false; ! break; ! //CR = exec and quit case 0x0D: ! boolean executed = doExec(); event.doit= false; if(!executed){ ! return; //we don't want to update the status } break; --- 192,209 ---- } else { ! switch (event.character) { // ESC = quit case 0x1B: ! leave(); ! event.doit= false; ! break; ! //CR = exec and quit case 0x0D: ! boolean executed = doExec(); event.doit= false; if(!executed){ ! return; //we don't want to update the status } break; *************** *** 212,216 **** case 0x08: case 0x7F: ! removeLastCharSearch(); event.doit= false; break; --- 212,216 ---- case 0x08: case 0x7F: ! removeLastCharSearch(); event.doit= false; break; *************** *** 240,244 **** final boolean executed = fEdit.onOfflineAction(fFindString.toString(), this); if(executed){ ! leave(); } return executed; --- 240,244 ---- final boolean executed = fEdit.onOfflineAction(fFindString.toString(), this); if(executed){ ! leave(); } return executed; *************** *** 251,266 **** */ public void removeLastCharSearchAndUpdateStatus() { ! removeLastCharSearch(); ! updateStatus(); } private void removeLastCharSearch() { ! final int len = fFindString.length(); ! if(len > 0){ ! fFindString.deleteCharAt(len-1); ! } ! } ! /** * Adds the given character to the search string and repeats the search with the last parameters. * --- 251,266 ---- */ public void removeLastCharSearchAndUpdateStatus() { ! removeLastCharSearch(); ! updateStatu... [truncated message content] |