From: Hiroshi Shirosaki Date: Mon, 1 Sep 2014 05:42:38 +0000 (+0900) Subject: Use getloclist() for location list of :Toc X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/c6a731c5fa00ad7a776b99d28d31617e7a7c3210 Use getloclist() for location list of :Toc :Toc causes errors because getqflist() returns empty for location list. Fix #108 --- diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index 057947b..d4113ad 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -321,8 +321,8 @@ function! s:Markdown_Toc(...) 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