diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-06-04 18:49:36 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-06-04 18:49:36 +0200 |
commit | 888ccac8902cee186fbd47e971881f6d9b19c068 (patch) | |
tree | d7180b8cc4b4ecfea5880e3f2971742a9689dae8 /src/eval.c | |
parent | 511972d810ea490955161ff5097ec2f57919ceaf (diff) |
patch 7.4.1895v7.4.1895
Problem: Cannot use a window ID where a window number is expected.
Solution: Add LOWEST_WIN_ID, so that the window ID can be used where a
number is expected.
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/eval.c b/src/eval.c index 2a7a0906f9..4825e8be8a 100644 --- a/src/eval.c +++ b/src/eval.c @@ -13566,11 +13566,18 @@ find_win_by_nr( for (wp = (tp == NULL || tp == curtab) ? firstwin : tp->tp_firstwin; wp != NULL; wp = wp->w_next) - if (--nr <= 0) + if (nr >= LOWEST_WIN_ID) + { + if (wp->w_id == nr) + return wp; + } + else if (--nr <= 0) break; + if (nr >= LOWEST_WIN_ID) + return NULL; return wp; #else - if (nr == 0 || nr == 1) + if (nr == 0 || nr == 1 || nr == curwin->w_id) return curwin; return NULL; #endif |