X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/ea1da3bd284f6f54b5421b757264155cc0ad138a..ab8ecf0bc73a792c60ad7a8a303290ccf89aa4e5:/ftplugin/markdown.vim?ds=sidebyside diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index ef9cf59..21c9442 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -351,7 +351,7 @@ function! s:Toc(...) endif endif " keep track of the longest header size (heading level + title) - let l:total_len = stridx(l:line, ' ') + len(l:line) + let l:total_len = stridx(l:line, ' ') + strdisplaywidth(l:line) if l:total_len > l:header_max_len let l:header_max_len = l:total_len endif @@ -582,6 +582,9 @@ if !exists("*s:EditUrlUnderCursor") function s:EditUrlUnderCursor() let l:url = s:Markdown_GetUrlForPosition(line('.'), col('.')) if l:url != '' + if get(g:, 'vim_markdown_autowrite', 0) + write + endif if get(g:, 'vim_markdown_no_extensions_in_markdown', 0) execute 'edit' fnamemodify(expand('%:~'), ':p:h').'/'.l:url.'.md' else