From c6a731c5fa00ad7a776b99d28d31617e7a7c3210 Mon Sep 17 00:00:00 2001 From: Hiroshi Shirosaki Date: Mon, 1 Sep 2014 14:42:38 +0900 Subject: [PATCH] Use getloclist() for location list of :Toc :Toc causes errors because getqflist() returns empty for location list. Fix #108 --- ftplugin/mkd.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.2