Julian / lean.nvim

neovim support for the Lean theorem prover
MIT License
248 stars 25 forks source link

Anonymous sections aren't treated as a pair #310

Closed stephen-huan closed 9 months ago

stephen-huan commented 10 months ago

For the matchit support, something like

section test
end test

is recognized but not an anonymous section

section
end

because the regex expects a name.

-- Matchit support
if vim.g.loaded_matchit and not vim.b.match_words then
  vim.b.match_ignorecase = 0
  vim.b.match_words = table.concat(
    {
        [[\<\%(namespace\|section\)\s\+\(.\{-}\)\>:\<end\s\+\1\>]],
    },
    ','
  )
end
Julian commented 9 months ago

Should be fixed for the simple case (no nested anonymous sections) at least. Thanks for filing.