diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-10-03 08:36:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-02 17:36:24 -0700 |
commit | b3e815094bad6c28b758bc7538bf1b13936660fc (patch) | |
tree | 5fcbc50b6b1d8d0b7ec31cde94031914cc676b01 /src/nvim/window.c | |
parent | c5e8c39102afb29213c5f4ead91d08123f19e7a9 (diff) | |
download | rneovim-b3e815094bad6c28b758bc7538bf1b13936660fc.tar.gz rneovim-b3e815094bad6c28b758bc7538bf1b13936660fc.tar.bz2 rneovim-b3e815094bad6c28b758bc7538bf1b13936660fc.zip |
fix(float)!: always anchor to corner of window including border #15832
N, W, S, E are all inclusive, i.e., always anchor to the exact corner of the
window (including border). This line may also need change in this case (change
0 to -1):
This is most consistent and easiest to reason about, especially with GUIs whose
border do not need to have width/height of 1/1 in cell units.
Fix #15789
Diffstat (limited to 'src/nvim/window.c')
-rw-r--r-- | src/nvim/window.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/window.c b/src/nvim/window.c index c0f537aab3..ff97eaa757 100644 --- a/src/nvim/window.c +++ b/src/nvim/window.c @@ -853,12 +853,12 @@ void ui_ext_win_position(win_T *wp) bool east = c.anchor & kFloatAnchorEast; bool south = c.anchor & kFloatAnchorSouth; - int comp_row = (int)row - (south ? wp->w_height : 0); - int comp_col = (int)col - (east ? wp->w_width : 0); + int comp_row = (int)row - (south ? wp->w_height_outer : 0); + int comp_col = (int)col - (east ? wp->w_width_outer : 0); comp_row += grid->comp_row; comp_col += grid->comp_col; - comp_row = MAX(MIN(comp_row, Rows-wp->w_height_outer-1), 0); - comp_col = MAX(MIN(comp_col, Columns-wp->w_width_outer), 0); + comp_row = MAX(MIN(comp_row, Rows - wp->w_height_outer - 1), 0); + comp_col = MAX(MIN(comp_col, Columns - wp->w_width_outer), 0); wp->w_winrow = comp_row; wp->w_wincol = comp_col; bool valid = (wp->w_redr_type == 0); |