X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/82ced930ae169ee276b85db716fb8d1e24dd53eb..68b59de79f80cf79888a180104841c3c42d05963:/ftplugin/mkd.vim diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index dfb5546..312c2a4 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -302,27 +302,26 @@ function! s:Markdown_Toc(...) endif try - silent vimgrep /\(^\S.*\(\n[=-]\+\n\)\@=\|^#\+\)/ % + silent lvimgrep /\(^\S.*\(\n[=-]\+\n\)\@=\|^#\+\)/ % catch /E480/ echom "Toc: No headers." return 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} #// 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