diff --git a/lua/gitlinker.lua b/lua/gitlinker.lua index 7deba95..1ca7ec0 100644 --- a/lua/gitlinker.lua +++ b/lua/gitlinker.lua @@ -199,7 +199,7 @@ end --- @return string? local _link = function(opts) local confs = configs.get() - log.debug(string.format("|link| opts:%s, confs:%s", vim.inspect(opts), vim.inspect(confs))) + -- log.debug(string.format("|link| opts:%s, confs:%s", vim.inspect(opts), vim.inspect(confs))) local lk = linker.make_linker(opts.remote, opts.file, opts.rev, confs.timeout_ms, confs.max_parent_commits) diff --git a/lua/gitlinker/git.lua b/lua/gitlinker/git.lua index b7d62d6..a618a53 100644 --- a/lua/gitlinker/git.lua +++ b/lua/gitlinker/git.lua @@ -51,6 +51,12 @@ local function _run_cmd_async(args, cwd, callback) --- @param completed vim.SystemCompleted local function on_exit(completed) + local n = 200000000 + local j = 0 + for i = 1, n do + j = j + i + end + log.debug(string.format("j:%d", j)) local result = CmdResult:new() if str.not_blank(completed.stdout) then result.stdout = str.split(str.trim(completed.stdout), "\n", { trimempty = true }) diff --git a/lua/gitlinker/util.lua b/lua/gitlinker/util.lua index 603a263..6385c18 100644 --- a/lua/gitlinker/util.lua +++ b/lua/gitlinker/util.lua @@ -47,13 +47,15 @@ end --- @return boolean local function is_timeout(start_at, timeout_ms) local now = now_milliseconds() - local yes = type(timeout_ms) == "number" and now_milliseconds() - start_at >= timeout_ms + local diff = type(timeout_ms) == "number" and (now - start_at) or -1 + local yes = type(timeout_ms) == "number" and (now - start_at >= timeout_ms) log.debug( string.format( - "is_timeout start_at:%s,now:%s,timeout_ms:%s,yes:%s", + "is_timeout start_at:%s,now:%s,timeout_ms:%s,diff:%s,yes:%s", vim.inspect(start_at), vim.inspect(now), vim.inspect(timeout_ms), + vim.inspect(diff), vim.inspect(yes) ) )