e: fix erc
This commit is contained in:
15
erc
15
erc
@@ -30,7 +30,12 @@ end
|
|||||||
|
|
||||||
keys["!"] = function()
|
keys["!"] = function()
|
||||||
command = prompt("shell command: %s")
|
command = prompt("shell command: %s")
|
||||||
command = string.gsub(command, "%$", get_filename())
|
|
||||||
|
if command == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
command = string.gsub(command, "%$", get_filename() or "")
|
||||||
handle = io.popen(command)
|
handle = io.popen(command)
|
||||||
result = handle:read("*a")
|
result = handle:read("*a")
|
||||||
handle:close()
|
handle:close()
|
||||||
@@ -41,6 +46,12 @@ end
|
|||||||
|
|
||||||
meta_commands["carp"] = function()
|
meta_commands["carp"] = function()
|
||||||
file = get_filename()
|
file = get_filename()
|
||||||
|
|
||||||
|
if file == nil then
|
||||||
|
message("File has no name!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
handle = io.popen("carp --check "..file)
|
handle = io.popen("carp --check "..file)
|
||||||
result = handle:read("*a")
|
result = handle:read("*a")
|
||||||
handle:close()
|
handle:close()
|
||||||
@@ -56,7 +67,7 @@ meta_commands["carp"] = function()
|
|||||||
|
|
||||||
f, l, c, msg = string.match(result, "([^:]+):(%d+):(%d+) (.-)[\r\n].*")
|
f, l, c, msg = string.match(result, "([^:]+):(%d+):(%d+) (.-)[\r\n].*")
|
||||||
|
|
||||||
if f == file then
|
if string.match(f, file) then
|
||||||
move(tonumber(l)-1, tonumber(c))
|
move(tonumber(l)-1, tonumber(c))
|
||||||
message(msg)
|
message(msg)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user