diff options
author | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2023-08-25 10:53:35 +0300 |
---|---|---|
committer | Evgeni Chasnovski <evgeni.chasnovski@gmail.com> | 2023-08-26 19:37:43 +0300 |
commit | 35570e4a11bef061777d741929f74fa66ba3f45a (patch) | |
tree | ef0a8587fa7f7cb30ca8241dae5b2d2cb6d72fc3 /src/nvim/drawscreen.c | |
parent | 617fd5bdc6ab9a82bfc6136f549fc31dcf442ed7 (diff) | |
download | rneovim-35570e4a11bef061777d741929f74fa66ba3f45a.tar.gz rneovim-35570e4a11bef061777d741929f74fa66ba3f45a.tar.bz2 rneovim-35570e4a11bef061777d741929f74fa66ba3f45a.zip |
feat(float): implement footer
Problem: Now way to show text at the bottom part of floating window
border (a.k.a. "footer").
Solution: Allows `footer` and `footer_pos` config fields similar to
`title` and `title_pos`.
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r-- | src/nvim/drawscreen.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index 4b23a9f1eb..f71a47a596 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -782,10 +782,17 @@ static void win_redr_border(win_T *wp) if (adj[3]) { grid_put_schar(grid, irow + adj[0], 0, chars[6], attrs[6]); } + for (int i = 0; i < icol; i++) { int ic = (i == 0 && !adj[3] && chars[6][0]) ? 6 : 5; grid_put_schar(grid, irow + adj[0], i + adj[3], chars[ic], attrs[ic]); } + + if (wp->w_float_config.footer) { + int footer_col = win_get_bordertext_col(icol, wp->w_float_config.footer_width, + wp->w_float_config.footer_pos); + win_redr_bordertext(wp, grid, wp->w_float_config.footer_chunks, grid->rows - 1, footer_col); + } if (adj[1]) { grid_put_schar(grid, irow + adj[0], icol + adj[3], chars[4], attrs[4]); } |