On 22:26 Mon 12 Jan     , Bram Moolenaar wrote:
> 
> 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 -- b...@moolenaar.net -- 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?

Sure that's quite simple.

Best regards,
Marcin

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 3276abf..c36f407 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4686,8 +4686,7 @@ invalid_range(eap)
 		    return (char_u *)_(e_invrange);
 		break;
 	    case ADDR_WINDOWS:
-		if (eap->line1 < 1
-			|| eap->line2 > LAST_WIN_NR)
+		if (eap->line2 > LAST_WIN_NR)
 		    return (char_u *)_(e_invrange);
 		break;
 	    case ADDR_TABS:

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui