-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.lua
46 lines (41 loc) · 1.16 KB
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require("textadept-spellchecker.localization")
local backend = require("textadept-spellchecker.backend")
local suggestions = require("textadept-spellchecker.suggestions")
local check = require("textadept-spellchecker.check")
local gui = require("textadept-spellchecker.gui")
local live = require("textadept-spellchecker.livechecking")
local config = require("textadept-spellchecker.config")
-------------------------------
-- Module load/unload routines
-------------------------------
local function shutdown()
events.disconnect(events.RESET_BEFORE, shutdown)
end
local function init()
events.disconnect(events.INITIALIZED, init)
if not (backend and check)
then
return
end
events.connect(events.QUIT, shutdown)
-- TODO: Investigate why shutdown causes calling nil value
-- events.connect(events.RESET_BEFORE, shutdown)
if config then
config.init()
end
if suggestions then
suggestions.init()
end
if gui then
gui.init()
end
if live and not CURSES then
live.init()
end
-- Shutdown checkers when checking is off
if config.checking ~= 2 then
check.shutdown()
live.shutdown()
end
end
events.connect(events.INITIALIZED, init)