Ignore:
Timestamp:
02/22/08 19:53:07 (17 years ago)
Author:
Nicholas Riley
Message:

APEMain.m: Note missing Xcode 3 support. Add Terminal 2.0 support.

English.lproj/APE Manager plugin.nib:

English.lproj/APEInfo.rtfd:

ICeCoffEE.[hm]: Bring triggering window and app to front if error
dialog displayed in ICCF_HandleException. Remove initial word
selection. Launch preexisting selection if present. Remove 10.3
support. Update for new ICeCoffEETrigger API. Rename downEvent
parameter for consistency.

ICeCoffEE.xcodeproj: Added files.

ICeCoffEEParser.m: Handle multiline URLs.

ICeCoffEETTView.[hm]: Terminal 2.0 support (thank you for having a
usable NSTextInput implementation!)

ICeCoffEETTViewTrigger.[hm]: ICeCoffEETrigger implementation for
TTView. Can't set range as we do for NSTextView because you can't
have an arbitrary empty selection range in Terminal, so we pass it
directly to ICCF_LaunchURLFromTTView.

ICeCoffEETerminal.[hm]: Fix capitalization on ICeCoffEETermSubviewSuper.
Pass downEvent to ICCF_HandleException so it can bring the triggering
window to the front.

ICeCoffEETextViewTrigger.[hm]: Moved from ICeCoffEETrigger.

ICeCoffEETrigger.[hm]: Now an abstract superclass. Replace direct
access to ICCF_sharedTrigger with +cancel. Create 0-character range
(if click outside selectedRange) or save selectedRange. Move
debugging logs here from ICeCoffEE.m. Add description method.

ICeCoffEEWebKit.m: Pass downEvent to ICCF_HandleException so it can
bring the triggering window to the front.

Installer components/ui/ui.plist: Updated for 1.5d3.

TestParser.m: Handle multiline URLs; newlines are printed as \ and
tabs as >. Implement ICCF_StringByRemovingCharactersInSet, which will
move elsewhere once Internet Config support is removed.

VERSION.xcconfig: Updated for 1.5d3.

urls.plist: Test for multiline URLs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/TestParser.m

    r382 r388  
    2727}
    2828
     29static NSString *tc(NSString *s) {
     30    NSMutableString *rs = [s mutableCopy];
     31    [rs replaceOccurrencesOfString: @"\n" withString: @"\\" options: 0 range: NSMakeRange(0, [s length])];
     32    [rs replaceOccurrencesOfString: @"\t" withString: @">" options: 0 range: NSMakeRange(0, [s length])];
     33    return [rs autorelease];
     34}
     35
    2936NSString *ICCF_ErrString(OSStatus err, NSString *context) {   
    3037    return [NSString stringWithFormat: @"%@ (%d)", context, (int)err];
     
    4249
    4350
     51// XXX move elsewhere
     52static NSString *ICCF_StringByRemovingCharactersInSet(NSString *s, NSCharacterSet *set) {
     53    NSRange range = [s rangeOfCharacterFromSet: set options: 0 range: NSMakeRange(0, [s length])];
     54    if (range.location == NSNotFound)
     55        return s;
     56   
     57    NSMutableString *ms = [s mutableCopy];
     58    do {
     59        [ms deleteCharactersInRange: range];
     60        range.length = [ms length] - range.location;
     61        range = [ms rangeOfCharacterFromSet: set options: 0 range: range];
     62    } while (range.location != NSNotFound);
     63   
     64    s = [[ms copy] autorelease];
     65    [ms release];
     66    return s;
     67}
     68
    4469static BOOL check_parse(NSString *uri, NSString *text,
    4570                        NSRange delimitedURIRange, NSRange initialSelectionRange) {
     
    5176    @try {
    5277        enclosingRange = ICCF_URLEnclosingRange(text, initialSelectionRange);
    53         parsedURI = [text substringWithRange: enclosingRange];
     78        // XXX move trimming elsewhere
     79        parsedURI = ICCF_StringByRemovingCharactersInSet([text substringWithRange: enclosingRange], [NSCharacterSet whitespaceAndNewlineCharacterSet]);
    5480    } @catch (NSException *e) {
    5581        parseException = e;
     
    6086    }
    6187   
    62     ps(@"Text       %@", text);
     88    ps(@"Text       %@", tc(text));
    6389    pr(@"Available ", delimitedURIRange);
    6490    pr(@"Starting  ", initialSelectionRange);
     
    6894    } else {
    6995        pr(@"Parsed    ", enclosingRange);
    70         ps(@"Parsed     %@", parsedURI);
    71         ps(@"Desired    %@", uri);
     96        ps(@"Parsed     %@", tc(parsedURI));
     97        ps(@"Desired    %@", tc(uri));
    7298    }
    7399    return NO;
Note: See TracChangeset for help on using the changeset viewer.