From 50bd8297e67814b3ddbf0f274314fd2d321f63b6 Mon Sep 17 00:00:00 2001 From: Jurica Bradaric Date: Sat, 27 Aug 2016 17:57:05 +0200 Subject: vim-patch:7.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. https://github.com/vim/vim/commit/888ccac8902cee186fbd47e971881f6d9b19c068 --- src/nvim/eval.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 2c09dcd420..f077458c9b 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10268,7 +10268,11 @@ find_win_by_nr ( } FOR_ALL_WINDOWS_IN_TAB(wp, tp) { - if (--nr <= 0) { + if (nr >= LOWEST_WIN_ID) { + if (wp->handle == nr) { + return wp; + } + } else if (--nr <= 0) { return wp; } } -- cgit