Skip to content

Commit 3451470

Browse files
committed
Fixed MDEIndices
1 parent 731487c commit 3451470

File tree

3 files changed

+2
-5
lines changed

3 files changed

+2
-5
lines changed

after/ftplugin/markdown.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ b:markdown_extras_links = links.RefreshLinksDict()
1111

1212
# Convert links inline links [mylink](blabla) to referenced links [mylink][3]
1313
command! -buffer -nargs=0 MDEConvertLinks links.ConvertLinks()
14+
command! -buffer -nargs=0 MDEIndices indices.ShowIndices()
1415

1516
# Jump back to the previous file
1617
nnoremap <buffer> <backspace> <ScriptCmd>funcs.GoToPrevVisitedBuffer()<cr>

lib/indices.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def IndicesCallback(id: number, idx: number)
1414
enddef
1515

1616
export def ShowIndices()
17-
if !empty('g:markdown_extras_indices')
17+
if exists('g:markdown_extras_indices') != 0 && !empty('g:markdown_extras_indices')
1818
const popup_width = (&columns * 2) / 3
1919
const popup_height = min([len(g:markdown_extras_indices), &lines / 2])
2020
var opts = {

plugin/markdown_extras.vim

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ if exists('g:markdown_extras_loaded')
2626
endif
2727
g:markdown_extras_loaded = true
2828

29-
if exists('g:markdown_extras_indices')
30-
command! -buffer -nargs=0 MDEIndices indices.ShowIndices()
31-
endif
32-
3329
augroup MARKDOWN_EXTRAS_VISITED_BUFFER
3430
autocmd!
3531
autocmd BufEnter *.md funcs.AddVisitedBuffer()

0 commit comments

Comments
 (0)