From: Alan E. <ez...@us...> - 2005-12-30 21:28:52
|
Update of /cvsroot/jedit/plugins/FastOpen/com/patelsoft/fastopen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12387/com/patelsoft/fastopen Modified Files: FastOpen.java Log Message: getFileAtCaret() is patched so it no longer returns its PATH but just its filename. This helps fastopen when it is trying to guess what file you want to open. Index: FastOpen.java =================================================================== RCS file: /cvsroot/jedit/plugins/FastOpen/com/patelsoft/fastopen/FastOpen.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FastOpen.java 30 Dec 2005 06:28:44 -0000 1.3 +++ FastOpen.java 30 Dec 2005 21:28:44 -0000 1.4 @@ -635,7 +635,18 @@ int wordStart = TextUtilities.findWordStart(lineText, offset, noWordSep); int wordEnd = TextUtilities.findWordEnd(lineText, offset + 1, noWordSep); - return textArea.getText(lineStart + wordStart, wordEnd - wordStart); + String filename = textArea.getText(lineStart + wordStart, wordEnd - wordStart); + + /* Get rid of any path info, since we index by filename and not by pathname */ + int idx = filename.lastIndexOf("/"); + if (idx > -1) { + filename = filename.substring(idx+1); + } + idx = filename.lastIndexOf("\\"); + if (idx > -1) { + filename = filename.substring(idx+1); + } + return filename; } /** |