-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresident.lua
More file actions
67 lines (51 loc) · 1.61 KB
/
resident.lua
File metadata and controls
67 lines (51 loc) · 1.61 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
--[[ LuaFAR context ]]--
----------------------------------------
--[[ description:
-- Using in plugins.
-- Использование в плагинах.
--]]
----------------------------------------
--[[ uses:
LuaFAR.
-- group: LF context.
--]]
--------------------------------------------------------------------------------
--[[
Insert following code to start of LuaFAR plugin _usermenu.lua file:
--
require "context.initiate" -- LFc initiate
MakeResident("context.resident") -- LFc resident
--
--]]
----------------------------------------
--local logShow = context.Show
--------------------------------------------------------------------------------
-- Type autodetect functions
local handle = context.handle
ctxdata.isResident = true
----------------------------------------
function ProcessEditorEvent (id, event, param)
--logShow({ id, event, param })
--logShow(editor.GetInfo())
handle.editorEvent(id, event, param)
return 0
end --
function ProcessViewerEvent (id, event, param)
handle.viewerEvent(id, event, param)
return 0
end --
function ExitScript ()
if rawget(_G, 'ctxdata') then
ctxdata.events = nil -- ?!
ctxdata = nil
end
end --
----------------------------------------
local resident = {
ProcessEditorEvent = ProcessEditorEvent,
ProcessViewerEvent = ProcessViewerEvent,
ExitScript = ExitScript,
} --- resident
--------------------------------------------------------------------------------
return resident
--------------------------------------------------------------------------------