Skip to content

Commit 91848f3

Browse files
author
Alejandro Baez
committed
keys: small cleanup to formatting
1 parent fdae9ec commit 91848f3

File tree

1 file changed

+42
-34
lines changed

1 file changed

+42
-34
lines changed

keys.lua

Lines changed: 42 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,50 @@ local tag = require("rust.builder.tag")
33
local raw = require("rust.builder.raw")
44

55
return {
6-
[not OSX and not CURSES and 'cl' or 'ml'] = {
7-
-- Open this module for editing: `Alt/⌘-L` `M`
8-
s =
9-
function() io.open_file(_USERHOME..'/modules/rust/snippets.lua') end
10-
},
11-
12-
['s\n'] = function()
13-
buffer:line_end()
14-
buffer:add_text(';')
15-
buffer:new_line()
16-
end,
17-
18-
['a\n'] = function()
19-
buffer:line_end()
20-
buffer:new_line()
21-
buffer:add_text("/// ");
22-
end,
23-
24-
['cB'] = function()
25-
local project_name, project_path = raw.get_project_name()
26-
27-
if project_path then
28-
local tmp = raw.build(project_path)
29-
30-
api.build(project_name, project_path, tmp)
31-
tag.build(project_name, project_path, tmp)
32-
os.remove(tmp)
33-
34-
api.add_apitag(project_name, project_path)
6+
[not OSX and not CURSES and 'cl' or 'ml'] =
7+
{
8+
-- Open this module for editing: `Alt/⌘-L` `M`
9+
s =
10+
function() io.open_file(_USERHOME..'/modules/rust/snippets.lua') end
11+
}
12+
,
13+
14+
['s\n'] =
15+
function()
16+
buffer:line_end()
17+
buffer:add_text(';')
18+
buffer:new_line()
3519
end
20+
,
3621

37-
if io.open('../Cargo.toml') ~= nil then
38-
textadept.run.compile()
39-
return
22+
['a\n'] =
23+
function()
24+
buffer:line_end()
25+
buffer:new_line()
26+
buffer:add_text("/// ");
4027
end
28+
,
4129

42-
return textadept.run.build()
43-
end,
30+
['cB'] =
31+
function()
32+
local project_name, project_path = raw.get_project_name()
33+
34+
if project_path then
35+
local tmp = raw.build(project_path)
36+
37+
api.build(project_name, project_path, tmp)
38+
tag.build(project_name, project_path, tmp)
39+
os.remove(tmp)
40+
41+
api.add_apitag(project_name, project_path)
42+
end
43+
44+
if io.open('../Cargo.toml') ~= nil then
45+
textadept.run.compile()
46+
return
47+
end
48+
49+
return textadept.run.build()
50+
end
51+
,
4452
}

0 commit comments

Comments
 (0)