mirror of
https://github.com/textmate/textmate.git
synced 2026-01-13 08:47:59 -05:00
Support spell checking being “automatic by language”
This must be set in the spelling panel and changing language via the spelling panel does not update the buffer (recheck the text with the new spelling language), so toggle automatic spelling after using the spelling panel to change language. Closes #1139
This commit is contained in:
@@ -23,7 +23,8 @@ void setup_fixtures ()
|
||||
bundleIndex.commit();
|
||||
|
||||
NSApplicationLoad();
|
||||
[NSSpellChecker sharedSpellChecker];
|
||||
NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker];
|
||||
spellChecker.automaticallyIdentifiesLanguages = NO;
|
||||
}
|
||||
|
||||
void benchmark_insert_50_mb ()
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace ns
|
||||
_OutputIter spellcheck (char const* first, char const* last, std::string const& language, long int tag, size_t offset, _OutputIter out)
|
||||
{
|
||||
NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker];
|
||||
NSString* lang = [NSString stringWithCxxString:language];
|
||||
NSString* lang = spellChecker.automaticallyIdentifiesLanguages ? nil : [NSString stringWithCxxString:language];
|
||||
NSString* str = [NSString stringWithUTF8String:first length:last - first];
|
||||
NSRange range = [spellChecker checkSpellingOfString:str startingAt:0 language:lang wrap:NO inSpellDocumentWithTag:tag wordCount:NULL];
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
void setup ()
|
||||
{
|
||||
NSApplicationLoad();
|
||||
[NSSpellChecker sharedSpellChecker];
|
||||
NSSpellChecker* spellChecker = [NSSpellChecker sharedSpellChecker];
|
||||
spellChecker.automaticallyIdentifiesLanguages = NO;
|
||||
}
|
||||
|
||||
void test_spellcheck ()
|
||||
|
||||
Reference in New Issue
Block a user