summaryrefslogtreecommitdiff
path: root/prev/common_darwin.m
blob: f56ceae2f47b94924871b109e1ec0faf68fd41c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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];
	[tv setAutomaticQuoteSubstitutionEnabled:NO];
	[tv setAutomaticLinkDetectionEnabled:NO];
	[tv setSmartInsertDeleteEnabled:NO];
}