From: Hiroshi Shirosaki Date: Wed, 16 Mar 2016 02:05:06 +0000 (+0900) Subject: Set emtpy to loclist if :Toc returns no headers X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/899ef40d3c84192e3c6c0b512a40d9e42a8bb3dd?ds=sidebyside;hp=5bbe12bb8446f3cb83dfdcc9626c3149b06e571d Set emtpy to loclist if :Toc returns no headers --- diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index 5db57d8..c2fff46 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -357,11 +357,11 @@ function! s:Toc(...) endif endif endfor + call setloclist(0, l:header_list) if len(l:header_list) == 0 echom "Toc: No headers." return endif - call setloclist(0, l:header_list) if l:window_type ==# 'horizontal' lopen