X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/c6a731c5fa00ad7a776b99d28d31617e7a7c3210..b4bdf54aa166b991fbd49bf4b3a4d7009e035414:/ftplugin/mkd.vim?ds=inline diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index d4113ad..63d7914 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -318,8 +318,7 @@ function! s:Markdown_Toc(...) else lopen endif - set modifiable - %s/\v^([^|]*\|){2,2} #// + setlocal modifiable for i in range(1, line('$')) " this is the location-list data for the current item let d = getloclist(0)[i-1] @@ -339,8 +338,8 @@ function! s:Markdown_Toc(...) endif call setline(i, repeat(' ', l:level). d.text) endfor - set nomodified - set nomodifiable + setlocal nomodified + setlocal nomodifiable normal! gg endfunction