From: <kp...@us...> - 2008-07-03 09:44:59
|
Revision: 13001 http://jedit.svn.sourceforge.net/jedit/?rev=13001&view=rev Author: kpouer Date: 2008-07-03 02:44:58 -0700 (Thu, 03 Jul 2008) Log Message: ----------- check the current buffer and recent buffer when changing bufferSet Modified Paths: -------------- jEdit/trunk/org/gjt/sp/jedit/EditPane.java Modified: jEdit/trunk/org/gjt/sp/jedit/EditPane.java =================================================================== --- jEdit/trunk/org/gjt/sp/jedit/EditPane.java 2008-07-03 06:56:20 UTC (rev 13000) +++ jEdit/trunk/org/gjt/sp/jedit/EditPane.java 2008-07-03 09:44:58 UTC (rev 13001) @@ -711,6 +711,21 @@ bufferSwitcher.updateBufferList(); } EditBus.send(new EditPaneUpdate(this, EditPaneUpdate.BUFFERSET_CHANGED)); + if (bufferSet.indexOf(recentBuffer) == -1) + { + // the recent buffer is not in the bufferSet + recentBuffer = null; + } + if (bufferSet.size() != 0 && bufferSet.indexOf(buffer) == -1) + { + // the current buffer is not contained in the bufferSet, we must change the current buffer + if (recentBuffer != null) + setBuffer(recentBuffer); + else + { + setBuffer(bufferSet.getBuffer(0)); + } + } } } //}}} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |