From a5388adc61c9429e28e7029ac361f12cdde0517e Mon Sep 17 00:00:00 2001 From: darin Date: Sat, 19 Mar 2005 17:09:07 +0000 Subject: [PATCH] Reviewed by Ken and John. - fixed REGRESSION (402-403): deleteWordForward: and deleteWordBackward: start deleting single characters after the first delete * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): Fixed backwards logic in here and added missing check. Set action to one of the two typing actions only if isTypingAction is YES. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8933 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit/ChangeLog | 10 ++++++++++ WebKit/WebView.subproj/WebHTMLView.m | 24 +++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog index 01f87cc8d7f4..06095b093f59 100644 --- a/WebKit/ChangeLog +++ b/WebKit/ChangeLog @@ -1,3 +1,13 @@ +2005-03-19 Darin Adler + + Reviewed by Ken and John. + + - fixed REGRESSION (402-403): deleteWordForward: and deleteWordBackward: start deleting single characters after the first delete + + * WebView.subproj/WebHTMLView.m: (-[WebHTMLView _deleteWithDirection:granularity:killRing:isTypingAction:]): + Fixed backwards logic in here and added missing check. Set action to one of the two typing actions only + if isTypingAction is YES. + 2005-03-19 David Harrison Reviewed by me (written by Patti Yeh). diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m index 7c9d2cf6a398..8bf88a723555 100644 --- a/WebKit/WebView.subproj/WebHTMLView.m +++ b/WebKit/WebView.subproj/WebHTMLView.m @@ -4266,19 +4266,21 @@ NSStrokeColorAttributeName /* NSColor, default nil: same as foreground co if ([self _hasSelection]) { range = [self _selectedRange]; - deletionAction = isTypingAction ? deleteSelectionAction : deleteKeyAction; + if (isTypingAction) + deletionAction = deleteKeyAction; } else { range = [[self _bridge] rangeByAlteringCurrentSelection:WebSelectByExtending direction:direction granularity:granularity]; - switch (direction) { - case WebSelectForward: - case WebSelectRight: - deletionAction = forwardDeleteKeyAction; - break; - case WebSelectBackward: - case WebSelectLeft: - deletionAction = deleteKeyAction; - break; - } + if (isTypingAction) + switch (direction) { + case WebSelectForward: + case WebSelectRight: + deletionAction = forwardDeleteKeyAction; + break; + case WebSelectBackward: + case WebSelectLeft: + deletionAction = deleteKeyAction; + break; + } } if (range == nil || [range collapsed] || ![self _shouldDeleteRange:range]) -- 2.36.0