mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-22 18:32:00 +00:00
Add a user option to allow delete and backspace to delete immediately even if the character to be deleted is visually distant from the caret location. Bug 328834, r=uriber@gmail.com, sr=roc
This commit is contained in:
parent
210588e5e5
commit
68fd2fbdfe
@ -165,6 +165,14 @@ nsTextEditRules::Init(nsPlaintextEditor *aEditor, PRUint32 aFlags)
|
||||
res = ReplaceNewlines(wholeDoc);
|
||||
}
|
||||
|
||||
PRBool deleteBidiImmediately = PR_FALSE;
|
||||
nsCOMPtr<nsIPrefBranch> prefBranch =
|
||||
do_GetService(NS_PREFSERVICE_CONTRACTID, &res);
|
||||
if (NS_SUCCEEDED(res))
|
||||
prefBranch->GetBoolPref("bidi.edit.delete_immediately",
|
||||
&deleteBidiImmediately);
|
||||
mDeleteBidiImmediately = deleteBidiImmediately;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -211,6 +211,10 @@ protected:
|
||||
PRUint32 mActionNesting;
|
||||
PRPackedBool mLockRulesSniffing;
|
||||
PRPackedBool mDidExplicitlySetInterline;
|
||||
PRPackedBool mDeleteBidiImmediately; // in bidirectional text, delete
|
||||
// characters not visually
|
||||
// adjacent to the caret without
|
||||
// moving the caret first.
|
||||
PRInt32 mTheAction; // the top level editor action
|
||||
// friends
|
||||
friend class nsAutoLockRulesSniffing;
|
||||
|
@ -143,7 +143,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode,
|
||||
; // perform the deletion
|
||||
else
|
||||
{
|
||||
if (levelBefore == levelAfter)
|
||||
if (mDeleteBidiImmediately || levelBefore == levelAfter)
|
||||
; // perform the deletion
|
||||
else
|
||||
*aCancel = PR_TRUE;
|
||||
|
@ -927,6 +927,10 @@ pref("bidi.support", 1);
|
||||
// 1 = doccharactersetBidi *
|
||||
// 2 = defaultcharactersetBidi
|
||||
pref("bidi.characterset", 1);
|
||||
// Whether delete and backspace should immediately delete characters not
|
||||
// visually adjacent to the caret, or adjust the visual position of the caret
|
||||
// on the first keypress and delete the character on a second keypress
|
||||
pref("bidi.edit.delete_immediately", false);
|
||||
|
||||
|
||||
// used for double-click word selection behavior. Win will override.
|
||||
|
Loading…
x
Reference in New Issue
Block a user