diff options
author | christianchiarulli <[email protected]> | 2021-08-29 14:17:32 -0400 |
---|---|---|
committer | christianchiarulli <[email protected]> | 2021-08-29 14:17:32 -0400 |
commit | ed5559d259e38a78796a7d81421f02ba6dafac4b (patch) | |
tree | afa9c00c017382bac547265a8a1e16b9770a07eb /lua/core/gitsigns.lua | |
parent | e7b6d3b6f5982ea1042ffd499a7b85c18f0b782e (diff) | |
parent | c7a5122fe2c14dba0f28f1c077f838f957884afc (diff) |
Merge branch 'rolling' of github.com:ChristianChiarulli/LunarVim
Diffstat (limited to 'lua/core/gitsigns.lua')
-rw-r--r-- | lua/core/gitsigns.lua | 96 |
1 files changed, 50 insertions, 46 deletions
diff --git a/lua/core/gitsigns.lua b/lua/core/gitsigns.lua index 9e023762..bb9d088b 100644 --- a/lua/core/gitsigns.lua +++ b/lua/core/gitsigns.lua @@ -1,60 +1,64 @@ local M = {} -local Log = require "core.log" + M.config = function() lvim.builtin.gitsigns = { - signs = { - add = { - hl = "GitSignsAdd", - text = "▎", - numhl = "GitSignsAddNr", - linehl = "GitSignsAddLn", - }, - change = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - delete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", + active = true, + on_config_done = nil, + opts = { + signs = { + add = { + hl = "GitSignsAdd", + text = "▎", + numhl = "GitSignsAddNr", + linehl = "GitSignsAddLn", + }, + change = { + hl = "GitSignsChange", + text = "▎", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, + delete = { + hl = "GitSignsDelete", + text = "契", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + topdelete = { + hl = "GitSignsDelete", + text = "契", + numhl = "GitSignsDeleteNr", + linehl = "GitSignsDeleteLn", + }, + changedelete = { + hl = "GitSignsChange", + text = "▎", + numhl = "GitSignsChangeNr", + linehl = "GitSignsChangeLn", + }, }, - topdelete = { - hl = "GitSignsDelete", - text = "契", - numhl = "GitSignsDeleteNr", - linehl = "GitSignsDeleteLn", + numhl = false, + linehl = false, + keymaps = { + -- Default keymap options + noremap = true, + buffer = true, }, - changedelete = { - hl = "GitSignsChange", - text = "▎", - numhl = "GitSignsChangeNr", - linehl = "GitSignsChangeLn", - }, - }, - numhl = false, - linehl = false, - keymaps = { - -- Default keymap options - noremap = true, - buffer = true, + watch_index = { interval = 1000 }, + sign_priority = 6, + update_debounce = 200, + status_formatter = nil, -- Use default }, - watch_index = { interval = 1000 }, - sign_priority = 6, - update_debounce = 200, - status_formatter = nil, -- Use default } end M.setup = function() - local status_ok, gitsigns = pcall(require, "gitsigns") - if not status_ok then - Log:get_default().error "Failed to load gitsigns" - return + local gitsigns = require "gitsigns" + + gitsigns.setup(lvim.builtin.gitsigns.opts) + if lvim.builtin.gitsigns.on_config_done then + lvim.builtin.gitsigns.on_config_done(gitsigns) end - gitsigns.setup(lvim.builtin.gitsigns) end return M |