summaryrefslogtreecommitdiff
path: root/common_darwin.m
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
committerPietro Gagliardi <[email protected]>2014-08-30 23:02:02 -0400
commit77bf566ebbcb62acd4d08d905d9542d6ff9b6b80 (patch)
treeeeb8e72bc3bf57f5be7f0c0af4319189ac6de838 /common_darwin.m
parent155899c65ed32245e2ccad4197a10c77017d835b (diff)
...in with the new.
Diffstat (limited to 'common_darwin.m')
-rw-r--r--common_darwin.m16
1 files changed, 16 insertions, 0 deletions
diff --git a/common_darwin.m b/common_darwin.m
new file mode 100644
index 0000000..3043f21
--- /dev/null
+++ b/common_darwin.m
@@ -0,0 +1,16 @@
+// 11 august 2014
+
+#include "objc_darwin.h"
+#include <Cocoa/Cocoa.h>
+
+void disableAutocorrect(id onwhat)
+{
+ NSTextView *tv;
+
+ tv = (NSTextView *) onwhat;
+ [tv setEnabledTextCheckingTypes:0];
+ [tv setAutomaticDashSubstitutionEnabled:NO];
+ // don't worry about automatic data detection; it won't change stringValue (thanks pretty_function in irc.freenode.net/#macdev)
+ [tv setAutomaticSpellingCorrectionEnabled:NO];
+ [tv setAutomaticTextReplacementEnabled:NO];
+}