Skip to content

Commit

Permalink
feat: add option to disable commands (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeddro committed Nov 28, 2022
1 parent 0f87781 commit 77faa75
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ I recommend using the tag field of you package manager, so your version of this
```lua
{
default_mappings = true, -- disable buffer local mapping created by this plugin
default_commands = true, -- disable commands created by this plugin
disable_diagnostics = false, -- This will disable the diagnostics in a buffer whilst it is conflicted
highlights = { -- They must have background color, otherwise the default color will be used
incoming = 'DiffText',
Expand Down
7 changes: 6 additions & 1 deletion lua/git-conflict.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ local DEFAULT_ANCESTOR_BG_COLOR = 6824314 -- #68217A
local config = {
debug = false,
default_mappings = true,
default_commands = true,
disable_diagnostics = false,
highlights = {
current = 'DiffText',
Expand Down Expand Up @@ -555,7 +556,11 @@ function M.setup(user_config)

config = vim.tbl_deep_extend('force', config, user_config or {})
set_highlights(config.highlights)
set_commands()

if config.default_commands then
set_commands()
end

set_plug_mappings()

api.nvim_create_augroup(AUGROUP_NAME, { clear = true })
Expand Down

0 comments on commit 77faa75

Please sign in to comment.