fix: remove useless enabled flag
This commit is contained in:
parent
a72296384c
commit
f71b0f54c5
3 changed files with 1 additions and 15 deletions
|
|
@ -44,7 +44,7 @@ luarocks install diffs.nvim
|
||||||
The buffer is then re-painted after `debounce_ms` milliseconds, causing an
|
The buffer is then re-painted after `debounce_ms` milliseconds, causing an
|
||||||
unavoidable visual "flash" even when `debounce_ms = 0`.
|
unavoidable visual "flash" even when `debounce_ms = 0`.
|
||||||
|
|
||||||
## Acknowledgements
|
# Acknowledgements
|
||||||
|
|
||||||
- [vim-fugitive](https://github.com/tpope/vim-fugitive)
|
- [vim-fugitive](https://github.com/tpope/vim-fugitive)
|
||||||
- [codediff.nvim](https://github.com/esmuellert/codediff.nvim)
|
- [codediff.nvim](https://github.com/esmuellert/codediff.nvim)
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,6 @@ CONFIGURATION *diffs-config*
|
||||||
|
|
||||||
*diffs.Config*
|
*diffs.Config*
|
||||||
Fields: ~
|
Fields: ~
|
||||||
{enabled} (boolean, default: true)
|
|
||||||
Enable or disable highlighting globally.
|
|
||||||
|
|
||||||
{debug} (boolean, default: false)
|
{debug} (boolean, default: false)
|
||||||
Enable debug logging to |:messages| with
|
Enable debug logging to |:messages| with
|
||||||
`[diffs]` prefix.
|
`[diffs]` prefix.
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
---@field max_lines integer
|
---@field max_lines integer
|
||||||
|
|
||||||
---@class diffs.Config
|
---@class diffs.Config
|
||||||
---@field enabled boolean
|
|
||||||
---@field debug boolean
|
---@field debug boolean
|
||||||
---@field debounce_ms integer
|
---@field debounce_ms integer
|
||||||
---@field hide_prefix boolean
|
---@field hide_prefix boolean
|
||||||
|
|
@ -65,7 +64,6 @@ end
|
||||||
|
|
||||||
---@type diffs.Config
|
---@type diffs.Config
|
||||||
local default_config = {
|
local default_config = {
|
||||||
enabled = true,
|
|
||||||
debug = false,
|
debug = false,
|
||||||
debounce_ms = 0,
|
debounce_ms = 0,
|
||||||
hide_prefix = false,
|
hide_prefix = false,
|
||||||
|
|
@ -102,10 +100,6 @@ local dbg = log.dbg
|
||||||
|
|
||||||
---@param bufnr integer
|
---@param bufnr integer
|
||||||
local function highlight_buffer(bufnr)
|
local function highlight_buffer(bufnr)
|
||||||
if not config.enabled then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if not vim.api.nvim_buf_is_valid(bufnr) then
|
if not vim.api.nvim_buf_is_valid(bufnr) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -242,10 +236,6 @@ local DIFF_WINHIGHLIGHT = table.concat({
|
||||||
}, ',')
|
}, ',')
|
||||||
|
|
||||||
function M.attach_diff()
|
function M.attach_diff()
|
||||||
if not config.enabled then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local tabpage = vim.api.nvim_get_current_tabpage()
|
local tabpage = vim.api.nvim_get_current_tabpage()
|
||||||
local wins = vim.api.nvim_tabpage_list_wins(tabpage)
|
local wins = vim.api.nvim_tabpage_list_wins(tabpage)
|
||||||
|
|
||||||
|
|
@ -282,7 +272,6 @@ function M.setup(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|
||||||
vim.validate({
|
vim.validate({
|
||||||
enabled = { opts.enabled, 'boolean', true },
|
|
||||||
debug = { opts.debug, 'boolean', true },
|
debug = { opts.debug, 'boolean', true },
|
||||||
debounce_ms = { opts.debounce_ms, 'number', true },
|
debounce_ms = { opts.debounce_ms, 'number', true },
|
||||||
hide_prefix = { opts.hide_prefix, 'boolean', true },
|
hide_prefix = { opts.hide_prefix, 'boolean', true },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue