diff --git a/plugin/magit.vim b/plugin/magit.vim index 46845ac25e49b29347cafb40078617777aea0c3b..7b2e7754ad03e2c696d39f903115e3cd5f322382 100644 --- a/plugin/magit.vim +++ b/plugin/magit.vim @@ -964,7 +964,13 @@ function! magit#stage_block(selection, discard) abort " find current hunk position in file matching against current selection " header - let hunk_id = match(map(deepcopy(file.get_hunks()), 'v:val.header'), escape(a:selection[0], '*')) + try + let hunk_id = match(map(deepcopy(file.get_hunks()), 'v:val.header'), escape(a:selection[0], '~*')) + catch /^Vim\%((\a\+)\)\=:E874/ + echoerr "Escape issue with '" . a:selection[0] ."'" + return + endtry + if ( a:discard == 0 ) if ( section == 'unstaged' )