Ignore:
Timestamp:
06/11/07 01:21:55 (17 years ago)
Author:
Nicholas Riley
Message:

VERSION: Starting with 1.5d1.

ICeCoffEEKeyEquivalents.m: Support "collision font" for displaying key
equivalent conflicts.

ICeCoffEE.m: Increase debug ICCF_MAX_URL_LEN to 120 for testing. Set
icons in ICCF_ConsolidateServicesMenu (needs better caching).

ICeCoffEEServicePrefController.m: Display icons, proper key
equivalents (instead of #, what was I thinking?!) and conflicts. Fix
a dumb bug in ICCF_PropagateServiceStateChange. Ellipsize long menu
items rather than chopping them off. Fix key equivalent column
getting moved when expanding disclosure triangles.

ICeCoffEELabeledIconCell.[hm]: An IconRef-displaying text cell.

Info-APE Module.plist: Update version to 1.5d1.

ICeCoffEE.xcodeproj: Added files, no significant changes.

English.lproj/InfoPlist.strings: Update version to 1.5d1.

English.lproj/APEInfo.rtfd/TXT.rtf: Some overdue documentation
updates.

ICeCoffEEShared.[hm]: Enable debugging; we're now using
kICServiceShortcut (though not yet for customizable shortcuts) so
define its data type.

ICeCoffEETerminal.m: Remove some useless code to "extend to beginning
of string" which seems to have been stolen from the NSTextView
implementation and not well understood. Handle common uses of
parentheses in URLs; still need to do this for NSTextView.

ICeCoffEESetServicesMenu.[hm]: Needs renaming; now with icon
extraction functionality and semi-working code to create a service
info dictionary.

Info-APEManagerPrefPane.plist: Update version to 1.5d1.

File:
1 edited

Legend:

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

    r216 r319  
    300300            selRange = [ICeCoffEETerminalRange rangeWithTerminal: self];
    301301        } else { // select something
     302            // XXX test this next line, it may be what's causing a Terminal bug to exhibit itself
    302303            [storage selectWordAtLine: ICCF_line offset: ICCF_col];
    303304            selRange = [ICeCoffEETerminalRange rangeWithTerminal: self];
     
    312313
    313314        termRange = [ICeCoffEETerminalRange rangeWithTerminal: self pt0: [selRange pt0] pt1: [selRange pt0]];
    314         // add 1 to range to trap delimiters that are on the edge of the selection (i.e., <...)
    315         [termRange growForwardByLength: 1];
    316315        [termRange growBackwardByLength: ICCF_MAX_URL_LEN]; // potentially too big
    317         s = [termRange stringFromRange];
     316       
     317expandFront:
     318        s = [termRange stringFromRange];
    318319        ICLog(@"front %@", termRange);
    319320        delimiterRange = [s rangeOfCharacterFromSet: urlLeftDelimiters
     
    321322        if (delimiterRange.location == NSNotFound) {
    322323            // extend to beginning of string (as much as possible)
    323             [selRange growBackwardByLength: [s length] - 1];
     324            [selRange growBackwardByLength: [s length]];
    324325        } else {
    325326            NSCAssert(delimiterRange.length == 1, @"Internal error: delimiter matched range is not of length 1");
    326             [selRange growBackwardByLength: [s length] - delimiterRange.location - 2];
     327            [selRange growBackwardByLength: [s length] - delimiterRange.location - 1];
     328            // in https://www-s.acm.uiuc.edu/wiki/space/(user)njriley - handle clicking inside or after (user).
     329            if ([s characterAtIndex: delimiterRange.location] == '(') {
     330                s = [selRange stringFromRange];
     331                if ([s rangeOfString: @")"].location != NSNotFound ||
     332                    [s rangeOfCharacterFromSet: [NSCharacterSet characterSetWithCharactersInString: @"/."]].location == NSNotFound) {
     333                    [selRange growBackwardByLength: 1];
     334                    ICLog(@"expanding past (, now %@", selRange);
     335                    [termRange shrinkBackByLength: [[termRange stringFromRange] length] - delimiterRange.location];
     336                    goto expandFront;
     337                }
     338            }
    327339        }
    328340
     
    330342
    331343        termRange = [ICeCoffEETerminalRange rangeWithTerminal: self pt0: [selRange pt1] pt1: [selRange pt1]];
    332         // subtract 1 from range to trap delimiters that are on the edge of the selection (i.e., ...>)
    333         [termRange growBackwardByLength: 1];
    334344        [termRange growForwardByLength: ICCF_MAX_URL_LEN]; // potentially too big
    335         s = [termRange stringFromRange];
     345       
     346expandBack:
     347        s = [termRange stringFromRange];
    336348        ICLog(@"back %@", termRange);
    337349        delimiterRange = [s rangeOfCharacterFromSet: urlRightDelimiters
     
    339351        if (delimiterRange.location == NSNotFound) {
    340352            // extend to end of string
    341             [selRange growForwardByLength: [s length] - 1];
     353            [selRange growForwardByLength: [s length]];
    342354        } else {
    343355            NSCAssert(delimiterRange.length == 1, @"Internal error: delimiter matched range is not of length 1");
    344             [selRange growForwardByLength: delimiterRange.location - 1];
     356            [selRange growForwardByLength: delimiterRange.location];
     357            // URL may look like "https://www-s.acm.uiuc.edu/wiki/space/(user" now; expand if so
     358            if ([s characterAtIndex: delimiterRange.location] == ')' &&
     359                [[selRange stringFromRange] rangeOfString: @"("].location != NSNotFound) {
     360                [selRange growForwardByLength: 1];
     361                ICLog(@"expanding past ), now %@", selRange);
     362                [termRange shrinkFrontByLength: delimiterRange.location + 1];
     363                goto expandBack;
     364            }
    345365        }
    346366
Note: See TracChangeset for help on using the changeset viewer.