feat(gitbrowse): added line_count. See #186

This commit is contained in:
Folke Lemaitre 2024-12-02 08:22:25 +01:00
parent 0ea57a20cd
commit f03727c77f
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -146,6 +146,7 @@ function M._open(opts)
fields.line_start = fields.line_start or vim.fn.line(".") fields.line_start = fields.line_start or vim.fn.line(".")
fields.line_end = fields.line_end or fields.line_start fields.line_end = fields.line_end or fields.line_start
end end
fields.line_count = fields.line_end - fields.line_start + 1
opts.what = is_commit and "commit" or opts.what == "commit" and not fields.commit and "file" or opts.what opts.what = is_commit and "commit" or opts.what == "commit" and not fields.commit and "file" or opts.what
opts.what = not is_commit and opts.what == "file" and not fields.file and "branch" or opts.what opts.what = not is_commit and opts.what == "file" and not fields.file and "branch" or opts.what