Lines Matching refs:curwin
188 pos_T save_cursor = curwin->w_cursor; in edit()
212 if (!EQUAL_POS(curwin->w_cursor, save_cursor) in edit()
220 curwin->w_cursor = save_cursor; in edit()
229 cursor_line_was_concealed = curwin->w_p_cole > 0 in edit()
230 && conceal_cursor_line(curwin); in edit()
241 Insstart = curwin->w_cursor; in edit()
367 if (((ins_at_eol && curwin->w_cursor.lnum == o_lnum) in edit()
368 || curwin->w_curswant > curwin->w_virtcol) in edit()
369 && *(ptr = ml_get_curline() + curwin->w_cursor.col) != NUL) in edit()
372 ++curwin->w_cursor.col; in edit()
377 curwin->w_cursor.col += i; in edit()
462 curwin->w_set_curswant = TRUE; in edit()
513 && curwin->w_p_wrap in edit()
515 && curwin->w_topline == old_topline in edit()
517 && curwin->w_topfill == old_topfill in edit()
521 mincol = curwin->w_wcol; in edit()
526 (int)curwin->w_wcol < mincol - tabstop_at( in edit()
530 (int)curwin->w_wcol < mincol - curbuf->b_p_ts in edit()
532 && curwin->w_wrow == W_WINROW(curwin) in edit()
533 + curwin->w_height - 1 - get_scrolloff_value() in edit()
534 && (curwin->w_cursor.lnum != curwin->w_topline in edit()
536 || curwin->w_topfill > 0 in edit()
541 if (curwin->w_topfill > 0) in edit()
542 --curwin->w_topfill; in edit()
546 if (hasFolding(curwin->w_topline, NULL, &old_topline)) in edit()
547 set_topline(curwin, old_topline + 1); in edit()
550 set_topline(curwin, curwin->w_topline + 1); in edit()
567 if (curwin->w_p_scb) in edit()
570 if (curwin->w_p_crb) in edit()
573 old_topline = curwin->w_topline; in edit()
575 old_topfill = curwin->w_topfill; in edit()
628 && curwin->w_cursor.col >= ins_compl_col() in edit()
633 && curwin->w_cursor.col > ins_compl_col() in edit()
754 if (curwin->w_p_rl) in edit()
832 o_lnum = curwin->w_cursor.lnum; in edit()
1187 if (curwin->w_llist_ref == NULL) // quickfix window in edit()
1349 && curwin->w_cursor.lnum == Insstart.lnum) in edit()
1444 || curwin->w_p_cole > 0 in ins_redraw()
1447 && !EQUAL_POS(last_cursormoved, curwin->w_cursor) in ins_redraw()
1455 if (syntax_present(curwin) && must_redraw) in ins_redraw()
1470 if (curwin->w_p_cole > 0) in ins_redraw()
1473 conceal_new_cursor_line = curwin->w_cursor.lnum; in ins_redraw()
1477 last_cursormoved = curwin->w_cursor; in ins_redraw()
1494 u_save(curwin->w_cursor.lnum, in ins_redraw()
1495 (linenr_T)(curwin->w_cursor.lnum + 1)); in ins_redraw()
1514 u_save(curwin->w_cursor.lnum, in ins_redraw()
1515 (linenr_T)(curwin->w_cursor.lnum + 1)); in ins_redraw()
1526 || conceal_cursor_line(curwin))) in ins_redraw()
1530 redrawWinline(curwin, conceal_old_cursor_line); in ins_redraw()
1531 redrawWinline(curwin, conceal_new_cursor_line == 0 in ins_redraw()
1532 ? curwin->w_cursor.lnum : conceal_new_cursor_line); in ins_redraw()
1533 curwin->w_valid &= ~VALID_CROW; in ins_redraw()
1671 pc_row = W_WINROW(curwin) + curwin->w_wrow; in edit_putchar()
1672 pc_col = curwin->w_wincol; in edit_putchar()
1675 if (curwin->w_p_rl) in edit_putchar()
1677 pc_col += curwin->w_width - 1 - curwin->w_wcol; in edit_putchar()
1685 --curwin->w_wcol; in edit_putchar()
1693 pc_col += curwin->w_wcol; in edit_putchar()
1731 ++curwin->w_wcol; in edit_unputchar()
1733 redrawWinline(curwin, curwin->w_cursor.lnum); in edit_unputchar()
1752 save_col = curwin->w_cursor.col; in display_dollar()
1753 curwin->w_cursor.col = col; in display_dollar()
1760 curwin->w_cursor.col -= (*mb_head_off)(p, p + col); in display_dollar()
1763 if (curwin->w_wcol < curwin->w_width) in display_dollar()
1766 dollar_vcol = curwin->w_virtcol; in display_dollar()
1768 curwin->w_cursor.col = save_col; in display_dollar()
1781 redrawWinline(curwin, curwin->w_cursor.lnum); in undisplay_dollar()
1813 while ((int)curwin->w_cursor.col > col) in backspace_until_column()
1815 curwin->w_cursor.col--; in backspace_until_column()
1833 colnr_T ecol = curwin->w_cursor.col + 1; in del_char_after_col()
1839 while (curwin->w_cursor.col < (colnr_T)limit_col) in del_char_after_col()
1845 curwin->w_cursor.col += l; in del_char_after_col()
1847 if (*ml_get_cursor() == NUL || curwin->w_cursor.col == ecol) in del_char_after_col()
1849 del_bytes((long)((int)ecol - curwin->w_cursor.col), FALSE, TRUE); in del_char_after_col()
2084 && (curwin->w_cursor.lnum != Insstart.lnum in insertchar()
2101 do_internal = (fex_format(curwin->w_cursor.lnum, 1L, c) != 0); in insertchar()
2143 i = curwin->w_cursor.col; in insertchar()
2351 redrawWinline(curwin, lnum); in check_spell_redraw()
2367 Insstart = curwin->w_cursor; // new insertion starts here in stop_arrow()
2445 pos_T tpos = curwin->w_cursor; in stop_insert()
2451 if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL) in stop_insert()
2456 curwin->w_cursor = tpos; in stop_insert()
2468 && curwin->w_cursor.lnum == tpos.lnum in stop_insert()
2469 && curwin->w_cursor.col == tpos.col) in stop_insert()
2470 curwin->w_cursor.coladd = tpos.coladd; in stop_insert()
2483 && curwin->w_cursor.lnum != end_insert_pos->lnum)) in stop_insert()
2486 pos_T tpos = curwin->w_cursor; in stop_insert()
2488 curwin->w_cursor = *end_insert_pos; in stop_insert()
2492 if (gchar_cursor() == NUL && curwin->w_cursor.col > 0) in stop_insert()
2493 --curwin->w_cursor.col; in stop_insert()
2500 if (curwin->w_cursor.lnum != tpos.lnum) in stop_insert()
2501 curwin->w_cursor = tpos; in stop_insert()
2505 tpos = curwin->w_cursor; in stop_insert()
2508 ++curwin->w_cursor.col; // put cursor back on the NUL in stop_insert()
2513 if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) in stop_insert()
2622 coladvance(curwin->w_curswant); in beginline()
2625 curwin->w_cursor.col = 0; in beginline()
2626 curwin->w_cursor.coladd = 0; in beginline()
2634 ++curwin->w_cursor.col; in beginline()
2636 curwin->w_set_curswant = TRUE; in beginline()
2656 pos_T prevpos = curwin->w_cursor; in oneright()
2663 curwin->w_set_curswant = TRUE; in oneright()
2665 return (prevpos.col != curwin->w_cursor.col in oneright()
2666 || prevpos.coladd != curwin->w_cursor.coladd) ? OK : FAIL; in oneright()
2682 curwin->w_cursor.col += l; in oneright()
2684 curwin->w_set_curswant = TRUE; in oneright()
2710 if ((*get_showbreak_value(curwin) == NUL && !curwin->w_p_bri in oneleft()
2719 if (curwin->w_cursor.coladd == 1) in oneleft()
2727 curwin->w_cursor.coladd = 0; in oneleft()
2730 curwin->w_set_curswant = TRUE; in oneleft()
2734 if (curwin->w_cursor.col == 0) in oneleft()
2737 curwin->w_set_curswant = TRUE; in oneleft()
2738 --curwin->w_cursor.col; in oneleft()
2756 lnum = curwin->w_cursor.lnum; in cursor_up()
2765 if (hasAnyFolding(curwin)) in cursor_up()
2791 curwin->w_cursor.lnum = lnum; in cursor_up()
2795 coladvance(curwin->w_curswant); in cursor_up()
2815 lnum = curwin->w_cursor.lnum; in cursor_down()
2830 if (hasAnyFolding(curwin)) in cursor_down()
2850 curwin->w_cursor.lnum = lnum; in cursor_down()
2854 coladvance(curwin->w_curswant); in cursor_down()
2970 return check_abbr(c, ml_get_curline(), curwin->w_cursor.col, in echeck_abbr()
2971 curwin->w_cursor.lnum == Insstart.lnum ? Insstart.col : 0); in echeck_abbr()
3201 getvcol(curwin, &curwin->w_cursor, NULL, &start_vcol, NULL); in replace_do_bs()
3234 curwin->w_cursor.col += ins_len; in replace_do_bs()
3240 curwin->w_cursor.col -= ins_len; in replace_do_bs()
3244 changed_bytes(curwin->w_cursor.lnum, curwin->w_cursor.col); in replace_do_bs()
3252 adjust_prop_columns(curwin->w_cursor.lnum, curwin->w_cursor.col, in replace_do_bs()
3398 pos_T curpos = curwin->w_cursor; in ins_reg()
3409 curwin->w_cursor = curpos; in ins_reg()
3507 Insstart = curwin->w_cursor; in ins_ctrl_g()
3590 int cursor_line_was_concealed = curwin->w_p_cole > 0 in ins_esc()
3591 && conceal_cursor_line(curwin); in ins_esc()
3598 temp = curwin->w_cursor.col; in ins_esc()
3638 stop_insert(&curwin->w_cursor, TRUE, nomove); in ins_esc()
3647 if (restart_edit == NUL && (colnr_T)temp == curwin->w_cursor.col) in ins_esc()
3648 curwin->w_set_curswant = TRUE; in ins_esc()
3652 curbuf->b_last_insert = curwin->w_cursor; in ins_esc()
3659 && (curwin->w_cursor.col != 0 in ins_esc()
3660 || curwin->w_cursor.coladd > 0) in ins_esc()
3668 if (curwin->w_cursor.coladd > 0 || get_ve_flags() == VE_ALL) in ins_esc()
3672 ++curwin->w_cursor.coladd; in ins_esc()
3676 --curwin->w_cursor.col; in ins_esc()
3739 ++curwin->w_cursor.col; in ins_ctrl_()
3745 revins_scol = curwin->w_cursor.col; in ins_ctrl_()
3752 p_hkmap = curwin->w_p_rl ^ p_ri; // be consistent! in ins_ctrl_()
3873 && curwin->w_cursor.col > 0) in ins_shift()
3875 --curwin->w_cursor.col; in ins_shift()
3908 temp = curwin->w_cursor.col; in ins_del()
3914 curwin->w_cursor.col = temp; in ins_del()
3941 getvcol(curwin, &curwin->w_cursor, vcolp, NULL, NULL); in ins_bs_one()
3946 if (curwin->w_cursor.lnum != Insstart.lnum in ins_bs_one()
3947 || curwin->w_cursor.col >= Insstart.col) in ins_bs_one()
3985 ((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0) in ins_bs()
3991 ) || (curwin->w_cursor.lnum == Insstart_orig.lnum in ins_bs()
3992 && curwin->w_cursor.col <= Insstart_orig.col))) in ins_bs()
3994 && curwin->w_cursor.col <= ai_col) in ins_bs()
3995 || (!can_bs(BS_EOL) && curwin->w_cursor.col == 0)))) in ins_bs()
4018 if (curwin->w_cursor.coladd > 0) in ins_bs()
4022 --curwin->w_cursor.coladd; in ins_bs()
4027 curwin->w_cursor.coladd = 0; in ins_bs()
4030 curwin->w_cursor.coladd = 0; in ins_bs()
4036 if (curwin->w_cursor.col == 0) in ins_bs()
4039 if (curwin->w_cursor.lnum == lnum in ins_bs()
4045 if (u_save((linenr_T)(curwin->w_cursor.lnum - 2), in ins_bs()
4046 (linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL) in ins_bs()
4063 if ((State & REPLACE_FLAG) && curwin->w_cursor.lnum <= lnum) in ins_bs()
4070 || curwin->w_cursor.lnum > orig_line_count) in ins_bs()
4073 --curwin->w_cursor.lnum; in ins_bs()
4081 char_u *ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, in ins_bs()
4117 save_col = curwin->w_cursor.col; in ins_bs()
4119 curwin->w_cursor.col = save_col; in ins_bs()
4151 save_col = curwin->w_cursor.col; in ins_bs()
4153 if (curwin->w_cursor.col < save_col) in ins_bs()
4154 mincol = curwin->w_cursor.col; in ins_bs()
4155 curwin->w_cursor.col = save_col; in ins_bs()
4168 && curwin->w_cursor.col > 0 in ins_bs()
4183 getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); in ins_bs()
4186 getvcol(curwin, &curwin->w_cursor, NULL, NULL, &want_vcol); in ins_bs()
4214 if (curwin->w_cursor.lnum == Insstart_orig.lnum in ins_bs()
4215 && curwin->w_cursor.col < Insstart_orig.col) in ins_bs()
4216 Insstart_orig.col = curwin->w_cursor.col; in ins_bs()
4226 getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); in ins_bs()
4311 (curwin->w_cursor.col > mincol in ins_bs()
4313 || (curwin->w_cursor.lnum != Insstart_orig.lnum in ins_bs()
4314 || curwin->w_cursor.col != Insstart_orig.col) in ins_bs()
4324 if (curwin->w_cursor.col <= 1) in ins_bs()
4334 if (curwin->w_cursor.lnum == Insstart_orig.lnum in ins_bs()
4335 && curwin->w_cursor.col < Insstart_orig.col) in ins_bs()
4336 Insstart_orig.col = curwin->w_cursor.col; in ins_bs()
4346 dollar_vcol = curwin->w_virtcol; in ins_bs()
4471 start_arrow(&curwin->w_cursor); in ins_tabline()
4494 tpos = curwin->w_cursor; in ins_scroll()
4510 tpos = curwin->w_cursor; in ins_horscroll()
4532 tpos = curwin->w_cursor; in ins_left()
4547 if (revins_scol != -1 && (int)curwin->w_cursor.col >= revins_scol) in ins_left()
4557 else if (vim_strchr(p_ww, '[') != NULL && curwin->w_cursor.lnum > 1) in ins_left()
4561 --(curwin->w_cursor.lnum); in ins_left()
4563 curwin->w_set_curswant = TRUE; // so we stay at the end in ins_left()
4580 tpos = curwin->w_cursor; in ins_home()
4582 curwin->w_cursor.lnum = 1; in ins_home()
4583 curwin->w_cursor.col = 0; in ins_home()
4584 curwin->w_cursor.coladd = 0; in ins_home()
4585 curwin->w_curswant = 0; in ins_home()
4599 tpos = curwin->w_cursor; in ins_end()
4601 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; in ins_end()
4603 curwin->w_curswant = MAXCOL; in ins_end()
4617 if (curwin->w_cursor.lnum > 1 || curwin->w_cursor.col > 0) in ins_s_left()
4619 start_arrow_with_change(&curwin->w_cursor, end_change); in ins_s_left()
4623 curwin->w_set_curswant = TRUE; in ins_s_left()
4642 start_arrow_with_change(&curwin->w_cursor, end_change); in ins_right()
4645 curwin->w_set_curswant = TRUE; in ins_right()
4651 curwin->w_cursor.col += (*mb_ptr2len)(ml_get_cursor()); in ins_right()
4653 ++curwin->w_cursor.col; in ins_right()
4665 && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) in ins_right()
4667 start_arrow(&curwin->w_cursor); in ins_right()
4668 curwin->w_set_curswant = TRUE; in ins_right()
4669 ++curwin->w_cursor.lnum; in ins_right()
4670 curwin->w_cursor.col = 0; in ins_right()
4686 if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count in ins_s_right()
4689 start_arrow_with_change(&curwin->w_cursor, end_change); in ins_s_right()
4693 curwin->w_set_curswant = TRUE; in ins_s_right()
4705 linenr_T old_topline = curwin->w_topline; in ins_up()
4707 int old_topfill = curwin->w_topfill; in ins_up()
4711 tpos = curwin->w_cursor; in ins_up()
4716 if (old_topline != curwin->w_topline in ins_up()
4718 || old_topfill != curwin->w_topfill in ins_up()
4743 start_arrow(&curwin->w_cursor); in ins_pageup()
4749 tpos = curwin->w_cursor; in ins_pageup()
4766 linenr_T old_topline = curwin->w_topline; in ins_down()
4768 int old_topfill = curwin->w_topfill; in ins_down()
4772 tpos = curwin->w_cursor; in ins_down()
4777 if (old_topline != curwin->w_topline in ins_down()
4779 || old_topfill != curwin->w_topfill in ins_down()
4804 start_arrow(&curwin->w_cursor); in ins_pagedown()
4810 tpos = curwin->w_cursor; in ins_pagedown()
4841 if (Insstart_blank_vcol == MAXCOL && curwin->w_cursor.lnum == Insstart.lnum) in ins_tab()
4942 int save_list = curwin->w_p_list; in ins_tab()
4950 pos = curwin->w_cursor; in ins_tab()
4960 cursor = &curwin->w_cursor; in ins_tab()
4965 curwin->w_p_list = FALSE; in ins_tab()
4968 fpos = curwin->w_cursor; in ins_tab()
4985 getvcol(curwin, &fpos, &vcol, NULL, NULL); in ins_tab()
4986 getvcol(curwin, cursor, &want_vcol, NULL, NULL); in ins_tab()
5095 curwin->w_p_list = save_list; in ins_tab()
5133 if (virtual_active() && curwin->w_cursor.coladd > 0) in ins_eol()
5140 curwin->w_cursor.col += (colnr_T)STRLEN(ml_get_cursor()); in ins_eol()
5275 while ((colnr_T)temp < curwin->w_virtcol && *ptr != NUL) in ins_copychar()
5280 if ((colnr_T)temp > curwin->w_virtcol) in ins_copychar()
5307 c = ins_copychar(curwin->w_cursor.lnum + (c == Ctrl_Y ? -1 : 1)); in ins_ctrl_ey()
5341 if (curwin->w_buffer == NULL in get_nolist_virtcol()
5342 || curwin->w_buffer->b_ml.ml_mfp == NULL in get_nolist_virtcol()
5343 || curwin->w_cursor.lnum > curwin->w_buffer->b_ml.ml_line_count) in get_nolist_virtcol()
5345 if (curwin->w_p_list && vim_strchr(p_cpo, CPO_LISTWM) == NULL) in get_nolist_virtcol()
5346 return getvcol_nolist(&curwin->w_cursor); in get_nolist_virtcol()
5348 return curwin->w_virtcol; in get_nolist_virtcol()
5430 u_save(curwin->w_cursor.lnum, (linenr_T)(curwin->w_cursor.lnum + 1)); in ins_apply_autocmds()