Permalink
Browse files

Improved the auto markdown reference link trick

  • Loading branch information...
1 parent b4f891f commit 41b037a46c8eedbf5e3bda4e9e7a62375438dbfb @elasticthreads elasticthreads committed Sep 16, 2011
Showing with 180 additions and 154 deletions.
  1. +1 −0 AppController.m
  2. +10 −2 LinkingEditor.h
  3. +169 −152 LinkingEditor.m
View
@@ -3315,6 +3315,7 @@ - (void)reActivate:(id)sender{
#pragma mark NSPREDICATE TO FIND MARKDOWN REFERENCE LINKS
- (IBAction)testThing:(id)sender{
NSString *testString=@"not []http://sdfas as\n\not [][]\n not [](http://)\n a [a ref]: http://nytimes.com \n squirels [another ref]: http://google.com \n http://squarshit \n how's tthat http his lorem ipsum";
+
NSArray *foundLinks=[self referenceLinksInString:testString];
if (foundLinks&&([foundLinks count]>0)) {
NSLog(@"found'em:%@",[foundLinks description]);
View
@@ -49,11 +49,16 @@
NSString *beforeString;
NSString *afterString;
+ NSString *activeParagraph;
+ NSString *activeParagraphPastCursor;
+ NSString *activeParagraphBeforeCursor;
}
-
+@property (readonly) NSString *activeParagraphBeforeCursor;
+@property (readonly) NSString *activeParagraphPastCursor;
@property (readonly) NSString *beforeString;
@property (readonly) NSString *afterString;
+@property (readonly) NSString *activeParagraph;
- (NSColor*)_insertionPointColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor;
- (NSColor*)_linkColorForForegroundColor:(NSColor*)fgColor backgroundColor:(NSColor*)bgColor;
@@ -85,8 +90,11 @@
- (BOOL)didRenderFully;
#pragma mark ElasticThreads additions
+
+- (NSString *)pairedCharacterForString:(NSString *)pairString;
+- (NSRange)rangeOfActiveParagraph;
- (NSUInteger)cursorIsInsidePair:(NSString *)closingCharacter;
-- (BOOL)pairIsOnOwnParagraph:(NSString *)closingChar;
+- (BOOL)pairIsOnOwnParagraph:(NSString *)closingCharacter;
- (BOOL)cursorIsImmediatelyPastPair:(NSString *)closingCharacter;
- (IBAction)performFindPanelAction:(id)sender;
- (void)updateTextColors;
Oops, something went wrong.

0 comments on commit 41b037a

Please sign in to comment.