Match git commit properly
This commit is contained in:
@@ -313,8 +313,13 @@ function MatchAgainstIncludes(s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MatchGitCommit(s)
|
function MatchGitCommit(s)
|
||||||
|
local i, j = string.find(s, "^commit ([a-zA-Z0-9]+)")
|
||||||
|
if i then
|
||||||
|
s = s:sub(8)
|
||||||
local command = "git --no-pager show "..s
|
local command = "git --no-pager show "..s
|
||||||
return {kind = "exec", cmd = command, working_dir = GetCurrentBufferDir()}
|
return {kind = "exec", cmd = command, working_dir = GetCurrentBufferDir()}
|
||||||
|
end
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
Rules = {
|
Rules = {
|
||||||
@@ -323,7 +328,6 @@ Rules = {
|
|||||||
MatchGitCommit,
|
MatchGitCommit,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function ApplyRules(s)
|
function ApplyRules(s)
|
||||||
for i = #Rules,1,-1 do
|
for i = #Rules,1,-1 do
|
||||||
rule = Rules[i]
|
rule = Rules[i]
|
||||||
|
|||||||
@@ -205,8 +205,13 @@ function MatchAgainstIncludes(s)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function MatchGitCommit(s)
|
function MatchGitCommit(s)
|
||||||
|
local i, j = string.find(s, "^commit ")
|
||||||
|
print(tostring(i))
|
||||||
|
if i then
|
||||||
local command = "git --no-pager show "..s
|
local command = "git --no-pager show "..s
|
||||||
return {kind = "exec", cmd = command, working_dir = GetCurrentBufferDir()}
|
return {kind = "exec", cmd = command, working_dir = GetCurrentBufferDir()}
|
||||||
|
end
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
Rules = {
|
Rules = {
|
||||||
|
|||||||
Reference in New Issue
Block a user