Skip to content

Commit f42c2fd

Browse files
authored
Merge pull request #32 from wsdjeg/master
Add blank line before toc
2 parents fa0f655 + 1f0dde0 commit f42c2fd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ftplugin/markdown.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,10 @@ function! s:GenToc(markdownStyle)
199199
endif
200200

201201
let l:i = 0
202+
" a black line before toc
203+
if !empty(l:headingLines)
204+
put =''
205+
endif
202206
for headingLine in l:headingLines
203207
let l:headingName = <SID>GetHeadingName(headingLine)
204208
let l:headingIndents = l:levels[i] - l:minLevel
@@ -274,7 +278,7 @@ function! s:UpdateToc()
274278

275279
if l:isFirstLine != 0
276280
call cursor(l:beginLineNumber, 1)
277-
normal! dd
281+
normal! "_dd
278282
endif
279283

280284
" fix line number to avoid shake

0 commit comments

Comments
 (0)