SpaceVim / SpaceVim

A modular Vim/Neovim configuration
https://spacevim.org/
GNU General Public License v3.0
20.29k stars 1.42k forks source link

Tex codeblock syntax highlight not work in lang#markdown layer #3138

Closed thawk closed 4 years ago

thawk commented 5 years ago

Expected behavior, english is required

When the lang#latex layer is enabled, tex code block should be correctly highlighted.

The reproduce ways from Vim starting (Required!)

  1. Enable lang#latex layer in init.toml

  2. Create test.tex, input

       $\frac{1}{3} = \frac{x_1}{y_1}$
  3. It should be colourful, but not.

  4. Enable the non-existed lang#tex layer in init.toml and try again,the aboved code is highlight correctly

The Cause

The code in SpaceVim#layers#lang#markdown#config() fills g:markdown_nested_languages with names of all enabled lang# layers. Those names were used as code block name in the vim-markdown and load the syntax file with same name for highlighting.

Because SpaceVim has lang#latex layer, but what vim has is syntax/tex.vim not syntax/latex.vim, so the syntax file can't be correctly loaded.

Should we rename the latex layer, or let the latex layer load syntax/tex.vim instead?

wsdjeg commented 5 years ago

so what is the correct language name? for java the language is java and the filetype is java and the layer is lang#java too.  we recomamnd to use latex as the layer and language name, as spacevim has allready publish the layer page on the website.

wsdjeg

Expected behavior, english is required

When the lang#latex layer is enabled, tex code block should be correctly highlighted.

The reproduce ways from Vim starting (Required!)

  1. Enable lang#latex layer in init.toml

  2. Create test.tex, input

       ```tex

       $\frac{1}{3} = \frac{x_1}{y_1}$

       ```

  1. It should be colourful, but not.

  2. Enable the non-existed lang#tex layer in init.toml and try again,the aboved code is highlight correctly

The Cause

The code in SpaceVim#layers#lang#markdown#config() fills g:markdown_nested_languages with names of all enabled lang# layers.  Those names were used as code block name in the vim-markdown and load the syntax file with same name for highlighting.

Because SpaceVim has lang#latex layer, but what vim has is syntax/tex.vim not syntax/latex.vim, so the syntax file can't be correctly loaded.

Should we rename the latex layer, or let the latex layer load syntax/tex.vim instead?

--

You are receiving this because you are subscribed to this thread.

Reply to this email directly or view it on GitHub:

https://github.com/SpaceVim/SpaceVim/issues/3138

thawk commented 5 years ago

The language name is tex. The file extension which LaTeX handles is *.tex (Wiki). Also the syntax file provied by vim/nvim is syntax/tex.vim.

wsdjeg commented 5 years ago

so what is latex, and why the prefix la is added?

wsdjeg

The language name is tex. The file extension which LaTeX handles is *.tex (Wiki). Also the syntax file provied by vim/nvim is syntax/tex.vim.

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/SpaceVim/SpaceVim/issues/3138#issuecomment-541070113

thawk commented 5 years ago

Actually, I am not a TeX/LaTeX user. I just want to write some Tex formula in Markdown document.
I found some descriptions:

wsdjeg commented 5 years ago

Thanks for your info.