8000 bug: Formatting with markdownlint-cli2 invalid capture index error · Issue #725 · stevearc/conform.nvim · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
bug: Formatting with markdownlint-cli2 invalid capture index error #725
Open
@nickeisenberg

Description

@nickeisenberg

Neovim version (nvim -v)

NVIM v0.10.5

Operating system/version

Ubuntu 24.04

Read debugging tips

Add the debug logs

  • I have set log_level = vim.log.levels.DEBUG and pasted the log contents below.

Log file

Error executing Lua callback: ...ocal/share/nvim/lazy/conform.nvim/lua/conform/runner.lua:506: invalid capture index
stack traceback:
[C]: in function 'gsub'
...ocal/share/nvim/lazy/conform.nvim/lua/conform/runner.lua:506: in function 'build_context'
....local/share/nvim/lazy/conform.nvim/lua/conform/init.lua:770: in function 'get_formatter_info'
...ocal/share/nvim/lazy/conform.nvim/lua/conform/health.lua:140: in function 'append_formatters'
...ocal/share/nvim/lazy/conform.nvim/lua/conform/health.lua:159: in function 'show_window'
...s/.local/share/nvim/lazy/conform.nvim/plugin/conform.lua:2: in function <...s/.local/share/nvim/lazy/conform.nvim/plugin/conform.lua:1>

Describe the bug

I am unable to format with markdownlint-cli2.

What is the severity of this bug?

breaking (some functionality is broken)

Steps To Reproduce

  1. Install using lazy
return {
  {
    "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        log_level = vim.log.levels.DEBUG,
        formatters_by_ft = {
          markdown = { "markdownlint-cli2" },
        }
      })
    end,
  },
  1. Open and markdown file and run :lua require("conform").format()

  2. Thats it.

Expected Behavior

I would like the current file to be formatted with markdownlint-cli2 but there is an error instead.

Minimal example file

#title

Try formatting this with conform.nvim

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/conform.nvim",
    config = function()
      require("conform").setup({
        log_level = vim.log.levels.DEBUG,
        -- add your config here
        formatters_by_ft = {
          markdown = { "markdownlint-cli2" },
        }
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0