mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: smart copy/paste cycle was leaving an additional whitespace on the LHS (#2776)
This commit is contained in:
@@ -467,12 +467,20 @@ var kDelegateRespondsTo_textShouldBeginEditing
|
||||
|
||||
var shouldUseSmartPasting = [self _shouldUseSmartPasting];
|
||||
|
||||
if (shouldUseSmartPasting && _selectionRange.location > 0)
|
||||
if (shouldUseSmartPasting)
|
||||
{
|
||||
if (!_isWhitespaceCharacter([[_textStorage string] characterAtIndex:_selectionRange.location - 1]) &&
|
||||
_selectionRange.location != [_layoutManager numberOfCharacters])
|
||||
if (_isWhitespaceCharacter([[stringForPasting string] characterAtIndex:0]))
|
||||
{
|
||||
[self insertText:" "];
|
||||
if (_selectionRange.location == 0 ||
|
||||
_isWhitespaceCharacter([[_textStorage string] characterAtIndex:_selectionRange.location - 1]) &&
|
||||
_selectionRange.location != [_layoutManager numberOfCharacters])
|
||||
[stringForPasting deleteCharactersInRange:CPMakeRange(0, 1)];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_selectionRange.location > 0 &
|
||||
!_isWhitespaceCharacter([[_textStorage string] characterAtIndex:_selectionRange.location - 1]))
|
||||
[self insertText:" "];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user