Merge pull request #1024 from war1025/dev/for_all_buffers

Add FOR_ALL_BUFFERS helper
This commit is contained in:
Justin M. Keyes
2014-08-19 23:49:25 -04:00
16 changed files with 145 additions and 131 deletions

View File

@@ -4345,11 +4345,10 @@ static int make_bom(char_u *buf, char_u *name)
void shorten_fnames(int force)
{
char_u dirname[MAXPATHL];
buf_T *buf;
char_u *p;
os_dirname(dirname, MAXPATHL);
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
FOR_ALL_BUFFERS(buf) {
if (buf->b_fname != NULL
&& !bt_nofile(buf)
&& !path_with_url(buf->b_fname)
@@ -6109,7 +6108,6 @@ void ex_doautoall(exarg_T *eap)
{
int retval;
aco_save_T aco;
buf_T *buf;
char_u *arg = eap->arg;
int call_do_modelines = check_nomodeline(&arg);
@@ -6120,7 +6118,7 @@ void ex_doautoall(exarg_T *eap)
* gives problems when the autocommands make changes to the list of
* buffers or windows...
*/
for (buf = firstbuf; buf != NULL; buf = buf->b_next) {
FOR_ALL_BUFFERS(buf) {
if (buf->b_ml.ml_mfp != NULL) {
/* find a window for this buffer and save some values */
aucmd_prepbuf(&aco, buf);