Skip to content

Commit

Permalink
fix(nvim): display Markdown without leadmultispace listchars
Browse files Browse the repository at this point in the history
  • Loading branch information
heygarrett committed Jul 4, 2024
1 parent b7ae6e2 commit 4ff7660
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nvim/lua/my/settings/indentation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ vim.api.nvim_create_autocmd("BufWinEnter", {
vim.api.nvim_create_user_command("Relist", function()
if vim.bo.expandtab then
-- Set whitespace characters for indentation with spaces
vim.opt_local.listchars =
vim.tbl_extend("force", vim.opt_global.listchars:get(), {
leadmultispace = ":" .. (" "):rep(vim.bo.tabstop - 1),
tab = "> ",
})
local listchars = vim.opt_global.listchars:get()
listchars.tab = "> "
if vim.bo.filetype ~= "markdown" then
listchars.leadmultispace = ":" .. (" "):rep(vim.bo.tabstop - 1)
end
vim.opt_local.listchars = listchars
else
-- Remove leadmultispace from listchars
vim.wo.listchars = vim.go.listchars
Expand Down

0 comments on commit 4ff7660

Please sign in to comment.