X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/b1cd4c66cda8e73171086d79be11cd3894806766..f3edf871989e4c9763fb8f205671d87608790f04:/ftplugin/markdown.vim?ds=inline diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index c12862a..c43b0bd 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -308,7 +308,7 @@ function! s:Toc(...) let l:front_matter = 0 let l:header_list = [] let l:header_max_len = 0 - let g:vim_markdown_toc_autofit = get(g:, "vim_markdown_toc_autofit", 0) + let l:vim_markdown_toc_autofit = get(g:, "vim_markdown_toc_autofit", 0) let l:vim_markdown_frontmatter = get(g:, "vim_markdown_frontmatter", 0) for i in range(1, line('$')) let l:lineraw = getline(i) @@ -358,7 +358,7 @@ function! s:Toc(...) elseif l:window_type ==# 'vertical' vertical lopen " auto-fit toc window when possible to shrink it - if (&columns/2) > l:header_max_len && g:vim_markdown_toc_autofit == 1 + if (&columns/2) > l:header_max_len && l:vim_markdown_toc_autofit == 1 execute 'vertical resize ' . (l:header_max_len + 1) else execute 'vertical resize ' . (&columns/2)