0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

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 ...'`.
This commit is contained in:
ichizok 2025-07-05 01:34:21 +09:00
parent a494ce1c64
commit c4b551e73d
No known key found for this signature in database
GPG Key ID: 296604951328A2FB

View File

@ -56,10 +56,10 @@ if !exists("no_plugin_maps") && !exists("no_go_maps")
noremap <silent> <buffer> [[ <Cmd>call <SID>GoFindSection('prev_start', v:count1)<CR>
noremap <silent> <buffer> [] <Cmd>call <SID>GoFindSection('prev_end', v:count1)<CR>
let b:undo_ftplugin .= ''
\ . '| unmap <buffer> ]]'
\ . '| unmap <buffer> ]['
\ . '| unmap <buffer> [['
\ . '| unmap <buffer> []'
\ . "| silent! exe 'unmap <buffer> ]]'"
\ . "| silent! exe 'unmap <buffer> ]['"
\ . "| silent! exe 'unmap <buffer> [['"
\ . "| silent! exe 'unmap <buffer> []'"
endif
function! <SID>GoFindSection(dir, count)