Skip to content

Commit

Permalink
Merge pull request #29 from centsent/main
Browse files Browse the repository at this point in the history
fix: do not perform arithmetic when `space_pos` is nil

---

LGTM, thanks!
  • Loading branch information
VidocqH authored Oct 31, 2023
2 parents 2776353 + 34a2e46 commit 0c74c84
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lua/lsp-lens/lens-util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,13 +212,15 @@ local function get_recent_editor(start_row, end_row, callback)

for line in string.gmatch(data, "[^\r\n]+") do
local space_pos = string.find(line, " ")
local key = string.sub(line, 1, space_pos - 1)
local val = string.sub(line, space_pos + 1)
if key == "author" then
-- if key == "author" or key == "committer" then
authors[val] = true
if most_recent_editor == nil then
most_recent_editor = val
if space_pos ~= nil then
local key = string.sub(line, 1, space_pos - 1)
local val = string.sub(line, space_pos + 1)
if key == "author" then
-- if key == "author" or key == "committer" then
authors[val] = true
if most_recent_editor == nil then
most_recent_editor = val
end
end
end
end
Expand Down

0 comments on commit 0c74c84

Please # to comment.