Skip to content

Commit 3c8b5af

Browse files
committed
Adjust vertical rhythm 😂
Signed-off-by: Yukai Huang <[email protected]>
1 parent 526b5d0 commit 3c8b5af

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

public/js/lib/editor/spellcheck.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@ const dictionaryDownloadUrls = {
1212
}
1313
}
1414

15-
const typoMap = new Map()
16-
17-
function createTypo (lang, affData, dicData) {
18-
const typo = new Typo(lang, affData, dicData, { platform: 'any' })
19-
typoMap.set(lang, typo)
20-
return typo
21-
}
22-
2315
function request (url) {
2416
return new Promise(resolve => {
2517
const req = new XMLHttpRequest()
@@ -47,9 +39,15 @@ function mapSeriesP (iterables, fn) {
4739
})
4840
}
4941

42+
function createTypo (lang, affData, dicData) {
43+
return new Typo(lang, affData, dicData, { platform: 'any' })
44+
}
45+
46+
const typoMap = new Map()
47+
5048
async function findOrCreateTypoInstance (lang) {
5149
// find existing typo instance
52-
const typo = typoMap.get(lang)
50+
let typo = typoMap.get(lang)
5351
if (typo) {
5452
return typo
5553
}
@@ -59,7 +57,10 @@ async function findOrCreateTypoInstance (lang) {
5957
dictionaryDownloadUrls[lang].dic
6058
], request)
6159

62-
return createTypo(lang, affData, dicData)
60+
typo = createTypo(lang, affData, dicData)
61+
typoMap.set(lang, typo)
62+
63+
return typo
6364
}
6465

6566
class CodeMirrorSpellChecker {

0 commit comments

Comments
 (0)