e: fix erc
This commit is contained in:
15
erc
15
erc
@@ -30,7 +30,12 @@ end
|
||||
|
||||
keys["!"] = function()
|
||||
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)
|
||||
result = handle:read("*a")
|
||||
handle:close()
|
||||
@@ -41,6 +46,12 @@ end
|
||||
|
||||
meta_commands["carp"] = function()
|
||||
file = get_filename()
|
||||
|
||||
if file == nil then
|
||||
message("File has no name!")
|
||||
return
|
||||
end
|
||||
|
||||
handle = io.popen("carp --check "..file)
|
||||
result = handle:read("*a")
|
||||
handle:close()
|
||||
@@ -56,7 +67,7 @@ meta_commands["carp"] = function()
|
||||
|
||||
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))
|
||||
message(msg)
|
||||
end
|
||||
|
Reference in New Issue
Block a user