comparison src/ex_cmds2.c @ 22:cc049b00ee70

updated for version 7.0014
author vimboss
date Thu, 02 Sep 2004 19:12:26 +0000
parents 4ac1dce8dd5e
children ac33b7c03fac
comparison
equal deleted inserted replaced
21:db5102f7e29f 22:cc049b00ee70
1060 return str; 1060 return str;
1061 } 1061 }
1062 1062
1063 static int do_arglist __ARGS((char_u *str, int what, int after)); 1063 static int do_arglist __ARGS((char_u *str, int what, int after));
1064 static void alist_check_arg_idx __ARGS((void)); 1064 static void alist_check_arg_idx __ARGS((void));
1065 static int editing_arg_idx __ARGS((win_T *win));
1065 #ifdef FEAT_LISTCMDS 1066 #ifdef FEAT_LISTCMDS
1066 static int alist_add_list __ARGS((int count, char_u **files, int after)); 1067 static int alist_add_list __ARGS((int count, char_u **files, int after));
1067 #endif 1068 #endif
1068 #define AL_SET 1 1069 #define AL_SET 1
1069 #define AL_ADD 2 1070 #define AL_ADD 2
1219 check_arg_idx(curwin); 1220 check_arg_idx(curwin);
1220 #endif 1221 #endif
1221 } 1222 }
1222 1223
1223 /* 1224 /*
1224 * Check if window "win" is editing the w_arg_idx file in its argument list. 1225 * Return TRUE if window "win" is editing then file at the current argument
1225 */ 1226 * index.
1226 void 1227 */
1227 check_arg_idx(win) 1228 static int
1229 editing_arg_idx(win)
1228 win_T *win; 1230 win_T *win;
1229 { 1231 {
1230 if (WARGCOUNT(win) > 1 1232 return !(win->w_arg_idx >= WARGCOUNT(win)
1231 && (win->w_arg_idx >= WARGCOUNT(win)
1232 || (win->w_buffer->b_fnum 1233 || (win->w_buffer->b_fnum
1233 != WARGLIST(win)[win->w_arg_idx].ae_fnum 1234 != WARGLIST(win)[win->w_arg_idx].ae_fnum
1234 && (win->w_buffer->b_ffname == NULL 1235 && (win->w_buffer->b_ffname == NULL
1235 || !(fullpathcmp( 1236 || !(fullpathcmp(
1236 alist_name(&WARGLIST(win)[win->w_arg_idx]), 1237 alist_name(&WARGLIST(win)[win->w_arg_idx]),
1237 win->w_buffer->b_ffname, TRUE) & FPC_SAME))))) 1238 win->w_buffer->b_ffname, TRUE) & FPC_SAME))));
1239 }
1240
1241 /*
1242 * Check if window "win" is editing the w_arg_idx file in its argument list.
1243 */
1244 void
1245 check_arg_idx(win)
1246 win_T *win;
1247 {
1248 if (WARGCOUNT(win) > 1 && !editing_arg_idx(win))
1238 { 1249 {
1239 /* We are not editing the current entry in the argument list. 1250 /* We are not editing the current entry in the argument list.
1240 * Set "arg_had_last" if we are editing the last one. */ 1251 * Set "arg_had_last" if we are editing the last one. */
1241 win->w_arg_idx_invalid = TRUE; 1252 win->w_arg_idx_invalid = TRUE;
1242 if (win->w_arg_idx != WARGCOUNT(win) - 1 1253 if (win->w_arg_idx != WARGCOUNT(win) - 1
1660 /* go to argument "i" */ 1671 /* go to argument "i" */
1661 if (i == ARGCOUNT) 1672 if (i == ARGCOUNT)
1662 break; 1673 break;
1663 /* Don't call do_argfile() when already there, it will try 1674 /* Don't call do_argfile() when already there, it will try
1664 * reloading the file. */ 1675 * reloading the file. */
1665 if (curwin->w_arg_idx != i) 1676 if (curwin->w_arg_idx != i || !editing_arg_idx(curwin))
1666 do_argfile(eap, i); 1677 do_argfile(eap, i);
1667 if (curwin->w_arg_idx != i) 1678 if (curwin->w_arg_idx != i)
1668 break; 1679 break;
1669 ++i; 1680 ++i;
1670 } 1681 }