Skip to content
Snippets Groups Projects
Commit 93712728 authored by George Nachman's avatar George Nachman
Browse files

More OSC 8 changes: use colons to delimit params and hover adjacent links...

More OSC 8 changes: use colons to delimit params and hover adjacent links together if their URLs and IDs are equal, or if the URLs are equal and the IDs are both unspecified.
parent 037cb5c2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -124,11 +124,13 @@
action.range = [extractor rangeOfCoordinatesAround:coord
maximumDistance:1000
passingTest:^BOOL(screen_char_t *c, VT100GridCoord coord) {
// For now a difference in URL code implies separate hovering.
// This could be because there's a different parameter--even an
// undefined one. Discussion here:
// https://bugzilla.gnome.org/show_bug.cgi?id=779734
return (c->urlCode == oc.urlCode);
if (c->urlCode == oc.urlCode) {
return YES;
}
NSString *thisId;
NSURL *thisURL = [extractor urlOfHypertextLinkAt:coord urlId:&thisId];
// Hover together only if URL and ID are equal.
return ([thisURL isEqual:url] && (thisId == urlId || [thisId isEqualToString:urlId]));
}];
return action;
} else {
Loading
Loading
Loading
Loading
@@ -8,6 +8,7 @@
 
#import <Foundation/Foundation.h>
 
// See https://bugzilla.gnome.org/show_bug.cgi?id=779734 for the original discussion.
@interface iTermURLStore : NSObject
 
+ (instancetype)sharedInstance;
Loading
Loading
Loading
Loading
@@ -89,7 +89,7 @@
return nil;
}
 
NSArray<NSString *> *parts = [params componentsSeparatedByString:@" "];
NSArray<NSString *> *parts = [params componentsSeparatedByString:@":"];
for (NSString *part in parts) {
NSInteger i = [part rangeOfString:@"="].location;
if (i != NSNotFound) {
Loading
Loading
Loading
Loading
@@ -63,5 +63,8 @@ Invisible explicit and implicit link: ]8;;http://example.com/invisibleCan
The following three links have the same target. The first two should highlight together.
]8;id=id1;http://example.com/<Some text with id=id1>]8;;]8;id=id1;http://example.com/]8;id=id1;http://example.com/<More text with id=id1>]8;;]8;id=id2;http://example.com/<Some text with id=id2>]8;;
 
The following links have the same target, same ID, but different spam parameters. spam is not defined.
]8;spam=id1;http://example.com/<Some text with spam=id1>]8;;]8;spam=id1;http://example.com/]8;spam=id1;http://example.com/<More text with spam=id1>]8;;]8;spam=id2;http://example.com/<Some text with spam=id2>]8;;
The following links have the same target, same ID, but different spam parameters. spam is not defined. They should all hover as one.
]8;spam=id1;http://example.com/<Some text with spam=id1>]8;;]8;spam=id2;http://example.com/<Some text with spam=id2>]8;;]8;spam=id3;http://example.com/<Some text with spam=id3>]8;;
These links have both an undefined spam parameter and an id. They should hover separately.
]8;spam=1:id=1;http://example.com/<Some text with spam=1;id=1>]8;;]8;spam=1:id=2;http://example.com/<More text with spam=1;id=2>]8;;]8;spam=1:id=3;http://example.com/<Some text with spam=1;id=3>]8;;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment