tpope / vim-markdown

Vim Markdown runtime files
1.22k stars 191 forks source link

Can not highlight toc #117

Open wsdjeg opened 7 years ago

wsdjeg commented 7 years ago

highlight error with toc, here is a picture

2017-05-15-20 00 34

and here is the markdown

<!-- vim-markdown-toc GFM -->
* [Core Pillars](#core-pillars)
    * [Mnemonic](#mnemonic)
    * [Discoverable](#discoverable)
    * [Consistent](#consistent)
    * [Crowd-Configured](#crowd-configured)
* [Highlighted features](#highlighted-features)
* [Screenshots](#screenshots)
    * [welcome page](#welcome-page)
    * [working flow](#working-flow)
* [Who can benefit from this?](#who-can-benefit-from-this)
* [Update and Rollback](#update-and-rollback)
    * [Update SpaceVim itself](#update-spacevim-itself)
        * [Automatic Updates](#automatic-updates)
        * [Updating from the SpaceVim Buffer](#updating-from-the-spacevim-buffer)
        * [Updating Manually with git](#updating-manually-with-git)
    * [Update plugins](#update-plugins)
* [Configuration layers](#configuration-layers)
* [Custom Configuration](#custom-configuration)
    * [Automatic Generation](#automatic-generation)
    * [Alternative directory](#alternative-directory)
* [Awesome ui](#awesome-ui)
    * [Colorschemes](#colorschemes)
    * [Font](#font)
    * [UI Toggles](#ui-toggles)
    * [Statusline && tabline](#statusline--tabline)
* [Manual](#manual)
    * [Completion](#completion)
        * [Unite/Denite](#unitedenite)
            * [Mappings within unite/denite buffer](#mappings-within-unitedenite-buffer)
    * [Discovering](#discovering)
        * [Mappings](#mappings)
            * [Mappings guide](#mappings-guide)
            * [Unide/Denite describe key bindings](#unidedenite-describe-key-bindings)
        * [Getting help](#getting-help)
        * [Available layers](#available-layers)
            * [Available plugins in SpaceVim](#available-plugins-in-spacevim)
            * [New packages from ELPA repositories](#new-packages-from-elpa-repositories)
        * [Toggles](#toggles)
* [Features](#features)
    * [Awesome ui](#awesome-ui-1)
    * [Mnemonic key bindings](#mnemonic-key-bindings)
* [Language specific mode](#language-specific-mode)
* [Key Mapping](#key-mapping)
    * [c/c++ support](#cc-support)
    * [go support](#go-support)
    * [python support](#python-support)
* [Neovim centric - Dark powered mode of SpaceVim.](#neovim-centric---dark-powered-mode-of-spacevim)
* [Modular configuration](#modular-configuration)
* [Multiple leader mode](#multiple-leader-mode)
    * [Global origin vim leader](#global-origin-vim-leader)
    * [Local origin vim leader](#local-origin-vim-leader)
    * [Windows function leader](#windows-function-leader)
    * [Unite work flow leader](#unite-work-flow-leader)
* [Unite centric work-flow](#unite-centric-work-flow)
        * [Plugin Highlights](#plugin-highlights)
        * [Non Lazy-Loaded Plugins](#non-lazy-loaded-plugins)
        * [Lazy-Loaded Plugins](#lazy-loaded-plugins)
            * [Language](#language)
            * [Commands](#commands)
            * [Commands](#commands-1)
            * [Completion](#completion-1)
            * [Unite](#unite)
            * [Operators & Text Objects](#operators--text-objects)
        * [Custom Key bindings](#custom-key-bindings)
            * [File Operations](#file-operations)
            * [Editor UI](#editor-ui)
            * [Window Management](#window-management)
            * [Native functions](#native-functions)
            * [Plugin: Unite](#plugin-unite)
            * [Plugin: VimFiler](#plugin-vimfiler)
            * [Plugin: neocomplete](#plugin-neocomplete)
            * [Plugin: NERD Commenter](#plugin-nerd-commenter)
            * [Plugin: Goyo and Limelight](#plugin-goyo-and-limelight)
            * [Plugin: ChooseWin](#plugin-choosewin)
            * [Plugin: Bookmarks](#plugin-bookmarks)
            * [Plugin: Gita](#plugin-gita)
            * [Plugin: vim-signify](#plugin-vim-signify)
            * [Misc Plugins](#misc-plugins)

<!-- vim-markdown-toc -->
wsdjeg commented 7 years ago

@tpope hello, I have tried https://github.com/plasticboy/vim-markdown and https://github.com/gabrielelana/vim-markdown both of them are too slow when hold on j/k to move cursor. so now I want to use your plugin, and thanks for your work, but now I get a issue with it. can you fix it?

wsdjeg commented 7 years ago

@tpope I just test this issue, and this patch fix the issue,

diff --git a/syntax/markdown.vim b/syntax/markdown.vim
index 14d288b..d2a04c5 100644
--- a/syntax/markdown.vim
+++ b/syntax/markdown.vim
@@ -64,8 +64,8 @@ syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
 syn region markdownCodeBlock start="    \|\t" end="$" contained

 " TODO: real nesting
-syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
-syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained
+syn match markdownListMarker "\%(\t\| \{0,8\}\)[-*+]\%(\s\+\S\)\@=" contained
+syn match markdownOrderedListMarker "\%(\t\| \{0,8}\)\<\d\+\.\%(\s\+\S\)\@=" contained

 syn match markdownRule "\* *\* *\*[ *]*$" contained
 syn match markdownRule "- *- *-[ -]*$" contained

I am not sure if this can be merged.