Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 60870c7

Browse files
author
Max Brunsfeld
committed
Merge pull request #28 from atom/mb-allow-hunspell-on-mac
Allow hunspell implementation to be used on OSX
2 parents 6bb8b4c + cd2f7e3 commit 60870c7

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

binding.gyp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
'variables': {
3-
'spellchecker_use_hunspell': 'true',
43
'conditions': [
54
['OS=="mac"', {
6-
'spellchecker_use_hunspell': 'false',
5+
'spellchecker_use_hunspell%': 'false',
6+
}],
7+
['OS=="linux"', {
8+
'spellchecker_use_hunspell': 'true',
9+
}],
10+
['OS=="win"', {
11+
'spellchecker_use_hunspell': 'true',
712
}],
813
],
914
},

src/spellchecker_mac.mm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "spellchecker_mac.h"
2+
#include "spellchecker_hunspell.h"
23

34
#import <Cocoa/Cocoa.h>
45
#import <dispatch/dispatch.h>
@@ -85,6 +86,12 @@
8586
}
8687

8788
SpellcheckerImplementation* SpellcheckerFactory::CreateSpellchecker() {
89+
#ifdef USE_HUNSPELL
90+
if (getenv("SPELLCHECKER_PREFER_HUNSPELL")) {
91+
return new HunspellSpellchecker();
92+
}
93+
#endif
94+
8895
return new MacSpellchecker();
8996
}
9097

0 commit comments

Comments
 (0)