silicon.lua
silicon.lua copied to clipboard
Gobble feature inaccuracy
The gobble feature sometimes breaks, here are two examples of it happening (LaTeX, Lua)

The blocks are indented as following (using indentation tabs as character). In the second example I also included the visual highlighting utilized for the screenshot

\begin{warn}[Test]
Just a simple test in latex
\end{warn}
-- Disable global cursor line
-- Enable on focus buffer()
vim.opt.cursorline = false
vim.api.nvim_create_autocmd({'VimEnter', 'WinEnter', 'BufWinEnter'},
{ callback = function() vim.opt_local.cursorline = true end})
vim.api.nvim_create_autocmd({'WinLeave'},
{ callback = function() vim.opt_local.cursorline = false end})
I think it has something to do with the prefix-indentation (i.e. both blocks are indented once)

Oddly enough, the problem disappears by adding one (or more) indentation level(s)

I am also going to include my indent configuration for the sake of completeness.
-- Indentation --
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2
vim.opt.expandtab = false
vim.opt.smarttab = false
vim.opt.shiftround = true
vim.opt.autoindent = true
vim.opt.smartindent = false