diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-28 10:53:03 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-10 17:24:29 +0800 |
commit | 63f63dd2b7e06f872727d1d9d14ce177dc77ef83 (patch) | |
tree | 16eec2b31b04e1251084e85f7e5a1a5812e33e10 | |
parent | 99e829871173552374822ed922b785f0195f191c (diff) | |
download | rneovim-63f63dd2b7e06f872727d1d9d14ce177dc77ef83.tar.gz rneovim-63f63dd2b7e06f872727d1d9d14ce177dc77ef83.tar.bz2 rneovim-63f63dd2b7e06f872727d1d9d14ce177dc77ef83.zip |
fix(float): fix glitch when making float window with border a split
-rw-r--r-- | src/nvim/window.c | 3 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 72 |
2 files changed, 74 insertions, 1 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index 6a80142c57..ca99cc8cbc 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -1266,8 +1266,9 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir) } else if (wp->w_floating) { new_frame(wp); wp->w_floating = false; - // non-floating window doesn't store float config. + // non-floating window doesn't store float config or have a border. wp->w_float_config = FLOAT_CONFIG_INIT; + memset(wp->w_border_adj, 0, sizeof(wp->w_border_adj)); } /* diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index 71bdd2d830..1fb8a2c498 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -6261,6 +6261,78 @@ describe('float window', function() end end) + it('J (float with border)', function() + meths.win_set_config(win, {relative='editor', width=20, height=2, row=2, col=5, border='single'}) + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [3:----------------------------------------]| + ## grid 2 + ^x | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ## grid 3 + | + ## grid 4 + {5:┌────────────────────┐}| + {5:│}{1:y }{5:│}| + {5:│}{2:~ }{5:│}| + {5:└────────────────────┘}| + ]], float_pos=expected_pos} + else + screen:expect([[ + ^x | + {0:~ }| + {0:~ }{5:┌────────────────────┐}{0: }| + {0:~ }{5:│}{1:y }{5:│}{0: }| + {0:~ }{5:│}{2:~ }{5:│}{0: }| + {0:~ }{5:└────────────────────┘}{0: }| + | + ]]) + end + + feed("<c-w>w<c-w>J") + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:----------------------------------------]| + [2:----------------------------------------]| + {5:[No Name] [+] }| + [4:----------------------------------------]| + [4:----------------------------------------]| + {4:[No Name] [+] }| + [3:----------------------------------------]| + ## grid 2 + x | + {0:~ }| + ## grid 3 + | + ## grid 4 + ^y | + {0:~ }| + ]]} + else + screen:expect([[ + x | + {0:~ }| + {5:[No Name] [+] }| + ^y | + {0:~ }| + {4:[No Name] [+] }| + | + ]]) + end + end) + it('movements with nested split layout', function() command("set hidden") feed("<c-w>s<c-w>v<c-w>b<c-w>v") |