From 09092bf22df5095fa42c07b33a2c673cd3502a35 Mon Sep 17 00:00:00 2001 From: "Howard P. Logsdon" Date: Tue, 16 Sep 2014 20:34:40 -0600 Subject: Disable "Smart Quotes" in the query editor, among others. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It might be useful to keep this setting on globally, but smart quotes break SQL, resulting in the requirement of having to do an undo-type-undo dance to force the editor to not replace the single (') and double (") quote characters with the ‘, ’ and “, ” characters, respectively. Since we can presume that no one will want to use these non-SQL quotation marks within SQL unless they explicitly decide to do so (in matching a varchar field, for instance), they should be off by default. Additionally, the double-dash (--) is used in SQL for inline comments, which gets substituted for the em-dash (—). Disabling this seems to be a good idea on the same argument. More info about text substitution: http://support.apple.com/kb/PH14294 --- Source/SPTextView.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/SPTextView.m b/Source/SPTextView.m index 8edbb6d0..d0a5198f 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -202,6 +202,9 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS [self _setTextSelectionColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorSelectionColor]] onBackgroundColor:backgroundColor]; + [self setAutomaticDashSubstitutionEnabled:NO]; // prevents ' and " from becoming ‘, ’ and “, ” respectively. + [self setAutomaticQuoteSubstitutionEnabled:NO]; // prevents -- from becoming —, the em dash. + // Register observers for the when editor background colors preference changes [prefs addObserver:self forKeyPath:SPCustomQueryEditorSelectionColor options:NSKeyValueObservingOptionNew context:NULL]; [prefs addObserver:self forKeyPath:SPCustomQueryEditorCaretColor options:NSKeyValueObservingOptionNew context:NULL]; -- cgit v1.2.3 From 6802d5d02a687342edc4af4e90f8d75bdf65b64e Mon Sep 17 00:00:00 2001 From: "Howard P. Logsdon" Date: Wed, 17 Sep 2014 10:41:51 -0600 Subject: Fix spelling errors on method comment --- Source/SPQueryController.m | 2 +- Source/SPTextView.m | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/SPQueryController.m b/Source/SPQueryController.m index 01cb50e1..718a5ff3 100644 --- a/Source/SPQueryController.m +++ b/Source/SPQueryController.m @@ -338,7 +338,7 @@ static SPQueryController *sharedQueryController = nil; #pragma mark Other /** - * Called whenver the test within the search field changes. + * Called whenever the text within the search field changes. */ - (void)controlTextDidChange:(NSNotification *)notification { diff --git a/Source/SPTextView.m b/Source/SPTextView.m index d0a5198f..abe89c5b 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -202,8 +202,8 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS [self _setTextSelectionColor:[NSUnarchiver unarchiveObjectWithData:[prefs dataForKey:SPCustomQueryEditorSelectionColor]] onBackgroundColor:backgroundColor]; - [self setAutomaticDashSubstitutionEnabled:NO]; // prevents ' and " from becoming ‘, ’ and “, ” respectively. - [self setAutomaticQuoteSubstitutionEnabled:NO]; // prevents -- from becoming —, the em dash. + [self setAutomaticDashSubstitutionEnabled:NO]; // prevents -- from becoming —, the em dash. + [self setAutomaticQuoteSubstitutionEnabled:NO]; // prevents ' and " from becoming ‘, ’ and “, ” respectively. // Register observers for the when editor background colors preference changes [prefs addObserver:self forKeyPath:SPCustomQueryEditorSelectionColor options:NSKeyValueObservingOptionNew context:NULL]; -- cgit v1.2.3 From f4b384bc3e6ac805567af71e515b8dc3ae79c9b6 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 18 Sep 2014 23:05:40 +0200 Subject: Disable Smart quotes in Bundle Editor --- Source/SPBundleCommandTextView.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m index b5436ca5..4ca63451 100644 --- a/Source/SPBundleCommandTextView.m +++ b/Source/SPBundleCommandTextView.m @@ -62,6 +62,10 @@ [commandScrollView setHasHorizontalRuler:NO]; [commandScrollView setHasVerticalRuler:YES]; [commandScrollView setRulersVisible:YES]; + + // disable typo stuff in 10.8+ SDK + [self setAutomaticDashSubstitutionEnabled:NO]; + [self setAutomaticQuoteSubstitutionEnabled:NO]; // Re-define tab stops for a better editing [self setTabStops]; -- cgit v1.2.3