-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkeys.lua
52 lines (43 loc) · 1.05 KB
/
keys.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
local api = require("rust.builder.api")
local tag = require("rust.builder.tag")
local raw = require("rust.builder.raw")
return {
[not OSX and not CURSES and 'cl' or 'ml'] =
{
-- Open this module for editing: `Alt/⌘-L` `M`
s =
function() io.open_file(_USERHOME..'/modules/rust/snippets.lua') end
}
,
['s\n'] =
function()
buffer:line_end()
buffer:add_text(';')
buffer:new_line()
end
,
['a\n'] =
function()
buffer:line_end()
buffer:new_line()
buffer:add_text("/// ");
end
,
['cB'] =
function()
local project_name, project_path = raw.get_project_name()
if project_path then
local tmp = raw.build(project_path)
api.build(project_name, project_path, tmp)
tag.build(project_name, project_path, tmp)
os.remove(tmp)
api.add_apitag(project_name, project_path)
end
if io.open('../Cargo.toml') ~= nil then
textadept.run.compile()
return
end
return textadept.run.build()
end
,
}