ITADN

Conflict with `vim-table-mode`

#856Closedtan-wei 创建于 2025-05-18
bug
T
tan-weicommented
### 🐛 Describe the bug [vim-table-mode](https://github.com/dhruvasagar/vim-table-mode) is a well-known plugin makes editing table quite easy. But it seems `obsidian.nvim` would make it crash when toggled. I don't know why, because AFAIK, it is a viml only plugin, could not be errored by other plugins. If we use both plugins when editing a markdown file (e.g., `:e test.md`), the time we `:TableModeToggle` will cause errors: ``` Error in function tablemode#Toggle[6]..<SNR>41_SetActive[2]..<SNR>41_ToggleSyntax: line 4: E867: (NFA) Unknown operator '\%%' E475: Invalid argument: Table /^\s*\(%%\)\?\s*\zs|.\+|\ze\s*\(\s\+\%\%\)\?\s*$/ contains=TableBorder,TableSeparator,TableColumnAlign,yesCell,noCell,maybeCell,redCell,greenCell,yellowCell,blueCell,whiteCell,darkCell containedin=ALL Table Mode Enabled ``` ### Config ```lua vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" local lazypath = "/tmp/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath, }) end vim.opt.rtp:prepend(lazypath) vim.opt.termguicolors = true vim.g.table_mode_corner = "|" require("lazy").setup({ { "obsidian-nvim/obsidian.nvim", dependencies = { "nvim-lua/plenary.nvim", }, ft = "markdown", opts = { workspaces = { { name = "buf-parent", path = function() return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0))) end, }, { name = "no-vault", path = function() -- alternatively use the CWD: -- return assert(vim.fn.getcwd()) return assert(vim.fs.dirname(vim.api.nvim_buf_get_name(0))) end, overrides = { notes_subdir = vim.NIL, -- have to use 'vim.NIL' instead of 'nil' new_notes_location = "current_dir", templates = { folder = vim.NIL, }, disable_frontmatter = true, }, }, }, ui = { enable = false, -- NOTE: Enable it requires conceallevel set 1 or 2 }, }, }, { "dhruvasagar/vim-table-mode" }, }, { root = "/tmp/lazy" }) ``` Use `nvim --clean -u init.lua` will automatically install and load these two plugins. ### Environment nvim version: ``` NVIM v0.12.0-dev-395+g4a6f017bc1 Build type: Release LuaJIT 2.1.1741730670 Run "nvim -V1 -v" for more info ``` `obsidian.nvim` version: latest commit `14e0427`.
关闭于 2025-05-27 3 条评论