diff options
author | Wayne Rowcliffe <war1025@gmail.com> | 2014-08-10 22:56:58 -0500 |
---|---|---|
committer | Wayne Rowcliffe <war1025@gmail.com> | 2014-08-17 11:13:42 -0500 |
commit | 888a31ba454cf9c054527a26459c112593efa54b (patch) | |
tree | 973c974f9adde300fe405114cdc609746351d617 /src/nvim/mark.c | |
parent | 8cf45786b11c4c96444962227a960a3683d9f2b1 (diff) | |
download | rneovim-888a31ba454cf9c054527a26459c112593efa54b.tar.gz rneovim-888a31ba454cf9c054527a26459c112593efa54b.tar.bz2 rneovim-888a31ba454cf9c054527a26459c112593efa54b.zip |
FOR_ALL_BUFFERS use locally declared buffer pointer
Diffstat (limited to 'src/nvim/mark.c')
-rw-r--r-- | src/nvim/mark.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nvim/mark.c b/src/nvim/mark.c index 057c524e11..43469cab45 100644 --- a/src/nvim/mark.c +++ b/src/nvim/mark.c @@ -1337,7 +1337,6 @@ int removable(char_u *name) int write_viminfo_marks(FILE *fp_out) { int count; - buf_T *buf; int is_mark_set; int i; win_T *win; @@ -1346,8 +1345,9 @@ int write_viminfo_marks(FILE *fp_out) /* * Set b_last_cursor for the all buffers that have a window. */ - FOR_ALL_TAB_WINDOWS(tp, win) - set_last_cursor(win); + FOR_ALL_TAB_WINDOWS(tp, win) { + set_last_cursor(win); + } fputs(_("\n# History of marks within files (newest to oldest):\n"), fp_out); count = 0; @@ -1467,11 +1467,14 @@ void copy_viminfo_marks(vir_T *virp, FILE *fp_out, int count, int eof, int flags } } else { /* fp_out != NULL */ /* This is slow if there are many buffers!! */ - FOR_ALL_BUFFERS(buf) { - if (buf->b_ffname != NULL) { - home_replace(NULL, buf->b_ffname, name_buf, LSIZE, TRUE); - if (fnamecmp(str, name_buf) == 0) + buf = NULL; + FOR_ALL_BUFFERS(bp) { + if (bp->b_ffname != NULL) { + home_replace(NULL, bp->b_ffname, name_buf, LSIZE, TRUE); + if (fnamecmp(str, name_buf) == 0) { + buf = bp; break; + } } } |