1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 06:05:24 +02:00

one character of selection is lost when copying

This commit is contained in:
Michael Scharf 2007-09-19 02:23:09 +00:00
parent c5e7b6cc3a
commit 9c65d5876a

View file

@ -201,7 +201,7 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
fSelectionStartCoumn = startColumn;
fSelectionEndColumn = endColumn;
if(fSelectionSnapshot!=null) {
fSelectionSnapshot.setInterestWindow(0, fSeletionEndLine);
fSelectionSnapshot.setInterestWindow(0, fSeletionEndLine+1);
}
int changedStart;
int changedEnd;
@ -239,7 +239,7 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
if(chars!=null) {
text=new String(chars);
if(line==fSeletionEndLine)
text=text.substring(0, Math.min(fSelectionEndColumn,text.length()));
text=text.substring(0, Math.min(fSelectionEndColumn+1,text.length()));
if(line==fSelectionStartLine)
text=text.substring(Math.min(fSelectionStartCoumn,text.length()));
// get rid of the empty space at the end of the lines
@ -282,7 +282,7 @@ abstract public class AbstractTextCanvasModel implements ITextCanvasModel {
// update the observed window...
if (fSelectionSnapshot != null)
// todo make -1 to work!
fSelectionSnapshot.setInterestWindow(0, fSeletionEndLine);
fSelectionSnapshot.setInterestWindow(0, fSeletionEndLine+1);
}
}