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') 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