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

Spelling #1226

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion MacDown/Code/Application/MPMainController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions MacDown/Code/Document/MPDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -1026,7 +1026,7 @@ - (BOOL)rendererHasGraphviz:(MPRenderer *)renderer
return self.preferences.htmlGraphviz;
}

- (MPCodeBlockAccessoryType)rendererCodeBlockAccesory:(MPRenderer *)renderer
- (MPCodeBlockAccessoryType)rendererCodeBlockAccessory:(MPRenderer *)renderer
{
return self.preferences.htmlCodeBlockAccessory;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand Down Expand Up @@ -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);
}
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion MacDown/Code/Document/MPRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions MacDown/Code/Document/MPRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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]];
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions MacDown/Code/Extension/NSTextView+Autocomplete.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion MacDown/Code/Extension/WebView+WebViewPrivateHeaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/*!
@method pageSizeMultiplier
@result The page size multipler.
@result The page size multiplier.
*/
- (float)pageSizeMultiplier;

Expand Down
6 changes: 3 additions & 3 deletions MacDown/Code/Preferences/MPPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ 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.
@property (assign) BOOL extensionIntraEmphasis;
@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;
Expand Down Expand Up @@ -81,7 +81,7 @@ extern NSString * const MPDidDetectFreshInstallationNotification;

- (instancetype)init;

// Convinience methods.
// Convenience methods.
@property (nonatomic, assign) NSArray *filesToOpen;
@property (nonatomic, assign) NSString *pipedContentFileToOpen;

Expand Down
6 changes: 3 additions & 3 deletions MacDown/Code/Preferences/MPPreferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ - (instancetype)init
@dynamic firstVersionInstalled;
@dynamic latestVersionInstalled;
@dynamic updateIncludesPreReleases;
@dynamic supressesUntitledDocumentOnLaunch;
@dynamic suppressesUntitledDocumentOnLaunch;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that this is a user breaking change

@dynamic createFileForLinkTarget;

@dynamic extensionIntraEmphasis;
@dynamic extensionTables;
@dynamic extensionFencedCode;
@dynamic extensionAutolink;
@dynamic extensionStrikethough;
@dynamic extensionStrikethrough;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that this is a user breaking change

@dynamic extensionUnderline;
@dynamic extensionSuperscript;
@dynamic extensionHighlight;
Expand Down Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (void)setShellUtilityURL:(NSURL *)url
- (void)viewDidLoad
{
[super viewDidLoad];
[self highlightMacdownInInfo];
[self highlightMacDownInInfo];

self.installUninstallButton.target = self;
self.shellUtilityURL = nil;
Expand Down Expand Up @@ -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 =
Expand All @@ -197,7 +197,7 @@ - (void)highlightMacdownInInfo

searchRange.location = foundRange.location + foundRange.length;
}
else // Found all occurences
else // Found all occurrences
{
break;
}
Expand Down
2 changes: 1 addition & 1 deletion MacDown/Code/Utility/MPUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions MacDown/Code/View/MPEditorView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
</buttonCell>
<connections>
<action selector="updateWordCounterVisibility:" target="-2" id="COx-AW-eef"/>
<binding destination="-2" name="value" keyPath="self.preferences.supressesUntitledDocumentOnLaunch" id="r2p-vy-69v">
<binding destination="-2" name="value" keyPath="self.preferences.suppressesUntitledDocumentOnLaunch" id="r2p-vy-69v">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.preferences.extensionStrikethough" id="tWe-ZX-b8J"/>
<binding destination="-2" name="value" keyPath="self.preferences.extensionStrikethrough" id="tWe-ZX-b8J"/>
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="CCI-wC-lHw">
Expand Down
2 changes: 1 addition & 1 deletion MacDown/Localization/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
<menuItem title="Strikethrough" keyEquivalent="-" id="9CN-Qi-Fln">
<connections>
<action selector="toggleStrikethrough:" target="-1" id="rUc-gb-x5q"/>
<binding destination="eq0-c4-vgQ" name="hidden" keyPath="self.preferences.extensionStrikethough" id="kQ0-Wi-BPs">
<binding destination="eq0-c4-vgQ" name="hidden" keyPath="self.preferences.extensionStrikethrough" id="kQ0-Wi-BPs">
<dictionary key="options">
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
Expand Down
2 changes: 1 addition & 1 deletion MacDown/MacDown-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<array>
<dict>
<key>CFBundleURLName</key>
<string>Macdown custom control</string>
<string>MacDown custom control</string>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be significant?

<key>CFBundleURLSchemes</key>
<array>
<string>x-macdown</string>
Expand Down
Loading