aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextView.m
diff options
context:
space:
mode:
authorHoward P. Logsdon <howard@hplogsdon.com>2014-09-16 20:34:40 -0600
committerHoward P. Logsdon <howard@hplogsdon.com>2014-09-17 10:41:26 -0600
commit09092bf22df5095fa42c07b33a2c673cd3502a35 (patch)
tree08d65bb75c014ffabe8c1caab655dc9e5c152850 /Source/SPTextView.m
parent22d2e2a62f994c1e11cf87c48cb0d526b9078b92 (diff)
downloadsequelpro-09092bf22df5095fa42c07b33a2c673cd3502a35.tar.gz
sequelpro-09092bf22df5095fa42c07b33a2c673cd3502a35.tar.bz2
sequelpro-09092bf22df5095fa42c07b33a2c673cd3502a35.zip
Disable "Smart Quotes" in the query editor, among others.
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
Diffstat (limited to 'Source/SPTextView.m')
-rw-r--r--Source/SPTextView.m3
1 files changed, 3 insertions, 0 deletions
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];