Code fence lines are fully hidden in .qmd buffers unless a .md file was opened first
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 56/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- lua, neovim
Hướng nghiên cứu
Start by reproducing the issue in Neovim with a .qmd file opened before any .md file, then compare the behavior after opening Markdown. The report points to nvim-treesitter’s Markdown highlights.scm conceal rules and notes that setting conceallevel=0 restores the fences. Find the initialization path that differs between those cases; done when fence lines remain visible in the reported .qmd startup sequence without requiring the workaround.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In a .qmd buffer, the opening and closing lines of a fenced code block (```python / ```) are completely hidden unless the cursor is on them. If I first open any .md file in the same session and then open the .qmd, the fence lines are shown normally (screenshots below).
Findings
- The hiding seems to come from nvim-treesitter's markdown
highlights.scm, which setsconcealandconceal_linesonfenced_code_block_delimiterand theinfo_stringlanguage. - With
set conceallevel=0the fences reappear, so it's treesitter conceal, not syntax conceal (syntaxis empty,synconcealed()returns0). - The query file used is the same in both states.
- Manually loading render-markdown.nvim in the broken state (
:Lazy load render-markdown.nvim) changes nothing, and itsfile_typesdoesn't includequarto. So opening a markdown file triggers something else that affects.qmdbuffers.
Workaround
Creating a scratch buffer with filetype=markdown once, on the first quarto FileType event, fixes it:
vim.api.nvim_create_autocmd("FileType", {
-- When opening a quarto file with quarto-nvim, first trigger a load with render-markdown to ensure its proper initialization.
-- This works around an issue where loading a quarto file before markdown results in concealed code block fences.
pattern = "quarto",
once = true,
callback = function()
local scratch = vim.api.nvim_create_buf(false, true)
vim.bo[scratch].filetype = "markdown"
vim.schedule(function()
vim.api.nvim_buf_delete(scratch, { force = true })
end)
end,
})
Steps to reproduce
- Start Neovim and open a
.qmdfile containing a Python code block. - Move the cursor off the fence lines: they disappear.
- Open any
.mdfile, then delete the.qmdbuffer and reopen it: the fences are visible.
Environment
- Neovim: 0.12.4
- OS: macOS
- Distribution: LazyVim
- quarto-nvim / nvim-treesitter / render-markdown.nvim: v2.1.0 / e289100 / 245956d
- Config:
ft = "quarto", opts = { codeRunner = { enabled = true, default_method = "molten", }, }
Screenshots
.qmd opened first
.qmd opened after .md
- Ngôn ngữ chính
- Lua
- Star
- 533
- Fork
- 21
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của quarto-dev/quarto-nvim
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
quarto-dev/quarto-nvim#127 · 4 reaction ·
-
waiting
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
quarto-dev/quarto-nvim#122 · 3 bình luận ·
-
add quarto treesitter grammerĐang mởenhancement waiting
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
quarto-dev/quarto-nvim#31 · 1 bình luận ·
-
add quarto-lspĐang mởenhancement waiting
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
quarto-dev/quarto-nvim#13 · 3 bình luận · 1 reaction ·
Tất cả issue của quarto-dev/quarto-nvim
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
EmirErtorer/ink-away.koplugin#38 · 1 bình luận ·
-
Add event count to export UIĐang mởFeature Request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Questie/QuestieTrace#92 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Forever: Forgotten Loa Idols (97225) needs Report to Sen’jin Village (805) as a prerequisiteĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
WitchĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
LuaLS/lua-language-server#3471 ·