From: Ciro Santilli Date: Sat, 21 Feb 2015 10:24:22 +0000 (+0100) Subject: Merge pull request #170 from sim590/fix-toc-nomodifiable X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/fe1eae8a04545e915bd15d6b0018431aa7ccafe5?hp=091091fdf8f1f7f42bf1a183eab100f923928841 Merge pull request #170 from sim590/fix-toc-nomodifiable Prevent setting other buffers to nomodifiable. Fix #169 --- diff --git a/ftplugin/mkd.vim b/ftplugin/mkd.vim index 312c2a4..63d7914 100644 --- a/ftplugin/mkd.vim +++ b/ftplugin/mkd.vim @@ -318,7 +318,7 @@ function! s:Markdown_Toc(...) else lopen endif - set modifiable + setlocal modifiable for i in range(1, line('$')) " this is the location-list data for the current item let d = getloclist(0)[i-1] @@ -338,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