Dne pondělí, 12. května 2014 17:52:03 UTC+2 Christian Brabandt napsal(a):
> Am 2014-05-12 17:42, schrieb Vít Ondruch:
>
> > Dne pondělí, 12. května 2014 17:22:29 UTC+2 Christian Brabandt
>
> > napsal(a):
>
> >> Am 2014-05-12 17:10, schrieb Vít Ondruch:
>
> >>
>
> >> > Hi,
>
> >>
>
> >> >
>
> >>
>
> >> > Edditing .spec file, going into some file using "gt" and return back
>
> >>
>
> >> > by "b#", I always get this annoying error:
>
> >>
>
> >> >
>
> >>
>
> >> >> "ruby.spec" 1551L, 54263C
>
> >>
>
> >> >> Error detected while processing
>
> >>
>
> >> >> /usr/share/vim/vim74/ftplugin/spec.vim:
>
> >>
>
> >> >> line 20:
>
> >>
>
> >> >> E227: mapping already exists for ~@�SSpecChangelog
>
> >>
>
> >> >> Press ENTER or type command to continue
>
> >>
>
> >> >
>
> >>
>
> >> > (Yes, there are displayed some weird characters in front of
>
> >>
>
> >> > SSpecChangelog). I am currently using:
>
> >>
>
> >> >
>
> >>
>
> >> > $ rpm -q vim-enhanced
>
> >>
>
> >> > vim-enhanced-7.4.258-2.fc21.x86_64
>
> >>
>
> >> >
>
> >>
>
> >> > but I observe this bug for some while already, may be since 7.4? Not
>
> >>
>
> >> > sure.
>
> >>
>
> >> >
>
> >>
>
> >> > Any help appreciated.
>
> >>
>
> >>
>
> >>
>
> >> Looks like the specific vim ftplugin does not guard against renmapping
>
> >>
>
> >> the
>
> >>
>
> >> same sequence again.
>
> >
>
> > Yes, that was my first thought as well, but there is:
>
> >
>
> >
>
> > if !hasmapto("<Plug>SpecChangelog")
>
> > map <buffer> <LocalLeader>c <Plug>SpecChangelog
>
> > endif
>
> >
>
> >
>
> > which looks as a guard to me. But I'm not expert :)
>
>
>
> It does. But not the following line (which BTW, is exactly the line
>
> given
>
> in the error message):
>
>
>
> noremap <buffer> <unique> <script> <Plug>SpecChangelog :call
>
> <SID>SpecChangelog("")<CR>
>
>
>
> Note, the <unique>, which makes Vim throw an error.
>
Ahh, you are right indeed. Thanks! So here is the patch fixing the issue.
Adding Igor Gnatenko, the current maintainer into CC. Hopefully he can review.
Vít
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
# HG changeset patch
# User Vít Ondruch <[email protected]>
# Date 1399960843 -7200
# Tue May 13 08:00:43 2014 +0200
# Node ID b74748e0e2693a5c7ae67be57ca540d0bfc1e79b
# Parent 250a6b258f862f3b5bf9be74dae1cef80cd8c035
Add mapping guard to prevent "mapping already exists" error.
diff -r 250a6b258f86 -r b74748e0e269 runtime/ftplugin/spec.vim
--- a/runtime/ftplugin/spec.vim Wed Sep 19 16:59:31 2012 +0200
+++ b/runtime/ftplugin/spec.vim Tue May 13 08:00:43 2014 +0200
@@ -17,7 +17,9 @@
endif
endif
-noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
+if !hasmapto("call <SID>SpecChangelog(\"\")<CR>")
+ noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
+endif
if !exists("*s:SpecChangelog")
function s:SpecChangelog(format)