Re: Problematic behavior caused by mapping in matchit plugin
Am 11.05.2017 um 18:52 schrieb Efraim Yawitz: Hi, The docs for the matchit plugin say that the mappings in it may cause strange behavior, but I think this example is worth noting. I was trying to do yV% on lines like this: #ifdef SOMETHING ... #endif //SOMETHING expecting to yank all the lines, but what I got was everything up to the comment, i.e., the last line had only the #endif. A new uninstalled vim (without plugins) did what I had expected originally. After some debugging, what I found was that in this mapping in matchit.vim: onoremap % v:call Match_wrapper('',1,'o') the 'v' in v: was changing the operator to forced characterwise after my 'V' had tried to force it to forced linewise. Doing ounmap % got the behavior I was looking for. I couldn't find yet in the help what v: is supposed to do, but what is significant is that the 'v' in that mapping is evidently being interpreted twice, once as a "force characterwise" signal, and again for what it 'really' means. I imagine this could cause problems in other plugins as well which use this construction. See :h o_v An Ex-command used in Omap-mode :... is an exclusive motion. With v:... it becomes inclusive. It think it's a bug in Vim that Vv:... is kind of undefined yet (at least this was case quite some time ago ...). -- Andy -- -- You received this message from the "vim_use" 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_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Problematic behavior caused by mapping in matchit plugin
On Do, 11 Mai 2017, Efraim Yawitz wrote: > Hi, > > The docs for the matchit plugin say that the mappings in it may cause strange > behavior, but I think this example is worth noting. > > I was trying to do yV% on lines like this: > > #ifdef SOMETHING > ... > #endif //SOMETHING > > expecting to yank all the lines, but what I got was everything up to the > comment, i.e., the last line had only the #endif. A new uninstalled vim > (without plugins) did what I had expected originally. > > After some debugging, what I found was that in this mapping in matchit.vim: > > onoremap % v:call Match_wrapper('',1,'o') > > the 'v' in v: was changing the operator to forced characterwise after my > 'V' had tried to force it to forced linewise. Doing ounmap % got the behavior > I was looking for. > > I couldn't find yet in the help what v: is supposed to do, but what is > significant is that the 'v' in that mapping is evidently being interpreted > twice, once as a "force characterwise" signal, and again for what it 'really' > means. I imagine this could cause problems in other plugins as well which use > this construction. I believe this is the same issue as the one mentioned in the neovim issue tracker: https://github.com/neovim/neovim/issues/5691 I have tried to contact Benji, but unfortunately, he did not react. Best, Christian -- Das Leben besteht in dem, was ein Mensch den ganzen Tag über denkt. -- Ralph Waldo Emerson -- -- You received this message from the "vim_use" 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_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Problematic behavior caused by mapping in matchit plugin
Hi, The docs for the matchit plugin say that the mappings in it may cause strange behavior, but I think this example is worth noting. I was trying to do yV% on lines like this: #ifdef SOMETHING ... #endif //SOMETHING expecting to yank all the lines, but what I got was everything up to the comment, i.e., the last line had only the #endif. A new uninstalled vim (without plugins) did what I had expected originally. After some debugging, what I found was that in this mapping in matchit.vim: onoremap % v:call Match_wrapper('',1,'o') the 'v' in v: was changing the operator to forced characterwise after my 'V' had tried to force it to forced linewise. Doing ounmap % got the behavior I was looking for. I couldn't find yet in the help what v: is supposed to do, but what is significant is that the 'v' in that mapping is evidently being interpreted twice, once as a "force characterwise" signal, and again for what it 'really' means. I imagine this could cause problems in other plugins as well which use this construction. Ephraim -- -- You received this message from the "vim_use" 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_use" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.