aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/misc1.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-12-31 17:37:50 +0100
committerGitHub <noreply@github.com>2018-12-31 17:37:50 +0100
commit6427894d891100c0a41f569ecde65bfdce2ea00c (patch)
treec34bef18907b53dc98e0009ff69a799440080384 /src/nvim/misc1.c
parentccbcd390d42d33a15f15c29fab5d6076a6d3ac08 (diff)
parentc72d9ce0a602ba53b99145f64f0d43327a4e3eb3 (diff)
downloadrneovim-6427894d891100c0a41f569ecde65bfdce2ea00c.tar.gz
rneovim-6427894d891100c0a41f569ecde65bfdce2ea00c.tar.bz2
rneovim-6427894d891100c0a41f569ecde65bfdce2ea00c.zip
Merge pull request #8455 from UtkarshMe/grid-split
implement ext_multigrid: draw each window on a separate resizable grid.
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r--src/nvim/misc1.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index ffe2d11f08..5f76458275 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -1251,7 +1251,7 @@ int plines_win_nofill(
return 1;
}
- if (wp->w_width == 0) {
+ if (wp->w_grid.Columns == 0) {
return 1;
}
@@ -1261,8 +1261,8 @@ int plines_win_nofill(
}
const int lines = plines_win_nofold(wp, lnum);
- if (winheight && lines > wp->w_height) {
- return wp->w_height;
+ if (winheight && lines > wp->w_grid.Rows) {
+ return wp->w_grid.Rows;
}
return lines;
}
@@ -1292,7 +1292,7 @@ int plines_win_nofold(win_T *wp, linenr_T lnum)
/*
* Add column offset for 'number', 'relativenumber' and 'foldcolumn'.
*/
- width = wp->w_width - win_col_off(wp);
+ width = wp->w_grid.Columns - win_col_off(wp);
if (width <= 0 || col > 32000) {
return 32000; // bigger than the number of screen columns
}
@@ -1318,8 +1318,9 @@ int plines_win_col(win_T *wp, linenr_T lnum, long column)
if (!wp->w_p_wrap)
return lines + 1;
- if (wp->w_width == 0)
+ if (wp->w_grid.Columns == 0) {
return lines + 1;
+ }
char_u *line = ml_get_buf(wp->w_buffer, lnum, false);
char_u *s = line;
@@ -1340,7 +1341,7 @@ int plines_win_col(win_T *wp, linenr_T lnum, long column)
}
// Add column offset for 'number', 'relativenumber', 'foldcolumn', etc.
- int width = wp->w_width - win_col_off(wp);
+ int width = wp->w_grid.Columns - win_col_off(wp);
if (width <= 0) {
return 9999;
}