diff options
-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") |