Skip to content

Commit

Permalink
fix(indent): repeat_linbebreak only works on Neovim >= 0.10. Fixes #353
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Dec 20, 2024
1 parent 9563bb1 commit b93201b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/snacks/indent.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ local ns = vim.api.nvim_create_namespace("snacks_indent")
local cache_extmarks = {} ---@type table<string, vim.api.keyset.set_extmark[]>
local debug_timer = assert((vim.uv or vim.loop).new_timer())
local cache_underline = {} ---@type table<string, boolean>
local has_repeat_lb = vim.fn.has("nvim-0.10.0") == 1
local states = {} ---@type table<number, snacks.indent.State>
local scopes ---@type snacks.scope.Listener?
local stats = {
Expand Down Expand Up @@ -170,7 +171,7 @@ local function get_extmarks(indent, state)
hl_mode = "combine",
priority = config.indent.priority,
ephemeral = true,
virt_text_repeat_linebreak = state.breakindent,
virt_text_repeat_linebreak = has_repeat_lb and state.breakindent or nil,
})
end
end
Expand Down Expand Up @@ -337,7 +338,7 @@ function M.render_scope(scope, state)
priority = config.scope.priority,
strict = false,
ephemeral = true,
virt_text_repeat_linebreak = state.breakindent,
virt_text_repeat_linebreak = has_repeat_lb and state.breakindent or nil,
})
end
end
Expand Down Expand Up @@ -368,7 +369,7 @@ function M.render_chunk(scope, state)
hl_mode = "combine",
priority = config.chunk.priority,
strict = false,
virt_text_repeat_linebreak = repeat_indent,
virt_text_repeat_linebreak = has_repeat_lb and repeat_indent or nil,
ephemeral = true,
})
end
Expand Down

0 comments on commit b93201b

Please sign in to comment.