diff options
author | Utkarsh Maheshwari <utkarshme96@gmail.com> | 2018-05-19 21:03:17 +0530 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2018-12-31 12:44:21 +0100 |
commit | f102f50ebeca98365b308463c25eb2caffffba51 (patch) | |
tree | 1521fac8bc7ca1bde148f4839bc3bf4e062edcb3 /src/nvim/edit.c | |
parent | c9b559a0308714ef8ad396eb340a4af580e44d74 (diff) | |
download | rneovim-f102f50ebeca98365b308463c25eb2caffffba51.tar.gz rneovim-f102f50ebeca98365b308463c25eb2caffffba51.tar.bz2 rneovim-f102f50ebeca98365b308463c25eb2caffffba51.zip |
multigrid: Change screen_* functions to grid_* functions
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index c04190eaba..14577d5abb 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -560,7 +560,7 @@ static int insert_check(VimState *state) if (curwin->w_wcol < s->mincol - curbuf->b_p_ts && curwin->w_wrow == curwin->w_winrow - + curwin->w_height - 1 - p_so + + curwin->w_grid.Rows - 1 - p_so && (curwin->w_cursor.lnum != curwin->w_topline || curwin->w_topfill > 0)) { if (curwin->w_topfill > 0) { @@ -1502,17 +1502,17 @@ void edit_putchar(int c, int highlight) } else { attr = 0; } - pc_row = curwin->w_winrow + curwin->w_wrow; - pc_col = curwin->w_wincol; + pc_row = curwin->w_wrow; + pc_col = 0; pc_status = PC_STATUS_UNSET; if (curwin->w_p_rl) { - pc_col += curwin->w_width - 1 - curwin->w_wcol; + pc_col += curwin->w_grid.Columns - 1 - curwin->w_wcol; if (has_mbyte) { int fix_col = mb_fix_col(pc_col, pc_row); if (fix_col != pc_col) { - screen_putchar(' ', pc_row, fix_col, attr); - --curwin->w_wcol; + grid_putchar(&curwin->w_grid, ' ', pc_row, fix_col, attr); + curwin->w_wcol--; pc_status = PC_STATUS_RIGHT; } } @@ -1524,10 +1524,10 @@ void edit_putchar(int c, int highlight) /* save the character to be able to put it back */ if (pc_status == PC_STATUS_UNSET) { - screen_getbytes(pc_row, pc_col, pc_bytes, &pc_attr); + grid_getbytes(&curwin->w_grid, pc_row, pc_col, pc_bytes, &pc_attr); pc_status = PC_STATUS_SET; } - screen_putchar(c, pc_row, pc_col, attr); + grid_putchar(&curwin->w_grid, c, pc_row, pc_col, attr); } } @@ -1543,7 +1543,8 @@ void edit_unputchar(void) if (pc_status == PC_STATUS_RIGHT || pc_status == PC_STATUS_LEFT) { redrawWinline(curwin, curwin->w_cursor.lnum, false); } else { - screen_puts(pc_bytes, pc_row - msg_scrolled, pc_col, pc_attr); + grid_puts(&curwin->w_grid, pc_bytes, pc_row - msg_scrolled, pc_col, + pc_attr); } } } @@ -1566,7 +1567,7 @@ void display_dollar(colnr_T col) char_u *p = get_cursor_line_ptr(); curwin->w_cursor.col -= utf_head_off(p, p + col); curs_columns(false); // Recompute w_wrow and w_wcol - if (curwin->w_wcol < curwin->w_width) { + if (curwin->w_wcol < curwin->w_grid.Columns) { edit_putchar('$', FALSE); dollar_vcol = curwin->w_virtcol; } @@ -5825,7 +5826,7 @@ static void check_auto_format( /* * Find out textwidth to be used for formatting: * if 'textwidth' option is set, use it - * else if 'wrapmargin' option is set, use curwin->w_width - 'wrapmargin' + * else if 'wrapmargin' option is set, use curwin->w_grid.Columns-'wrapmargin' * if invalid value, use 0. * Set default to window width (maximum 79) for "gq" operator. */ @@ -5840,7 +5841,7 @@ comp_textwidth ( if (textwidth == 0 && curbuf->b_p_wm) { /* The width is the window width minus 'wrapmargin' minus all the * things that add to the margin. */ - textwidth = curwin->w_width - curbuf->b_p_wm; + textwidth = curwin->w_grid.Columns - curbuf->b_p_wm; if (cmdwin_type != 0) textwidth -= 1; textwidth -= curwin->w_p_fdc; @@ -5855,7 +5856,7 @@ comp_textwidth ( if (textwidth < 0) textwidth = 0; if (ff && textwidth == 0) { - textwidth = curwin->w_width - 1; + textwidth = curwin->w_grid.Columns - 1; if (textwidth > 79) textwidth = 79; } |