Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context header disappears with markdown_inline parser installed #400

Closed
polirritmico opened this issue Feb 18, 2024 · 1 comment · Fixed by #401
Closed

Context header disappears with markdown_inline parser installed #400

polirritmico opened this issue Feb 18, 2024 · 1 comment · Fixed by #401
Labels
bug Something isn't working

Comments

@polirritmico
Copy link

polirritmico commented Feb 18, 2024

Description

Hi.

When markdown and markdown_inline parsers are installed, the context header disappears when the cursor is currently on a text line.
:TSUninstall markdown_inline fix the problem.

Bisecting the repo points to this commit 0a95d47

Regards

Neovim version

NVIM v0.9.5 Build type: Release LuaJIT 2.1.0-beta3 Compilation: /usr/bin/x86_64-pc-linux-gnu-gcc -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-common -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/usr/include -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5_build/src/nvim/auto -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5_build/include -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5_build/cmake.config -I/var/tmp/portage/app-editors/neovim-0.9.5/work/neovim-0.9.5/src -I/usr/include-I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include

Expected behavior

The context header should not be disappearing

Actual behavior

video showing the actual behavior:

simplescreenrecorder-2024-02-18_17.46.47.mp4

Minimal config

local plugins = {
    ts = "https://github.com/nvim-treesitter/nvim-treesitter",
    ts_context = "https://github.com/nvim-treesitter/nvim-treesitter-context",
}

for name, url in pairs(plugins) do
    local install_path = "/tmp/nvim/site/" .. name
    if vim.fn.isdirectory(install_path) == 0 then
        vim.fn.system({ "git", "clone", "--depth=1", url, install_path })
    end
    vim.o.runtimepath = install_path .. "," .. vim.o.runtimepath
end

require("nvim-treesitter.configs").setup({
    auto_install = true,
    ensure_installed = {
        "markdown",
        "markdown_inline",
    },
})
require("treesitter-context").setup({})

Steps to reproduce

  1. Test file. foo.md:
# Title

zt here


Cursor at this line causes the context header to disappear if markdown inline is installed

  1. nvim --clean -u minimal.lua foo.md
  2. zt on line 2
  3. Move the cursor with j to reach line 6.
  4. The context title should disappear.
  5. :TSUninstall markdown_inline should fix the issue.
@polirritmico polirritmico added the bug Something isn't working label Feb 18, 2024
@lewis6991
Copy link
Member

lewis6991 commented Feb 18, 2024

@kwaszczuk

Markdown_inline is an injected language so I'm surprised this stopped working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants