diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1ed67965..d16134ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ All code should obey the 80-column rule. Exception: If a URL in a comment is too long, it can go over the limit. This happens a lot for Apple’s official documentation. Remember, however, that many websites offer alternative, shorter URL forms that are permanent. For example: -* The title slug in StackOverflow (and other StackExchange sites) URLs can be ommitted. The following two are equivalent: +* The title slug in StackOverflow (and other StackExchange sites) URLs can be omitted. The following two are equivalent: `http://stackoverflow.com/questions/13155612/how-does-one-eliminate-objective-c-try-catch-blocks-like-this` `http://stackoverflow.com/questions/13155612` @@ -29,7 +29,7 @@ Exception: If a URL in a comment is too long, it can go over the limit. This hap * If only one statement is contained inside the block, omit braces unless... * This is part of an if-(else if-)else structure. All brace styles in the same structure should match (i.e. either non or all of them omit braces). -#### Stetements Inside `if`, `while`, etc. +#### Statements Inside `if`, `while`, etc. * Prefer implicit boolean conversion when it makes sense. * `if (str.length)` is better than `if (str.length != 0)` if you want to know whether a string is empty. @@ -56,7 +56,7 @@ Exception: If a URL in a comment is too long, it can go over the limit. This hap } ``` -* If code alignment is ambiguious, add extra indentation. +* If code alignment is ambiguous, add extra indentation. Yes: ```c @@ -88,7 +88,7 @@ Exception: If a URL in a comment is too long, it can go over the limit. This hap Always use *four spaces* instead of tabs for indentation. Trailing whitespaces should be removed. You can turn on the **Automatically trim trailing whitespace** option in Xcode to let it do the job for you. -Try to ensure that there’s a trailing newline in the end of a file. This is not strictly enforced since there are no easy ways to do that (except checking manually), but I’d appriciate the effort. +Try to ensure that there’s a trailing newline in the end of a file. This is not strictly enforced since there are no easy ways to do that (except checking manually), but I’d appreciate the effort. ## Version Control diff --git a/MacDown/Code/Application/MPMainController.m b/MacDown/Code/Application/MPMainController.m index 5a46edce..6d0ade24 100644 --- a/MacDown/Code/Application/MPMainController.m +++ b/MacDown/Code/Application/MPMainController.m @@ -249,7 +249,7 @@ - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender { if (self.preferences.filesToOpen.count || self.preferences.pipedContentFileToOpen) return NO; - return !self.preferences.supressesUntitledDocumentOnLaunch; + return !self.preferences.suppressesUntitledDocumentOnLaunch; } - (void)applicationDidBecomeActive:(NSNotification *)notification diff --git a/MacDown/Code/Document/MPDocument.m b/MacDown/Code/Document/MPDocument.m index acbc77ff..d3b82d86 100644 --- a/MacDown/Code/Document/MPDocument.m +++ b/MacDown/Code/Document/MPDocument.m @@ -139,7 +139,7 @@ - (int)extensionFlags flags |= HOEDOWN_EXT_NO_INTRA_EMPHASIS; if (self.extensionQuote) flags |= HOEDOWN_EXT_QUOTE; - if (self.extensionStrikethough) + if (self.extensionStrikethrough) flags |= HOEDOWN_EXT_STRIKETHROUGH; if (self.extensionSuperscript) flags |= HOEDOWN_EXT_SUPERSCRIPT; @@ -450,7 +450,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)controller wordCountWidget.enabled = NO; // These needs to be queued until after the window is shown, so that editor - // can have the correct dimention for size-limiting and stuff. See + // can have the correct dimension for size-limiting and stuff. See // https://github.com/uranusjr/macdown/issues/236 [[NSOperationQueue mainQueue] addOperationWithBlock:^{ [self setupEditor:nil]; @@ -723,7 +723,7 @@ - (BOOL)textView:(NSTextView *)textView shouldChangeTextInRange:(NSRange)range if (self.preferences.editorCompleteMatchingCharacters) { - BOOL strikethrough = self.preferences.extensionStrikethough; + BOOL strikethrough = self.preferences.extensionStrikethrough; if ([textView completeMatchingCharactersForTextInRange:range withString:str strikethroughEnabled:strikethrough]) @@ -1026,7 +1026,7 @@ - (BOOL)rendererHasGraphviz:(MPRenderer *)renderer return self.preferences.htmlGraphviz; } -- (MPCodeBlockAccessoryType)rendererCodeBlockAccesory:(MPRenderer *)renderer +- (MPCodeBlockAccessoryType)rendererCodeBlockAccessory:(MPRenderer *)renderer { return self.preferences.htmlCodeBlockAccessory; } @@ -1064,7 +1064,7 @@ - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html } NSURL *baseUrl = self.fileURL; - if (!baseUrl) // Unsaved doument; just use the default URL. + if (!baseUrl) // Unsaved document; just use the default URL. baseUrl = self.preferences.htmlDefaultDirectoryUrl; self.manualRender = self.preferences.markdownManualRender; @@ -1082,7 +1082,7 @@ - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html if (self.isPreviewReady && [self.currentBaseUrl isEqualTo:baseUrl]) { // HACK: Ideally we should only inject the parts that changed, and only - // get the parts we need. For now we only get a complete HTML codument, + // get the parts we need. For now we only get a complete HTML document, // and rely on regex to get the parts we want in the DOM. // Use the existing tree if available, and replace the content. @@ -1657,7 +1657,7 @@ - (void)adjustEditorInsets if (editorWidth > 2 * x + maxWidth) x = (editorWidth - maxWidth) * 0.45; // We tend to expect things in an editor to shift to left a bit. - // Hence the 0.45 instead of 0.5 (which whould feel a bit too much). + // Hence the 0.45 instead of 0.5 (which would feel a bit too much). } self.editor.textContainerInset = NSMakeSize(x, y); } @@ -1682,7 +1682,7 @@ - (void)redrawDivider else { // If both sides are visible, draw a default "transparent" divider. - // This works around the possibile problem of divider's color being too + // This works around the possible problem of divider's color being too // similar to both the editor and preview and being obscured. self.splitView.dividerColor = nil; } diff --git a/MacDown/Code/Document/MPRenderer.h b/MacDown/Code/Document/MPRenderer.h index 2415864f..026f937b 100644 --- a/MacDown/Code/Document/MPRenderer.h +++ b/MacDown/Code/Document/MPRenderer.h @@ -56,7 +56,7 @@ typedef NS_ENUM(NSUInteger, MPCodeBlockAccessoryType) - (BOOL)rendererHasSyntaxHighlighting:(MPRenderer *)renderer; - (BOOL)rendererHasMermaid:(MPRenderer *)renderer; - (BOOL)rendererHasGraphviz:(MPRenderer *)renderer; -- (MPCodeBlockAccessoryType)rendererCodeBlockAccesory:(MPRenderer *)renderer; +- (MPCodeBlockAccessoryType)rendererCodeBlockAccessory:(MPRenderer *)renderer; - (BOOL)rendererHasMathJax:(MPRenderer *)renderer; - (NSString *)rendererHighlightingThemeName:(MPRenderer *)renderer; - (void)renderer:(MPRenderer *)renderer didProduceHTMLOutput:(NSString *)html; diff --git a/MacDown/Code/Document/MPRenderer.m b/MacDown/Code/Document/MPRenderer.m index f797444f..e5d088ff 100644 --- a/MacDown/Code/Document/MPRenderer.m +++ b/MacDown/Code/Document/MPRenderer.m @@ -222,7 +222,7 @@ @interface MPRenderer () @property BOOL syntaxHighlighting; @property BOOL mermaid; @property BOOL graphviz; -@property MPCodeBlockAccessoryType codeBlockAccesory; +@property MPCodeBlockAccessoryType codeBlockAccessory; @property BOOL lineNumbers; @property BOOL manualRender; @property (copy) NSString *highlightingThemeName; @@ -252,7 +252,7 @@ NS_INLINE void add_to_languages( } else if (require) { - NSLog(@"Unknown Prism langauge requirement " + NSLog(@"Unknown Prism language requirement " @"%@ dropped for unknown format", require); } } @@ -382,7 +382,7 @@ - (NSArray *)prismStylesheets NSURL *url = MPPrismPluginURL(@"line-numbers", @"css"); [stylesheets addObject:[MPStyleSheet CSSWithURL:url]]; } - if ([self.delegate rendererCodeBlockAccesory:self] + if ([self.delegate rendererCodeBlockAccessory:self] == MPCodeBlockAccessoryLanguageName) { NSURL *url = MPPrismPluginURL(@"show-language", @"css"); @@ -410,7 +410,7 @@ - (NSArray *)prismScripts NSURL *url = MPPrismPluginURL(@"line-numbers", @"js"); [scripts addObject:[MPScript javaScriptWithURL:url]]; } - if ([self.delegate rendererCodeBlockAccesory:self] + if ([self.delegate rendererCodeBlockAccessory:self] == MPCodeBlockAccessoryLanguageName) { NSURL *url = MPPrismPluginURL(@"show-language", @"js"); @@ -494,7 +494,7 @@ - (NSArray *)stylesheets } - if ([delegate rendererCodeBlockAccesory:self] == MPCodeBlockAccessoryCustom) + if ([delegate rendererCodeBlockAccessory:self] == MPCodeBlockAccessoryCustom) { NSURL *url = MPExtensionURL(@"show-information", @"css"); [stylesheets addObject:[MPStyleSheet CSSWithURL:url]]; @@ -541,7 +541,7 @@ - (void)parseAndRenderWithMaxDelay:(NSTimeInterval)maxDelay { markdown = [[self.dataSource rendererMarkdown:self] copy]; }); - // Parse in backgound + // Parse in background [self parseMarkdown:markdown]; // Wait untils is renderer has finished loading OR until the maxDelay has passed @@ -632,7 +632,7 @@ - (void)renderIfPreferencesChanged else if (!MPAreNilableStringsEqual( [d rendererStyleName:self], self.styleName)) changed = YES; - else if ([d rendererCodeBlockAccesory:self] != self.codeBlockAccesory) + else if ([d rendererCodeBlockAccessory:self] != self.codeBlockAccessory) changed = YES; if (changed) @@ -654,7 +654,7 @@ - (void)render self.mermaid = [delegate rendererHasMermaid:self]; self.graphviz = [delegate rendererHasGraphviz:self]; self.highlightingThemeName = [delegate rendererHighlightingThemeName:self]; - self.codeBlockAccesory = [delegate rendererCodeBlockAccesory:self]; + self.codeBlockAccessory = [delegate rendererCodeBlockAccessory:self]; } - (NSString *)HTMLForExportWithStyles:(BOOL)withStyles diff --git a/MacDown/Code/Extension/NSTextView+Autocomplete.m b/MacDown/Code/Extension/NSTextView+Autocomplete.m index b27df5ad..f6618b0b 100644 --- a/MacDown/Code/Extension/NSTextView+Autocomplete.m +++ b/MacDown/Code/Extension/NSTextView+Autocomplete.m @@ -147,7 +147,7 @@ - (BOOL)completeMatchingCharacterForText:(NSString *)string for (const unichar *cs = kMPMatchingCharactersMap[0]; *cs != 0; cs += 2) { - // Ignore IM input of ASCII charaters. + // Ignore IM input of ASCII characters. if (hasMarkedText && cs[0] < L'\u0100') continue; @@ -157,7 +157,7 @@ - (BOOL)completeMatchingCharacterForText:(NSString *)string { NSRange range = NSMakeRange(location, 0); NSString *completion = [NSString stringWithCharacters:cs length:2]; - // Mimic OS X's quote substitution if it's on. + // Mimic macOS's quote substitution if it's on. if (self.isAutomaticQuoteSubstitutionEnabled) { unichar c = L'\0'; diff --git a/MacDown/Code/Extension/WebView+WebViewPrivateHeaders.h b/MacDown/Code/Extension/WebView+WebViewPrivateHeaders.h index a6d511d0..5222767e 100644 --- a/MacDown/Code/Extension/WebView+WebViewPrivateHeaders.h +++ b/MacDown/Code/Extension/WebView+WebViewPrivateHeaders.h @@ -19,7 +19,7 @@ /*! @method pageSizeMultiplier - @result The page size multipler. + @result The page size multiplier. */ - (float)pageSizeMultiplier; diff --git a/MacDown/Code/Preferences/MPPreferences.h b/MacDown/Code/Preferences/MPPreferences.h index e14d2621..69366f4c 100644 --- a/MacDown/Code/Preferences/MPPreferences.h +++ b/MacDown/Code/Preferences/MPPreferences.h @@ -17,7 +17,7 @@ extern NSString * const MPDidDetectFreshInstallationNotification; @property (assign) NSString *firstVersionInstalled; @property (assign) NSString *latestVersionInstalled; @property (assign) BOOL updateIncludesPreReleases; -@property (assign) BOOL supressesUntitledDocumentOnLaunch; +@property (assign) BOOL suppressesUntitledDocumentOnLaunch; @property (assign) BOOL createFileForLinkTarget; // Extension flags. @@ -25,7 +25,7 @@ extern NSString * const MPDidDetectFreshInstallationNotification; @property (assign) BOOL extensionTables; @property (assign) BOOL extensionFencedCode; @property (assign) BOOL extensionAutolink; -@property (assign) BOOL extensionStrikethough; +@property (assign) BOOL extensionStrikethrough; @property (assign) BOOL extensionUnderline; @property (assign) BOOL extensionSuperscript; @property (assign) BOOL extensionHighlight; @@ -81,7 +81,7 @@ extern NSString * const MPDidDetectFreshInstallationNotification; - (instancetype)init; -// Convinience methods. +// Convenience methods. @property (nonatomic, assign) NSArray *filesToOpen; @property (nonatomic, assign) NSString *pipedContentFileToOpen; diff --git a/MacDown/Code/Preferences/MPPreferences.m b/MacDown/Code/Preferences/MPPreferences.m index 4f54f8e9..0ea228c8 100644 --- a/MacDown/Code/Preferences/MPPreferences.m +++ b/MacDown/Code/Preferences/MPPreferences.m @@ -73,14 +73,14 @@ - (instancetype)init @dynamic firstVersionInstalled; @dynamic latestVersionInstalled; @dynamic updateIncludesPreReleases; -@dynamic supressesUntitledDocumentOnLaunch; +@dynamic suppressesUntitledDocumentOnLaunch; @dynamic createFileForLinkTarget; @dynamic extensionIntraEmphasis; @dynamic extensionTables; @dynamic extensionFencedCode; @dynamic extensionAutolink; -@dynamic extensionStrikethough; +@dynamic extensionStrikethrough; @dynamic extensionUnderline; @dynamic extensionSuperscript; @dynamic extensionHighlight; @@ -235,7 +235,7 @@ - (void)cleanupObsoleteAutosaveValues * Note that since this is called only when the user launches the app the first * time, new preferences that breaks backward compatibility should NOT be put * here. An example would be adding a boolean config to turn OFF an existing - * functionality. If you add the defualt-loading code here, existing users + * functionality. If you add the default-loading code here, existing users * upgrading from an old version will not have this method invoked, thus * effecting app behavior. * diff --git a/MacDown/Code/Preferences/MPTerminalPreferencesViewController.m b/MacDown/Code/Preferences/MPTerminalPreferencesViewController.m index fc1b1a59..a4792b23 100644 --- a/MacDown/Code/Preferences/MPTerminalPreferencesViewController.m +++ b/MacDown/Code/Preferences/MPTerminalPreferencesViewController.m @@ -90,7 +90,7 @@ - (void)setShellUtilityURL:(NSURL *)url - (void)viewDidLoad { [super viewDidLoad]; - [self highlightMacdownInInfo]; + [self highlightMacDownInInfo]; self.installUninstallButton.target = self; self.shellUtilityURL = nil; @@ -172,9 +172,9 @@ - (void)uninstallShellUtility } /** - * Highlights all occurences of "macdown" in the info-text + * Highlights all occurrences of "macdown" in the info-text */ -- (void)highlightMacdownInInfo +- (void)highlightMacDownInInfo { NSString *infoString = self.infoTextField.stringValue; NSMutableAttributedString *attributedInfoString = @@ -197,7 +197,7 @@ - (void)highlightMacdownInInfo searchRange.location = foundRange.location + foundRange.length; } - else // Found all occurences + else // Found all occurrences { break; } diff --git a/MacDown/Code/Utility/MPUtilities.m b/MacDown/Code/Utility/MPUtilities.m index c6a546fa..72dcc8a3 100644 --- a/MacDown/Code/Utility/MPUtilities.m +++ b/MacDown/Code/Utility/MPUtilities.m @@ -135,7 +135,7 @@ BOOL MPStringIsNewline(NSString *str) NSURL *url = [bundle URLForResource:name withExtension:@"css" subdirectory:@"Prism/themes"]; - // Safty net: file not found, use default. + // Safety net: file not found, use default. if (!url) { url = [bundle URLForResource:@"prism" withExtension:@"css" diff --git a/MacDown/Code/View/MPEditorView.m b/MacDown/Code/View/MPEditorView.m index 6c7804ac..88033376 100644 --- a/MacDown/Code/View/MPEditorView.m +++ b/MacDown/Code/View/MPEditorView.m @@ -141,7 +141,7 @@ - (void)setFrameSize:(NSSize)newSize [super setFrameSize:newSize]; } -/** Overriden to perform extra operation on initial text setup. +/** Overridden to perform extra operation on initial text setup. * * When we first launch the editor, -didChangeText will *not* be called, so we * override this to perform required resizing. The -updateContentRect is wrapped @@ -165,7 +165,7 @@ - (void)setString:(NSString *)string #pragma mark - Overrides -/** Overriden to perform extra operation on text change. +/** Overridden to perform extra operation on text change. * * Updates content height, and invoke the resizing method to apply it. * diff --git a/MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib b/MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib index 454499c4..e8f4047e 100644 --- a/MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib +++ b/MacDown/Localization/Base.lproj/MPGeneralPreferencesViewController.xib @@ -127,7 +127,7 @@ - + NSNegateBoolean diff --git a/MacDown/Localization/Base.lproj/MPMarkdownPreferencesViewController.xib b/MacDown/Localization/Base.lproj/MPMarkdownPreferencesViewController.xib index 87256644..8b8c0dd5 100644 --- a/MacDown/Localization/Base.lproj/MPMarkdownPreferencesViewController.xib +++ b/MacDown/Localization/Base.lproj/MPMarkdownPreferencesViewController.xib @@ -71,7 +71,7 @@ - +