aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mark.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-09-08 20:50:44 -0400
committerJustin M. Keyes <justinkz@gmail.com>2014-09-08 20:50:44 -0400
commit9fa467a9b227243c9c534ae0df1bdaf8235551a0 (patch)
tree85449173705a443081b1189a9d1087df74030703 /src/nvim/mark.c
parent3f5482d3251b3bbdc7c4df8a8e64eb3af7e5922c (diff)
parentac0b9714edbb7697b8324f922024401baea8953b (diff)
downloadrneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.tar.gz
rneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.tar.bz2
rneovim-9fa467a9b227243c9c534ae0df1bdaf8235551a0.zip
Merge pull request #1096 from war1025/dev/local_for_all_windows
Convert FOR_ALL_WINDOWS to use a locally declared pointer
Diffstat (limited to 'src/nvim/mark.c')
-rw-r--r--src/nvim/mark.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index 43469cab45..6339cf8275 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -500,7 +500,6 @@ void fmarks_check_names(buf_T *buf)
{
char_u *name;
int i;
- win_T *wp;
if (buf->b_ffname == NULL)
return;
@@ -512,10 +511,10 @@ void fmarks_check_names(buf_T *buf)
for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
fmarks_check_one(&namedfm[i], name, buf);
- FOR_ALL_WINDOWS(wp)
- {
- for (i = 0; i < wp->w_jumplistlen; ++i)
+ FOR_ALL_WINDOWS(wp) {
+ for (i = 0; i < wp->w_jumplistlen; ++i) {
fmarks_check_one(&wp->w_jumplist[i], name, buf);
+ }
}
free(name);
@@ -1042,7 +1041,6 @@ void mark_col_adjust(linenr_T lnum, colnr_T mincol, long lnum_amount, long col_a
{
int i;
int fnum = curbuf->b_fnum;
- win_T *win;
pos_T *posp;
if ((col_amount == 0L && lnum_amount == 0L) || cmdmod.lockmarks)
@@ -1085,22 +1083,26 @@ void mark_col_adjust(linenr_T lnum, colnr_T mincol, long lnum_amount, long col_a
/*
* Adjust items in all windows related to the current buffer.
*/
- FOR_ALL_WINDOWS(win)
- {
+ FOR_ALL_WINDOWS(win) {
/* marks in the jumplist */
- for (i = 0; i < win->w_jumplistlen; ++i)
- if (win->w_jumplist[i].fmark.fnum == fnum)
+ for (i = 0; i < win->w_jumplistlen; ++i) {
+ if (win->w_jumplist[i].fmark.fnum == fnum) {
col_adjust(&(win->w_jumplist[i].fmark.mark));
+ }
+ }
if (win->w_buffer == curbuf) {
/* marks in the tag stack */
- for (i = 0; i < win->w_tagstacklen; i++)
- if (win->w_tagstack[i].fmark.fnum == fnum)
+ for (i = 0; i < win->w_tagstacklen; i++) {
+ if (win->w_tagstack[i].fmark.fnum == fnum) {
col_adjust(&(win->w_tagstack[i].fmark.mark));
+ }
+ }
/* cursor position for other windows with the same buffer */
- if (win != curwin)
+ if (win != curwin) {
col_adjust(&win->w_cursor);
+ }
}
}
}
@@ -1526,10 +1528,7 @@ void copy_viminfo_marks(vir_T *virp, FILE *fp_out, int count, int eof, int flags
fputs((char *)line, fp_out);
}
if (load_marks) {
- win_T *wp;
-
- FOR_ALL_WINDOWS(wp)
- {
+ FOR_ALL_WINDOWS(wp) {
if (wp->w_buffer == curbuf)
wp->w_changelistidx = curbuf->b_changelistlen;
}