-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugins.History.lua
159 lines (115 loc) · 3.34 KB
/
Plugins.History.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
--[[ History macros with plugins ]]--
----------------------------------------
--[[ description:
-- Macros handling history with plugins.
-- Макросы работы с историей с плагинами.
--]]
----------------------------------------
--[[ uses:
nil.
-- group: Macros/Plugins.
--]]
--------------------------------------------------------------------------------
----------------------------------------
--local far = far
--local F = far.Flags
--------------------------------------------------------------------------------
--local unit = {}
----------------------------------------
local guids = {}
--unit.guids = guids
local Macro = Macro or function () end
--local Async = function () return mmode(3, 1) end
local Plugin = Plugin or {}
local PluginExist = Plugin.Exist
local PluginMenu = Plugin.Menu
--local PluginMenu, CallPlugin = Plugin.Menu, Plugin.Call
---------------------------------------- 'H' -- LuaFAR History
-- [[
guids.LFHistory = "A745761D-42B5-4E67-83DA-F07AF367AE86"
local LFHistoryMenu = {
Commands = "D853E243-6B82-4B84-96CD-E733D77EEAA1",
EditView = "D853E243-6B82-4B84-96CD-E733D77EEAA1",
Folders = "D853E243-6B82-4B84-96CD-E733D77EEAA1",
} ---
guids.LFHistoryMenu = LFHistoryMenu
do
for _, v in pairs(LFHistoryMenu) do
LFHistoryMenu[v] = true
end
end -- do
local Exist = function () return PluginExist(guids.LFHistory) end
Macro {
area = "Common",
key = "LAltF10",
flags = "",
description = "History: Commands",
condition = Exist,
action = function ()
--return CallPlugin(guids.LFHistory, 1)
if PluginMenu(guids.LFHistory) then return Keys"1" end
end, ---
} ---
Macro {
area = "Common",
key = "LAltF11",
flags = "",
description = "History: Edit/View",
condition = Exist,
action = function ()
--return CallPlugin(guids.LFHistory, 2)
if PluginMenu(guids.LFHistory) then return Keys"2" end
end, ---
} ---
Macro {
area = "Common",
key = "LAltF12",
flags = "",
description = "History: Folders",
condition = Exist,
action = function ()
--return CallPlugin(guids.LFHistory, 3)
if PluginMenu(guids.LFHistory) then return Keys"3" end
end, ---
} ---
---------------------------------------- History Menus
local LFH_Menu = function () return LFHistoryMenu[Menu.Id] end
-- Restore keys.
Macro {
area = "Menu",
key = "Ins NumIns",
flags = "",
description = "Menu: Insert item",
priority = 100,
condition = LFH_Menu,
action = function () return Keys"Ins" end, ---
} ---
Macro {
area = "Menu",
key = "Del NumDel",
flags = "",
description = "Menu: Delete item",
priority = 100,
condition = LFH_Menu,
action = function () return Keys"Del" end, ---
} ---
Macro {
area = "Menu",
key = "CtrlIns CtrlNumIns",
flags = "",
description = "Menu: CtrlInsert item",
priority = 100,
condition = LFH_Menu,
action = function () return Keys"CtrlIns" end, ---
} ---
Macro {
area = "Menu",
key = "CtrlDel CtrlNumDel",
flags = "",
description = "Menu: CtrlDelete item",
priority = 100,
condition = LFH_Menu,
action = function () return Keys"CtrlDel" end, ---
} ---
--]]
--------------------------------------------------------------------------------