mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-17 08:01:24 +00:00
move special del handling into typeString away from keyDown
This commit is contained in:
parent
725da9e9c8
commit
c567c110a3
1 changed files with 14 additions and 18 deletions
|
@ -806,19 +806,23 @@
|
|||
NSUInteger strLen;
|
||||
|
||||
strLen = [string length];
|
||||
[self putString:string];
|
||||
|
||||
// if we have a single backspace or delete character
|
||||
if (strLen == 1 && [string characterAtIndex:strLen-1] == '\177')
|
||||
if (strLen == 1)
|
||||
{
|
||||
NSUInteger textLen;
|
||||
// if we have a single backspace or delete character
|
||||
if([string characterAtIndex:0] == '\177') // del (maybe backspace)
|
||||
{
|
||||
NSUInteger textLen;
|
||||
NSString *tss = [[tView textStorage] string];
|
||||
|
||||
textLen = [[tView string] length];
|
||||
[tView setSelectedRange:NSMakeRange(textLen-1, 1)];
|
||||
[tView delete:nil];
|
||||
return;
|
||||
if (![tss hasSuffix:@"\n"] && ![tss hasSuffix:@"(gdb) "])
|
||||
{
|
||||
textLen = [[tView string] length];
|
||||
[tView setSelectedRange:NSMakeRange(textLen-1, 1)];
|
||||
[tView delete:nil];
|
||||
}
|
||||
}
|
||||
[self putChar: [string characterAtIndex:0]];
|
||||
}
|
||||
|
||||
[self logString:string newLine:NO withColor:userInputColor];
|
||||
}
|
||||
|
||||
|
@ -861,14 +865,6 @@
|
|||
{
|
||||
[self typeString: @"\n"];
|
||||
}
|
||||
else if (c == 127) // del (usually backspace)
|
||||
{
|
||||
NSString *tss = [[tView textStorage] string];
|
||||
if (![tss hasSuffix:@"\n"] && ![tss hasSuffix:@"(gdb) "])
|
||||
{
|
||||
[self typeString: chars];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[self typeString: chars];
|
||||
|
|
Loading…
Reference in a new issue