From: <ez...@us...> - 2013-02-19 22:10:27
|
Revision: 22801 http://jedit.svn.sourceforge.net/jedit/?rev=22801&view=rev Author: ezust Date: 2013-02-19 22:10:20 +0000 (Tue, 19 Feb 2013) Log Message: ----------- Reset dir at appropriate times. Modified Paths: -------------- plugins/SshConsole/trunk/console/ssh/Connection.java plugins/SshConsole/trunk/console/ssh/ConsoleState.java plugins/SshConsole/trunk/console/ssh/Shell.java plugins/SshConsole/trunk/index.html Modified: plugins/SshConsole/trunk/console/ssh/Connection.java =================================================================== --- plugins/SshConsole/trunk/console/ssh/Connection.java 2013-02-18 20:22:57 UTC (rev 22800) +++ plugins/SshConsole/trunk/console/ssh/Connection.java 2013-02-19 22:10:20 UTC (rev 22801) @@ -156,10 +156,11 @@ // {{{ logout() method void logout() throws IOException { + if(console.getView() != null) + console.stopAnimation(); stout.abort(); channel.disconnect(); session.disconnect(); - console.stopAnimation(); inUse = false; } // }}} Modified: plugins/SshConsole/trunk/console/ssh/ConsoleState.java =================================================================== --- plugins/SshConsole/trunk/console/ssh/ConsoleState.java 2013-02-18 20:22:57 UTC (rev 22800) +++ plugins/SshConsole/trunk/console/ssh/ConsoleState.java 2013-02-19 22:10:20 UTC (rev 22801) @@ -43,7 +43,7 @@ console = c; } - // full sftp:// path + // full sftp:// path private String path = ""; Console console; @@ -80,9 +80,9 @@ } if (path.equals(newPath)) return; + path = newPath; ConnectionInfo newInfo = ConnectionManager.getConnectionInfo(newPath); - if (newInfo == null) return; - path = newPath; + if (newInfo == null) return; // update current directory in the CommandOutputParser if (info == null || !newInfo.equals(info)) { @@ -95,6 +95,7 @@ catch (IOException e) {} finally { + dir = ""; os = null; conn = null; } @@ -172,6 +173,7 @@ // {{{ close() method public void close() { + dir = ""; if (conn != null) try { conn.logout(); ConnectionManager.closeConnection(conn); Modified: plugins/SshConsole/trunk/console/ssh/Shell.java =================================================================== --- plugins/SshConsole/trunk/console/ssh/Shell.java 2013-02-18 20:22:57 UTC (rev 22800) +++ plugins/SshConsole/trunk/console/ssh/Shell.java 2013-02-19 22:10:20 UTC (rev 22801) @@ -22,6 +22,7 @@ import javax.swing.AbstractAction; import org.gjt.sp.jedit.Buffer; +import org.gjt.sp.jedit.MiscUtilities; import org.gjt.sp.jedit.jEdit; import org.gjt.sp.util.Log; @@ -105,12 +106,14 @@ printPrompt(console, output); return; } + cs.info = info; Session session=ConnectionManager.client.getSession(info.user, info.host, info.port); Connection c = ConnectionManager.getShellConnection(console, info); session.setUserInfo(c); cs.os = c.ostr; cs.conn = c; + cs.setPath(""); } catch (Exception e) { Log.log (Log.WARNING, this, "getShellConnection failed:", e); @@ -118,9 +121,9 @@ if (cs.getPath().equals("")) // no path from FSB - what about current buffer? { Buffer b = console.getView().getEditPane().getBuffer( ); - String p = b.getPath(); - int lastslash = p.lastIndexOf("/"); - if (p.startsWith("sftp:")) cs.setPath(p.substring(0, lastslash), true); + String p = b.getPath(); + if (p.startsWith("sftp:")) + cs.setPath(MiscUtilities.getParentOfPath(p), true); } boolean consumed = cs.preprocess(command); Modified: plugins/SshConsole/trunk/index.html =================================================================== --- plugins/SshConsole/trunk/index.html 2013-02-18 20:22:57 UTC (rev 22800) +++ plugins/SshConsole/trunk/index.html 2013-02-19 22:10:20 UTC (rev 22801) @@ -54,9 +54,10 @@ connect somewhere, you need to do one of these things: </p> <ol> -<li> <b>Plugins - SshConsole - Open From Secure FTP server</b> - you can choose a file after -connecting. </li> -<li> Navigate to a remote file via a docked File System Browser </li> +<li> <b>Plugins - SshConsole - Open From Secure FTP server</b> - +you can choose a file after connecting. </li> +<li> Navigate to a remote file by clicking on the node in the File System Browser +or Project Viewer</li> <li> Edit a remote file in the current View's EditPane. </li> </ol> @@ -181,7 +182,7 @@ call <tt>ConsoleState.setPath()</tt> to update the sshconsole's path unless it is valid.</li> -<li> Use FSB and existing sftp:// VFS connection to calculate possible +<li> Use VFS and existing sftp:// VFS connection to calculate possible completions. </li> </ul> @@ -197,8 +198,7 @@ <h2 id="history"> History </h2> <li id="v.1.0.6"> <b>Version 1.0.6</b> - Requires JDK 1.6, jEdit 5.0, ErrorList 2.1, Ftp 1.0.2, Console 5.1. <ul> - <li> Fix #3604790: SshConsole read dead end when restoring files on startup. </li> - <li> Fix #3604654: NPE when changing to invalid folder in SshConsole. </li> + <li> Fix #3604654: NPE when changing to invalid folder. </li> </ul> </li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |