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(+) (limited to 'Source/SPTextView.m') 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/SPTextView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/SPTextView.m') 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