From: Ciro Santilli Date: Sun, 7 Sep 2014 16:01:43 +0000 (+0200) Subject: Merge pull request #103 from fmoralesc/patch-1 X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/5da9db319c1c4382c8f9f55b3bf12917f001fbd7?ds=sidebyside Merge pull request #103 from fmoralesc/patch-1 Toc: Pass errors if no atx headers are processed. --- 5da9db319c1c4382c8f9f55b3bf12917f001fbd7 diff --cc ftplugin/mkd.vim index d4113ad,e177bd1..42dca90 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@@ -309,20 -309,20 +309,20 @@@ function! s:Markdown_Toc(... endtry if l:window_type ==# 'horizontal' - copen + lopen elseif l:window_type ==# 'vertical' - vertical copen + vertical lopen let &winwidth=(&columns/2) elseif l:window_type ==# 'tab' - tab copen + tab lopen else - copen + lopen endif set modifiable - %s/\v^([^|]*\|){2,2} #// + %s/\v^([^|]*\|){2,2} #//e for i in range(1, line('$')) - " this is the quickfix data for the current item - let d = getqflist()[i-1] + " this is the location-list data for the current item + let d = getloclist(0)[i-1] " atx headers if match(d.text, "^#") > -1 let l:level = len(matchstr(d.text, '#*', 'g'))-1