smart paste at end fix

This commit is contained in:
daboe01 committed 2015-06-25 20:48:30 +02:00
1 parent fa3567cb9f
commit cca142ce86
1 file changed
+4 -2
+4 -2
View File
@@ -232,7 +232,8 @@ var kDelegateRespondsTo_textShouldBeginEditing
if (_copySelectionGranularity > 0 && _selectionRange.location > 0)
{
if (!_isWhitespaceCharacter([[_textStorage string] characterAtIndex:_selectionRange.location - 1]))
if (!_isWhitespaceCharacter([[_textStorage string] characterAtIndex:_selectionRange.location - 1]) &&
_selectionRange.location != [_layoutManager numberOfCharacters])
{
[self insertText:" "];
}
@@ -263,7 +264,8 @@ var kDelegateRespondsTo_textShouldBeginEditing
if (_copySelectionGranularity > 0)
{
if (!_isWhitespaceCharacter([[_textStorage string] characterAtIndex:CPMaxRange(_selectionRange)]) &&
!_isNewlineCharacter([[_textStorage string] characterAtIndex:MAX(0, _selectionRange.location - 1)]))
!_isNewlineCharacter([[_textStorage string] characterAtIndex:MAX(0, _selectionRange.location - 1)]) &&
_selectionRange.location != [_layoutManager numberOfCharacters])
{
[self insertText:" "];
}