diff options
author | Utkarsh Maheshwari <utkarshme96@gmail.com> | 2018-06-06 02:59:11 +0530 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-12-31 12:44:21 +0100 |
commit | 01555de2da79eaf6e569e5e6ee7244dbf5f709e5 (patch) | |
tree | c4cf93ea7ff63b6282d6ab596d6a155a43f9596f /src/nvim/misc1.c | |
parent | f102f50ebeca98365b308463c25eb2caffffba51 (diff) | |
download | rneovim-01555de2da79eaf6e569e5e6ee7244dbf5f709e5.tar.gz rneovim-01555de2da79eaf6e569e5e6ee7244dbf5f709e5.tar.bz2 rneovim-01555de2da79eaf6e569e5e6ee7244dbf5f709e5.zip |
multigrid: Allow UIs to set grid size different from window size
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index ffe2d11f08..fb5586dea2 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,7 +1318,7 @@ 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); @@ -1340,7 +1340,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; } |