From f9d87fa6ba4b8026d089bf0fb755f6b0f7296408 Mon Sep 17 00:00:00 2001 From: ichizok Date: Sat, 5 Jul 2025 15:18:41 +0200 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 ...'`. closes: #17664 Signed-off-by: ichizok Signed-off-by: Christian Brabandt --- runtime/ftplugin/go.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/runtime/ftplugin/go.vim b/runtime/ftplugin/go.vim index e3f947c091..13291af9cb 100644 --- a/runtime/ftplugin/go.vim +++ b/runtime/ftplugin/go.vim @@ -7,6 +7,7 @@ " 2025 Mar 18 by Vim Project (use :term for 'keywordprg' #16911) " 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) " 2025 Jul 02 by Vim Project (add section movement mappings #17641) +" 2025 Jul 05 by Vim Project (update b:undo_ftplugin #17664) if exists('b:did_ftplugin') finish @@ -56,10 +57,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)