Bug 118629: Shift-LeftArrow-Copy picks up newline (caret renders in wrong place). Also fixes bug 308023. r+sr+a=roc
git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@191240 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -778,7 +778,15 @@ nsTextEditRules::WillInsertText(PRInt32 aAction,
|
||||
outString->Assign(tString);
|
||||
|
||||
if (curNode)
|
||||
{
|
||||
aSelection->Collapse(curNode, curOffset);
|
||||
|
||||
// Make the caret attach to the inserted text, unless this text ends with a LF,
|
||||
// in which case make the caret attach to the next line.
|
||||
PRBool endsWithLF = !tString.IsEmpty() && tString.get()[tString.Length() - 1] == nsCRT::LF;
|
||||
nsCOMPtr<nsISelectionPrivate>selPrivate(do_QueryInterface(aSelection));
|
||||
selPrivate->SetInterlinePosition(endsWithLF);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user