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

Errors when attempting to use markdown as a fenced language #121

Open
elazar opened this issue Sep 29, 2017 · 3 comments
Open

Errors when attempting to use markdown as a fenced language #121

elazar opened this issue Sep 29, 2017 · 3 comments

Comments

@elazar
Copy link

elazar commented Sep 29, 2017

I'm using Neovim installed via Homebrew.

❯ vim -v
NVIM v0.2.0
Build type: Release
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_MSGPACK_HAS_FLOAT32 -DNDEBUG -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/config -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/src -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/include -I/usr/local/opt/gettext/include -I/usr/include -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/src/nvim/auto -I/tmp/neovim-20170707-80027-1bg0wcx/neovim-0.2.0/build/include
Compiled by [email protected]

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.2.0_1/share/nvim"

I have revision a7dbc31 of this plugin installed using junegunn/vim-plug@ddc67fc.

This is the vim configuration file I'm using:

call plug#begin('~/.vim/plugins')

Plug 'tpope/vim-markdown', { 'for': 'markdown' }

let g:markdown_fenced_languages = [
    \ 'markdown',
    \ ]

call plug#end()

If I comment out the block to assign a value to g:markdown_fenced_languages, I'm able to load a .md file without issue. However, with the block in place, loading even an empty .md file produces this output...

"test.md" 0L, 0C
Error detected while processing /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/javascript.vim:
line    1:
E169: Command too recursive
Error detected while processing /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/vb.vim:
line    1:
E169: Command too recursive
Error detected while processing /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/css.vim:
line    1:
E169: Command too recursive
Error detected while processing /Users/matthewturland/.vim/plugins/vim-markdown/syntax/markdown.vim:
line    1:
E169: Command too recursive
Error detected while processing /usr/local/Cellar/neovim/0.2.0_1/share/nvim/runtime/syntax/markdown.vim:
line    1:
E169: Command too recursive
Error detected while processing /Users/matthewturland/.vim/plugins/vim-markdown/syntax/markdown.vim:

... followed by a lot of repetitions of this.

line   31:
E121: Undefined variable: s:done_include
line  105:
E121: Undefined variable: main_syntax
E15: Invalid expression: main_syntax ==# 'markdown'
line  159:
E121: Undefined variable: main_syntax
E15: Invalid expression: main_syntax ==# 'markdown'
@austintraver
Copy link

I'm also experiencing this. I can see how adding fenced code blocks with "markdown" syntax highlighting within a markdown file could cause infinite recursion... could this be avoided with some sort of conditional statement?

@tpope
Copy link
Owner

tpope commented Sep 29, 2020

My guess would be that yes, it could.

@AceofSpades5757
Copy link

Using Vim, I'm having a very similar issue where using markdown as the language is causing a recursive loop.

There could be an issue since I'm pretty sure I just copied the syntax file into my .vim/syntax folder.

File Contents

    # My Markdown File
    
    ...
    
    ``` markdown
    Some Markdown...
    ```

Errors

Error detected while processing CursorHold Autocommands for "<buffer=1>"..function <SNR>154_MarkdownRefreshSyntax[2]..<SNR>154_MarkdownHighlightSources[31]..<SNR>154_SyntaxInclude[14]..CursorHold Autocommands for "<buffer=1>"..function <SNR>154_MarkdownRefreshSyntax[2]..<SNR>154_MarkdownHighlightSources[31]..<SNR>154_SyntaxInclude[10]..script C:\Users\USERNAME\vimfiles\syntax\markdown.vim[33]..C:\Program Files\Vim\vim82\syntax\vim.vim:
line  833:
E403: syntax sync: line continuations pattern specified twice
Error detected while processing CursorHold Autocommands for "<buffer=1>"..function <SNR>154_MarkdownRefreshSyntax[2]..<SNR>154_MarkdownHighlightSources:
line   31:
E171: Missing :endif
Error detected while processing CursorHold Autocommands for "<buffer=1>"..function <SNR>154_MarkdownRefreshSyntax:
line    2:
E171: Missing :endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@tpope @elazar @AceofSpades5757 @austintraver and others