Open cavanaug opened 3 weeks ago
@cavanaug Use the issue template properly and fill in the minimal config.
I dont think this can be attributed as a bug in the pack, or just a limitation to the upstream plugins that the pack is using. The Json lsp isnt running when editing a markdown file, so its seems like its either markdown-oxide, or perhaps treesitter(Dont see how but just leaving this here) thats formatting the buffer and the code blocks.
Does Prettier format markdown code blocks?
Checklist
repro.lua
provided belowNeovim version (nvim -v)
NVIM v0.10.2 Build type: Release LuaJIT 2.1.1727870382
Operating system/version
debian linux
Terminal/GUI
windows terminal
Describe the bug
Im seeing inconsistent formatting for json files vs json codeblocks in markdown. When editing a standard json file, I get things appropriately mapped with my editorconfig settings of
So everything when I run an lsp format is properly formatting with 4 spaces.
But if I bring the same exact json content into a markdown codeblock wrapped with a json type and I do an lsp format I get the same data but it is expanded with tabs, not spaces. This makes it awkward when I check in a file and it is viewed in Github preview, the tabs are then expanded out to 8 spaces and it looks awful.
yaml ironically works identically for formatting a native file or within a code block. That is the behavior I would expect for json as well.
Steps to Reproduce
Load a vanilla astrovim with the included community.lua file
utilize any small json file, and compare its formatting between a native file and the same content in a markdown json codeblock
Expected behavior
I would expect the same formatting (ie. spaces) that I see when editing a json file natively
Screenshots
No response
Additional Context
-- AstroCommunity: import any community modules here -- We import this file in
lazy_setup.lua
before theplugins/
folder. -- This guarantees that the specs are processed before any user plugins.---@type LazySpec return { "AstroNvim/astrocommunity", { import = "astrocommunity.pack.lua" }, { import = "astrocommunity.pack.markdown" }, { import = "astrocommunity.pack.json" }, { import = "astrocommunity.pack.yaml" }, -- import/override with your plugins folder }
Minimal configuration