diff --git a/autoload/vimwiki/base.vim b/autoload/vimwiki/base.vim index 2f8aa52..929928e 100644 --- a/autoload/vimwiki/base.vim +++ b/autoload/vimwiki/base.vim @@ -1986,7 +1986,7 @@ function! s:normalize_link_syntax_v() endif " Put substitution in register " and change text - call setreg('"', sub, 'v') + call setreg('"', substitute(sub, '\n', '', ''), visualmode()) normal! `>""pgvd finally call setreg('"', default_register_save, registertype_save) @@ -2002,8 +2002,8 @@ function! vimwiki#base#normalize_link(is_visual_mode) else if !a:is_visual_mode call s:normalize_link_syntax_n() - elseif visualmode() ==# 'v' && line("'<") == line("'>") - " action undefined for 'line-wise' or 'multi-line' visual mode selections + elseif line("'<") == line("'>") + " action undefined for multi-line visual mode selections call s:normalize_link_syntax_v() endif endif diff --git a/autoload/vimwiki/markdown_base.vim b/autoload/vimwiki/markdown_base.vim index 6468c75..f1ce091 100644 --- a/autoload/vimwiki/markdown_base.vim +++ b/autoload/vimwiki/markdown_base.vim @@ -122,7 +122,7 @@ function! s:normalize_link_syntax_v() \ '__LinkUrl__', visual_selection, '') let link = s:safesubstitute(link, '__LinkDescription__', visual_selection, '') - call setreg('"', link, 'v') + call setreg('"', substitute(link, '\n', '', ''), visualmode()) " paste result norm! `>""pgvd @@ -141,8 +141,8 @@ function! vimwiki#markdown_base#normalize_link(is_visual_mode) else if !a:is_visual_mode call s:normalize_link_syntax_n() - elseif visualmode() ==# 'v' && line("'<") == line("'>") - " action undefined for 'line-wise' or 'multi-line' visual mode selections + elseif line("'<") == line("'>") + " action undefined for multi-line visual mode selections call s:normalize_link_syntax_v() endif endif