Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes, etc. #18

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e796fd9
Removing unnecessary object replacement.
Sep 1, 2012
7e47752
Moving discount to External.
Sep 3, 2012
b582c09
Updating to discount v2.1.5a.
Sep 3, 2012
bab7160
Cleaning order of items in project.
Sep 3, 2012
17ba082
Moving selection methods into the new NSTextView+EditSelectionWithUnd…
Sep 4, 2012
04672b6
Fixing edge case in “-_addStringBeforeSelectedLines:skippingEmptyLine…
Sep 4, 2012
8e95621
Fixing compatibility with 32-bit runtime.
Sep 4, 2012
1cf10c8
Fixing toolbar icon design for 10.6.
Sep 4, 2012
79060e6
Main Menu nib touched by Xcode.
Sep 4, 2012
f077317
Adding “View” menu to allow toolbar customization.
Sep 4, 2012
7dcf67f
[VERSION] 1.8
Sep 4, 2012
a2c4979
Modernizing framework linking.
Sep 20, 2012
2bf0394
Preventing “update.sh” from running with a dirty working directory.
Sep 20, 2012
f191405
Improving update.sh.
Sep 20, 2012
6e35560
Keeping “version.c” after running update.sh.
Sep 20, 2012
e03f64a
Cleaning unnecessary duplication of COMBINE_HIDPI_IMAGES.
Sep 20, 2012
7ad5609
Adding target for markdown CLI tool.
Sep 20, 2012
1d2adb0
Removing GCC_WARN_64_TO_32_BIT_CONVERSION for discount code.
Sep 20, 2012
6614dbc
Fixing indentation settings for discount code.
Sep 20, 2012
f1d6d70
Fixing issues reported by Xcode 5.
Oct 20, 2013
bb3553a
Updating to discount v2.1.7 + CLang/LLVM fixes.
Oct 20, 2013
6aec43b
Converted to ARC
davbeck May 3, 2013
e1e01c5
Fixed Xcode warnings
davbeck May 4, 2013
57a72e2
Fixing typo.
Oct 20, 2013
32f23eb
Fixing ARC conversion.
Nov 23, 2013
3059e39
Implementing automatic preview scaling based on the ration between us…
Jan 28, 2014
82702e3
Adding Menlo to fixed-width text CSS styles.
Jan 28, 2014
37439c8
Setting SKIP_INSTALL to YES.
Jan 28, 2014
ff8268c
Lowercasing the first letter of an untitled document name as per HIG.
Jan 28, 2014
efda1dc
Removing install path.
Jan 28, 2014
a8b4737
Setting deployment target to 10.7.
Jan 28, 2014
4d7210b
Implementing support for window title disambiguation.
Jan 28, 2014
53a46b9
Only -updateContent if it’s the document’s NSTextView that has been e…
Mar 2, 2014
c0a5911
Cleanup.
Apr 29, 2014
fb22064
Cleanup.
Apr 29, 2014
9958cfa
Fixing “removeObserver:” usage.
Dec 1, 2014
1aded48
Updating project using Xcode 6.1.
Dec 1, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EditPaneLayoutManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
NSFont *font;
}

@property (nonatomic, retain) NSFont *font;
@property (nonatomic, strong) NSFont *font;

- (CGFloat)lineHeight;

Expand Down
5 changes: 0 additions & 5 deletions EditPaneLayoutManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
33 changes: 22 additions & 11 deletions EditPaneTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#import "PreferencesController.h"

NSString * const kEditPaneTextViewChangedNotification = @"EditPaneTextViewChangedNotification";
NSString * const kEditPaneColorChangedNotification = @"EditPaneColorChangedNotification";
void *kEditPaneColorChangedNotification = &kEditPaneColorChangedNotification;

@implementation EditPaneTextView

Expand Down Expand Up @@ -43,20 +43,29 @@ - (void)awakeFromNib {

[self setUsesFontPanel:NO];

NSTextContainer *textContainer = [[NSTextContainer alloc] init];
[textContainer setContainerSize:[[self textContainer] containerSize]];
NSTextContainer *textContainer = [self textContainer];
[textContainer setWidthTracksTextView:YES];
layoutMan = [[EditPaneLayoutManager alloc] init];
[self replaceTextContainer:textContainer];
[textContainer replaceLayoutManager:layoutMan];
[textContainer release];
}

- (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:kEditPaneColorChangedNotification];
[defaultsController removeObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneBackgroundColor]
context:kEditPaneColorChangedNotification];
[defaultsController removeObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneSelectionColor]
context:kEditPaneColorChangedNotification];
[defaultsController removeObserver:self
forKeyPath:[NSString stringWithFormat:@"values.%@", kEditPaneCaretColor]
context:kEditPaneColorChangedNotification];
}

- (void)keyDown:(NSEvent *)aEvent {
Expand All @@ -69,7 +78,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,
Expand Down Expand Up @@ -107,9 +116,11 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
#pragma unused(object)
#pragma unused(change)

if ([(NSString *)context isEqualToString:kEditPaneColorChangedNotification]) {
if (context == kEditPaneColorChangedNotification) {
[self updateColors];
}
} else {
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
}

@end
Loading