aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-08-19 23:49:25 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-08-19 23:49:25 -0400
commite1c330a486c184152cb48d637c6d04caba5290bd (patch)
treeb2379cae30ea446456681d1dc62d80ef95345f69 /src/nvim/fileio.c
parent0b7bff5bb71ddc2e9c41863ec41b9aea74d0fe75 (diff)
parent888a31ba454cf9c054527a26459c112593efa54b (diff)
downloadrneovim-e1c330a486c184152cb48d637c6d04caba5290bd.tar.gz
rneovim-e1c330a486c184152cb48d637c6d04caba5290bd.tar.bz2
rneovim-e1c330a486c184152cb48d637c6d04caba5290bd.zip
Merge pull request #1024 from war1025/dev/for_all_buffers
Add FOR_ALL_BUFFERS helper
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index e1f9454b52..2e932e9695 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -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);