[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jedit-cvs
Subject:    [ jEdit-CVS ] plugins/FastOpen/com/patelsoft/fastopen FastOpen.java,1.3,1.4
From:       Alan Ezust <ezust () users ! sourceforge ! net>
Date:       2005-12-30 21:28:46
Message-ID: E1EsRnv-0002hV-Tu () mail ! sourceforge ! net
[Download RAW message or body]

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; 
 	}
 
 	/**



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
jEdit-CVS mailing list
jEdit-CVS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jedit-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic