Neovim sign gutter, designed to be mostly VCS agnostic
1local M = {}
2
3local state = require "vcsigns.state"
4
5function M.lualine_module()
6 return {
7 "diff",
8 source = function()
9 return vim.b.vcsigns_stats
10 end,
11 on_click = function()
12 local bufnr = vim.api.nvim_get_current_buf()
13 local lines = {}
14 local vcs = state.get(bufnr).vcs.vcs
15 lines[#lines + 1] = vcs and vcs.name or "No vcs detected"
16 if vim.b.vcsigns_resolved_rename then
17 lines[#lines + 1] = "File rename detected:"
18 lines[#lines + 1] = string.format(
19 " %s -> %s",
20 vim.b.vcsigns_resolved_rename.from,
21 vim.b.vcsigns_resolved_rename.to
22 )
23 end
24 vim.notify(table.concat(lines, "\n"), vim.log.levels.INFO, {
25 title = "VCSigns",
26 timeout = 3000,
27 })
28 end,
29 }
30end
31
32return M