Permalink
Browse files

Merge pull request #21 from corvino/master

[FIX] 10.10 compatibility and discount upgrade. (Nathan Corvino)
  • Loading branch information...
2 parents bed96f7 + fc80390 commit 7f22cac676923e2650caa4781eeb5dab30f2e048 @rentzsch committed Apr 8, 2015
Showing with 2,012 additions and 2,298 deletions.
  1. +1 −1 EditPaneLayoutManager.h
  2. +0 −5 EditPaneLayoutManager.m
  3. +1 −1 EditPaneTextView.h
  4. +26 −13 EditPaneTextView.m
  5. +279 −1,655 English.lproj/MyDocument.xib
  6. +1 −1 MLAppDelegate.h
  7. +15 −21 MarkdownLive.xcodeproj/project.pbxproj
  8. +9 −12 MyDocument.m
  9. +3 −2 discount-config/update.sh
  10. +25 −42 discount/COPYRIGHT
  11. +3 −1 discount/CREDITS
  12. +1 −1 discount/Csio.c
  13. +44 −33 discount/Makefile.in
  14. +1 −1 discount/README
  15. +1 −1 discount/VERSION
  16. +33 −0 discount/blocktags
  17. +4 −2 {discount-config → discount}/config.h
  18. +119 −63 discount/configure.inc
  19. +24 −4 discount/configure.sh
  20. +2 −2 discount/cstring.h
  21. +1 −1 discount/emmatch.c
  22. +1 −0 discount/flags.c
  23. +160 −80 discount/generate.c
  24. +100 −0 discount/github_flavoured.c
  25. +0 −2 discount/html5.c
  26. +25 −7 discount/main.c
  27. +1 −1 discount/makepage.1
  28. +0 −1 discount/makepage.c
  29. +12 −4 discount/markdown.1
  30. +260 −151 discount/markdown.c
  31. +47 −3 discount/markdown.h
  32. +1 −1 discount/mkd2html.1
  33. +18 −12 discount/mkd2html.c
  34. +31 −24 discount/mkdio.c
  35. +8 −1 {discount-config → discount}/mkdio.h
  36. +8 −1 discount/mkdio.h.in
  37. +89 −0 discount/mktags.c
  38. +138 −0 discount/pgm_options.c
  39. +9 −0 discount/pgm_options.h
  40. +6 −4 discount/resource.c
  41. +1 −9 discount/setup.c
  42. +37 −66 discount/tags.c
  43. +5 −0 discount/tests/backslash.t
  44. +131 −0 discount/tests/code.t
  45. +23 −0 discount/tests/defects.t
  46. +4 −9 discount/tests/dl.t
  47. +85 −0 discount/tests/extrafootnotes.t
  48. +7 −2 discount/tests/functions.sh
  49. +0 −9 discount/tests/html.t
  50. +44 −3 discount/tests/list.t
  51. +2 −4 discount/tests/para.t
  52. +1 −1 discount/tests/peculiarities.t
  53. +1 −1 discount/tests/reddit.t
  54. +3 −2 discount/tests/smarty.t
  55. +1 −0 discount/tests/strikethrough.t
  56. +2 −0 discount/tests/style.t
  57. +79 −14 discount/tests/tables.t
  58. +8 −4 discount/tests/toc.t
  59. +20 −2 discount/theme.1
  60. +25 −6 discount/theme.c
  61. +21 −10 discount/toc.c
  62. +3 −0 discount/version.c.in
  63. +2 −2 discount_wrappers/discountWrapper.m
@@ -13,7 +13,7 @@
NSFont *font;
}
-@property (nonatomic, retain) NSFont *font;
+@property (nonatomic, strong) NSFont *font;
- (CGFloat)lineHeight;
@@ -18,16 +18,11 @@ - (id)init {
if ((self = [super init])) {
EditPaneTypesetter *typeSetter = [[EditPaneTypesetter alloc] init];
[self setTypesetter:typeSetter];
- [typeSetter release];
[self setUsesFontLeading:NO];
}
return self;
}
-- (void)dealloc {
- self.font = nil;
- [super dealloc];
-}
- (CGFloat)lineHeight {
return floor([self defaultLineHeightForFont:font] + 1.5);
View
@@ -13,7 +13,7 @@ extern NSString * const kEditPaneTextViewChangedNotification;
@class EditPaneLayoutManager;
@interface EditPaneTextView : NSTextView {
- EditPaneLayoutManager *layoutMan;
+ __weak EditPaneLayoutManager *layoutMan;
}
- (void)updateColors;
View
@@ -27,36 +27,49 @@ - (void)awakeFromNib {
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneForegroundColor]
options:0
- context:kEditPaneColorChangedNotification];
+ context:(__bridge void *)kEditPaneColorChangedNotification];
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneBackgroundColor]
options:0
- context:kEditPaneColorChangedNotification];
+ context:(__bridge void *)kEditPaneColorChangedNotification];
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneSelectionColor]
options:0
- context:kEditPaneColorChangedNotification];
+ context:(__bridge void *)kEditPaneColorChangedNotification];
[defaultsController addObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneCaretColor]
options:0
- context:kEditPaneColorChangedNotification];
+ context:(__bridge void *)kEditPaneColorChangedNotification];
[self setUsesFontPanel:NO];
NSTextContainer *textContainer = [[NSTextContainer alloc] init];
[textContainer setContainerSize:[[self textContainer] containerSize]];
[textContainer setWidthTracksTextView:YES];
- layoutMan = [[EditPaneLayoutManager alloc] init];
[self replaceTextContainer:textContainer];
- [textContainer replaceLayoutManager:layoutMan];
- [textContainer release];
+
+ EditPaneLayoutManager *lManager = [[EditPaneLayoutManager alloc] init];
+ [textContainer replaceLayoutManager:lManager];
+ layoutMan = lManager;
}
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [[NSUserDefaultsController sharedUserDefaultsController] removeObserver:self];
- [layoutMan release];
- [super dealloc];
+
+ NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController];
+
+ [defaultsController removeObserver:self
+ forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneForegroundColor]
+ context:(__bridge void *)kEditPaneColorChangedNotification];
+ [defaultsController removeObserver:self
+ forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneBackgroundColor]
+ context:(__bridge void *)kEditPaneColorChangedNotification];
+ [defaultsController removeObserver:self
+ forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneSelectionColor]
+ context:(__bridge void *)kEditPaneColorChangedNotification];
+ [defaultsController removeObserver:self
+ forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneCaretColor]
+ context:(__bridge void *)kEditPaneColorChangedNotification];
}
- (void)keyDown:(NSEvent *)aEvent {
@@ -69,7 +82,7 @@ - (void)setMarkedText:(id)aString
selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange {
id resultString;
if ([aString isKindOfClass:[NSAttributedString class]]) {
- resultString = [[aString mutableCopy] autorelease];
+ resultString = [aString mutableCopy];
selectedRange = NSMakeRange(0, [resultString length]);
NSDictionary *attrs = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName,
@@ -106,8 +119,8 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
#pragma unused(keyPath)
#pragma unused(object)
#pragma unused(change)
-
- if ([(NSString *)context isEqualToString:kEditPaneColorChangedNotification]) {
+
+ if ([(__bridge NSString *)context isEqualToString:kEditPaneColorChangedNotification]) {
[self updateColors];
}
}
Oops, something went wrong.

0 comments on commit 7f22cac

Please sign in to comment.