-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugins.Editor.lua
More file actions
105 lines (77 loc) · 2.47 KB
/
Plugins.Editor.lua
File metadata and controls
105 lines (77 loc) · 2.47 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
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
--[[ Editor macros with plugins ]]--
----------------------------------------
--[[ description:
-- Macros for text editing with plugins.
-- Макросы для правки текста с плагинами.
--]]
----------------------------------------
--[[ uses:
nil.
-- group: Macros/Plugins.
--]]
--------------------------------------------------------------------------------
----------------------------------------
local far = far
local F = far.Flags
local BlockNoneType = F.BTYPE_NONE
local editor = editor
----------------------------------------
--[[
local debugs = require "context.utils.useDebugs"
local logShow = debugs.Show
--]]
--------------------------------------------------------------------------------
--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 CallPlugin = Plugin.Call
--local PluginMenu, CallPlugin = Plugin.Menu, Plugin.Call
---------------------------------------- 'R' -- EditCase
-- [[
guids.EditCase = "0E92FC81-4888-4297-A85D-31C79E0E0CEE"
local Exist = function () return PluginExist(guids.EditCase) end
Macro {
area = "Editor",
key = "F5",
flags = "",
description = "Case: Next case",
condition = Exist,
action = function ()
return CallPlugin(guids.EditCase, 4)
end, ---
} ---
Macro {
area = "Editor",
key = "LCtrlShiftF5",
flags = "",
description = "Case: Sentence case for Bulleted line",
condition = Exist,
action = function ()
local Info = editor.GetInfo()
Keys"ShiftHome CtrlShiftRight CtrlShiftLeft ShiftRight"
CallPlugin(guids.EditCase, 0)
editor.Select(Info.EditorID, BlockNoneType)
return editor.SetPosition(Info.EditorID, 0, Info.CurPos)
end, ---
} ---
Macro {
area = "Editor",
key = "LCtrlLAltShiftF5",
flags = "",
description = "Case: Sentence case for Numbered line",
condition = Exist,
action = function ()
local Info = editor.GetInfo()
Keys"ShiftHome CtrlShiftRight CtrlShiftRight CtrlShiftLeft ShiftRight"
CallPlugin(guids.EditCase, 0)
editor.Select(Info.EditorID, BlockNoneType)
return editor.SetPosition(Info.EditorID, 0, Info.CurPos)
end, ---
} ---
--]]
--------------------------------------------------------------------------------