Enno Nagel wrote: > Le lundi 12 janvier 2015 14:41:00 UTC+1, Bram Moolenaar a écrit : > > Enno Nagel wrote: > > > > > The command > > > > > > 0wincmd w > > > > > > throws an error in the latest Vim version: > > > > > > E16: Invalid range: 0wincmd w > > > > > > Before, it simply stayed in the same window. > > > Is this a new feature or a bug? > > > > There is no window with the number zero, so the error is correct. > > > > Is this breaking some plugin? > > > > -- > > hundred-and-one symptoms of being an internet addict: > > 74. Your most erotic dreams are about cybersex > > > > /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ > > /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ > > \\\ an exciting new programming language -- http://www.Zimbu.org /// > > \\\ help me help AIDS victims -- http://ICCF-Holland.org /// > > Well I have a plugin FastFold https://github.com/Konfekt/FastFold that > uses a WinDo command that restores the current and alternate window by > > let curaltwin = winnr('#') > let currwin=winnr() > execute 'windo ' . a:command > execute curaltwin . 'wincmd w' > execute currwin . 'wincmd w' > > This used to work fine even if there was no alternate window before, > but now there appear issue > (https://github.com/Konfekt/FastFold/issues/11 and > https://github.com/Konfekt/FastFold/issues/12) about > > :0wincmd w > > throwing an error. > > Perhaps it used to be that > > winnr('#') > > returned the current window number if there is no alternate window. > > It's easy to work around it though.
Well, I don't think there is a problem with recognizing zero as the current window number. It's not something that you accidentally type or would something bad that we need to prevent from happening. Marcin, can you make it work that way? -- Q: How many legs does a giraffe have? A: Eight: two in front, two behind, two on the left and two on the right /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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.
