X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/82ced930ae169ee276b85db716fb8d1e24dd53eb..a9f56e2ce0a97c79ed61cb536e141453c2f92975:/ftplugin/mkd.vim?ds=inline diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index dfb5546..42dca90 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -302,27 +302,27 @@ 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} #// + %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