diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-05-27 19:29:42 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-10 17:24:29 +0800 |
commit | f7d6f472f7a2024a2de4f9ed785395196afa7c32 (patch) | |
tree | 93540c31fe395e1667791a4b9174ead1e92fa41f | |
parent | 2966cfe21f8e19f684caf8e9253f40dad107f5ba (diff) | |
download | rneovim-f7d6f472f7a2024a2de4f9ed785395196afa7c32.tar.gz rneovim-f7d6f472f7a2024a2de4f9ed785395196afa7c32.tar.bz2 rneovim-f7d6f472f7a2024a2de4f9ed785395196afa7c32.zip |
fix(float): fix float window border drawing with winbar
-rw-r--r-- | src/nvim/screen.c | 2 | ||||
-rw-r--r-- | test/functional/ui/float_spec.lua | 46 |
2 files changed, 47 insertions, 1 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 03d7cb1783..3d69d317fd 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5493,7 +5493,7 @@ static void win_redr_border(win_T *wp) int *attrs = wp->w_float_config.border_attr; int *adj = wp->w_border_adj; - int irow = wp->w_height_inner, icol = wp->w_width_inner; + int irow = wp->w_height_inner + wp->w_winbar_height, icol = wp->w_width_inner; if (adj[0]) { grid_puts_line_start(grid, 0); diff --git a/test/functional/ui/float_spec.lua b/test/functional/ui/float_spec.lua index fdd1504b13..c5e5a3fd8f 100644 --- a/test/functional/ui/float_spec.lua +++ b/test/functional/ui/float_spec.lua @@ -7895,6 +7895,52 @@ describe('float window', function() | ]]} end + + -- add a border + meths.win_set_config(win1, {relative='editor', width=15, height=3, row=0, col=4, border = 'single'}) + + if multigrid then + screen:expect{grid=[[ + ## grid 1 + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [2:----------------------------------------]| + [3:----------------------------------------]| + ## grid 2 + ^ | + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + {0:~ }| + ## grid 3 + | + ## grid 4 + {5:┌───────────────┐}| + {5:│}{3:floaty bar }{5:│}| + {5:│}{1: }{5:│}| + {5:│}{2:~ }{5:│}| + {5:└───────────────┘}| + ]], float_pos={ + [4] = {{id = 1001}, "NW", 1, 0, 4, true, 50}; + }, win_viewport={ + [2] = {win = {id = 1000}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1}; + [4] = {win = {id = 1001}, topline = 0, botline = 2, curline = 0, curcol = 0, linecount = 1}; + }} + else + screen:expect{grid=[[ + ^ {5:┌───────────────┐} | + {0:~ }{5:│}{3:floaty bar }{5:│}{0: }| + {0:~ }{5:│}{1: }{5:│}{0: }| + {0:~ }{5:│}{2:~ }{5:│}{0: }| + {0:~ }{5:└───────────────┘}{0: }| + {0:~ }| + | + ]]} + end end) end |