From c4b551e73d15390bc7a112b1aa2f7397dea4e04b Mon Sep 17 00:00:00 2001 From: ichizok Date: Sat, 5 Jul 2025 01:34:21 +0900 Subject: [PATCH] runtime(go): fix `b:undo_ftplugin` last `unmap` can cause the error "E31: No such mapping" when `doaudocmd FileType go` if appending other commands to `b:undo_ftplugin` i.e. the space and the next bar as `let b:undo_ftplugin .= ' | setl ...'`. --- runtime/ftplugin/go.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim index e3f947c091..d174fd7182 100644 --- a/runtime/ftplugin/go.vim +++ b/runtime/ftplugin/go.vim @@ -56,10 +56,10 @@ if !exists("no_plugin_maps") && !exists("no_go_maps") noremap [[ call GoFindSection('prev_start', v:count1) noremap [] call GoFindSection('prev_end', v:count1) let b:undo_ftplugin .= '' - \ . '| unmap ]]' - \ . '| unmap ][' - \ . '| unmap [[' - \ . '| unmap []' + \ . "| silent! exe 'unmap ]]'" + \ . "| silent! exe 'unmap ]['" + \ . "| silent! exe 'unmap [['" + \ . "| silent! exe 'unmap []'" endif function! GoFindSection(dir, count)