diff options
author | Marco Hinz <mh.codebro@gmail.com> | 2019-04-11 20:20:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-11 20:20:17 +0200 |
commit | ae88e4656305f1f760b4aa2a0f29bfc11d6d80b6 (patch) | |
tree | e1ea7deebeae5849c72a13a5d418259f523d2270 /test/functional/ui/float_spec.lua | |
parent | b358054694765b595ff3ef64a5b0bba98628c218 (diff) | |
download | rneovim-ae88e4656305f1f760b4aa2a0f29bfc11d6d80b6.tar.gz rneovim-ae88e4656305f1f760b4aa2a0f29bfc11d6d80b6.tar.bz2 rneovim-ae88e4656305f1f760b4aa2a0f29bfc11d6d80b6.zip |
float: always change to valid windows (#9878)
Using `:wincmd j` and friends doesn't make much sense to a floating window. For
convenience though, any direction will simply change to the previous window.
Make sure the previous window is valid, not the current window, and not another
floating window. Change to the first window (which is never a floating window)
otherwise.
Diffstat (limited to 'test/functional/ui/float_spec.lua')
-rw-r--r-- | test/functional/ui/float_spec.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index b248bd8f6f..aa304c11bb 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -37,6 +37,20 @@ describe('floating windows', function() [17] = {background = Screen.colors.Yellow}, } + it('behavior', function() + -- Create three windows and test that ":wincmd <direction>" changes to the + -- first window, if the previous window is invalid. + command('split') + meths.open_win(0, true, {width=10, height=10, relative='editor', row=0, col=0}) + eq(1002, funcs.win_getid()) + eq('editor', meths.win_get_config(1002).relative) + command([[ + call nvim_win_close(1001, v:false) + wincmd j + ]]) + eq(1000, funcs.win_getid()) + end) + local function with_ext_multigrid(multigrid) local screen before_each(function() |