From: <sh...@us...> - 2010-06-03 16:06:28
|
Revision: 17976 http://jedit.svn.sourceforge.net/jedit/?rev=17976&view=rev Author: shlomy Date: 2010-06-03 16:06:21 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Define the end of an asset as the position of the first character following the asset (or the end of the buffer). Adjust the calls accordingly. Modified Paths: -------------- plugins/SideKick/trunk/sidekick/IAsset.java plugins/SideKick/trunk/sidekick/SideKickActions.java plugins/SideKick/trunk/sidekick/SideKickTree.java Modified: plugins/SideKick/trunk/sidekick/IAsset.java =================================================================== --- plugins/SideKick/trunk/sidekick/IAsset.java 2010-06-03 15:32:53 UTC (rev 17975) +++ plugins/SideKick/trunk/sidekick/IAsset.java 2010-06-03 16:06:21 UTC (rev 17976) @@ -75,12 +75,14 @@ Position getStart(); /** - * Set the end position + * Set the end position - the position of the first character + * following the asset (or the end of the buffer). */ void setEnd(Position end); /** - * Returns the end position. + * Returns the end position - the position of the first character + * following the asset (or the end of the buffer). */ Position getEnd(); Modified: plugins/SideKick/trunk/sidekick/SideKickActions.java =================================================================== --- plugins/SideKick/trunk/sidekick/SideKickActions.java 2010-06-03 15:32:53 UTC (rev 17975) +++ plugins/SideKick/trunk/sidekick/SideKickActions.java 2010-06-03 16:06:21 UTC (rev 17976) @@ -195,7 +195,7 @@ return; } - int pos = asset.getEnd().getOffset() + 1; + int pos = asset.getEnd().getOffset(); if (pos > textArea.getBuffer().getLength()) { view.getToolkit().beep(); Modified: plugins/SideKick/trunk/sidekick/SideKickTree.java =================================================================== --- plugins/SideKick/trunk/sidekick/SideKickTree.java 2010-06-03 15:32:53 UTC (rev 17975) +++ plugins/SideKick/trunk/sidekick/SideKickTree.java 2010-06-03 16:06:21 UTC (rev 17976) @@ -739,8 +739,7 @@ JEditTextArea textArea = view.getTextArea(); textArea.setCaretPosition(asset.getEnd().getOffset()); Selection.Range range = new Selection.Range( - asset.getStart().getOffset(), - asset.getEnd().getOffset() + (asset.getEnd().getOffset() == textArea.getBufferLength() ? 0 : 1) ); + asset.getStart().getOffset(), asset.getEnd().getOffset()); textArea.addToSelection(range); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |