vim-patch:7.4.568

Problem:    Giving an error for ":0wincmd w" is a problem for some
            plugins.
Solution:   Allow the zero in the range. (Marcin Szamotulski)

https://code.google.com/p/vim/source/detail?r=v7-4-568
This commit is contained in:
Felipe Morales
2015-01-20 01:17:37 -03:00
parent ff70129d96
commit e42b00dc3b
3 changed files with 10 additions and 9 deletions

View File

@@ -3574,11 +3574,11 @@ static char_u *invalid_range(exarg_T *eap)
}
if (eap->argt & RANGE) {
switch (eap->addr_type) {
switch(eap->addr_type) {
case ADDR_LINES:
if (!(eap->argt & NOTADR) &&
eap->line2 >
curbuf->b_ml.ml_line_count + (eap->cmdidx == CMD_diffget)) {
if (!(eap->argt & NOTADR)
&& eap->line2 > curbuf->b_ml.ml_line_count
+ (eap->cmdidx == CMD_diffget)) {
return (char_u *)_(e_invrange);
}
break;
@@ -3588,11 +3588,12 @@ static char_u *invalid_range(exarg_T *eap)
}
break;
case ADDR_BUFFERS:
if (eap->line1 < firstbuf->b_fnum || eap->line2 > lastbuf->b_fnum) {
if (eap->line1 < firstbuf->b_fnum
|| eap->line2 > lastbuf->b_fnum) {
return (char_u *)_(e_invrange);
}
break;
case ADDR_LOADED_BUFFERS:
case ADDR_LOADED_BUFFERS:
buf = firstbuf;
while (buf->b_ml.ml_mfp == NULL) {
if (buf->b_next == NULL) {