Update text storage directly when undoing text changes in a NSTextView

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35175 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2012-06-02 22:31:54 +00:00
parent 1d0daa994b
commit d69b1eed65
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2012-06-03 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextView.m (-performUndo): Update text storage directly
when undoing text changes.
2012-06-03 Wolfgang Lux <wolfgang.lux@gmail.com>
* Tools/GSspell.m (-spellerForLanguage:): Force aspell to return

View file

@ -6388,8 +6388,15 @@ or add guards
replacementString: (string ? (NSString*)[string string]
: (NSString*)@"")])
{
[tv replaceCharactersInRange: range
withAttributedString: string];
if ([string length] > 0)
{
[aTextStorage replaceCharactersInRange: range
withAttributedString: string];
}
else
{
[aTextStorage replaceCharactersInRange: range withString: @""];
}
range.length = [string length];
if ([[tv undoManager] isUndoing])
[tv setSelectedRange: range];