Skip to content

Disabling treesitter doesn't restore the proper syntax value #21836

@michelesr

Description

@michelesr

Describe the bug

When treesitter gets disabled, you end up with no syntax highlighting at all -> :set syntax? returns syntax=on rather then e.g. syntax=c for a C file.

Steps to reproduce

  • run nvim --clean a.c
  • check that :set syntax? returns syntax=c
  • run :lua vim.treesitter.stop()
  • check that :set syntax? returns syntax=on

Expected behavior

The value of syntax should be restored to the proper syntax for the filetype, e.g. syntax=c for a C file.

Neovim version (nvim -v)

NVIM v0.8.2

Vim (not Nvim) behaves the same?

n/a

Operating system/version

ArchLinux

Terminal name/version

alacritty with tmux

$TERM environment variable

tmux-256color

Installation

Arch Linux community package

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions