Lines Matching refs:w_cursor

1075     old_pos = curwin->w_cursor;		// remember where cursor was  in normal_cmd()
1144 && old_pos.lnum == curwin->w_cursor.lnum in normal_cmd()
1145 && old_pos.col == curwin->w_cursor.col) in normal_cmd()
1398 curbuf->b_visual.vi_end = curwin->w_cursor; in end_visual_mode_keep_button()
1404 curwin->w_cursor.coladd = 0; in end_visual_mode_keep_button()
1512 return find_ident_at_pos(curwin, curwin->w_cursor.lnum, in find_ident_under_cursor()
1513 curwin->w_cursor.col, text, NULL, find_type); in find_ident_under_cursor()
1820 int cursor_bot = LT_POS(VIsual, curwin->w_cursor); in clear_showcmd()
1829 bot = curwin->w_cursor.lnum; in clear_showcmd()
1833 top = curwin->w_cursor.lnum; in clear_showcmd()
1853 getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); in clear_showcmd()
1861 else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum) in clear_showcmd()
2404 old_pos = curwin->w_cursor; in find_decl()
2418 curwin->w_cursor.lnum = 1; in find_decl()
2419 par_pos = curwin->w_cursor; in find_decl()
2423 par_pos = curwin->w_cursor; in find_decl()
2424 while (curwin->w_cursor.lnum > 1 && *skipwhite(ml_get_curline()) != NUL) in find_decl()
2425 --curwin->w_cursor.lnum; in find_decl()
2427 curwin->w_cursor.col = 0; in find_decl()
2433 t = searchit(curwin, curbuf, &curwin->w_cursor, NULL, FORWARD, in find_decl()
2435 if (curwin->w_cursor.lnum >= old_pos.lnum) in find_decl()
2445 (int)(old_pos.lnum - curwin->w_cursor.lnum + 1))) != NULL in find_decl()
2450 curwin->w_cursor = *pos; in find_decl()
2460 curwin->w_cursor = found_pos; in find_decl()
2468 ++curwin->w_cursor.lnum; in find_decl()
2469 curwin->w_cursor.col = 0; in find_decl()
2472 valid = is_ident(ml_get_curline(), curwin->w_cursor.col); in find_decl()
2478 curwin->w_cursor = found_pos; in find_decl()
2485 if (valid && curwin->w_cursor.lnum >= par_pos.lnum) in find_decl()
2489 curwin->w_cursor = found_pos; in find_decl()
2499 found_pos = curwin->w_cursor; in find_decl()
2508 curwin->w_cursor = old_pos; in find_decl()
2589 && !hasFolding(curwin->w_cursor.lnum, NULL, NULL) in nv_screengo()
2603 (void)hasFolding(curwin->w_cursor.lnum, in nv_screengo()
2604 &curwin->w_cursor.lnum, NULL); in nv_screengo()
2606 if (curwin->w_cursor.lnum == 1) in nv_screengo()
2611 --curwin->w_cursor.lnum; in nv_screengo()
2627 && !hasFolding(curwin->w_cursor.lnum, NULL, NULL) in nv_screengo()
2637 (void)hasFolding(curwin->w_cursor.lnum, NULL, in nv_screengo()
2638 &curwin->w_cursor.lnum); in nv_screengo()
2640 if (curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count) in nv_screengo()
2645 curwin->w_cursor.lnum++; in nv_screengo()
2664 if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) in nv_screengo()
2692 --curwin->w_cursor.col; in nv_screengo()
2722 linenr_T prev_lnum = curwin->w_cursor.lnum; in scroll_redraw()
2747 if (curwin->w_cursor.lnum > prev_lnum in scroll_redraw()
2753 if (curwin->w_cursor.lnum < prev_lnum in scroll_redraw()
2764 if (curwin->w_cursor.lnum != prev_lnum) in scroll_redraw()
2859 && cap->count0 != curwin->w_cursor.lnum) in nv_zet()
2863 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; in nv_zet()
2865 curwin->w_cursor.lnum = cap->count0; in nv_zet()
2878 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; in nv_zet()
2880 curwin->w_cursor.lnum = curwin->w_botline; in nv_zet()
2910 curwin->w_cursor.lnum = curwin->w_topline; in nv_zet()
2913 curwin->w_cursor.lnum = 1; in nv_zet()
2915 curwin->w_cursor.lnum = curwin->w_topline - 1; in nv_zet()
2963 if (hasFolding(curwin->w_cursor.lnum, NULL, NULL)) in nv_zet()
2967 getvcol(curwin, &curwin->w_cursor, &col, NULL, NULL); in nv_zet()
2984 if (hasFolding(curwin->w_cursor.lnum, NULL, NULL)) in nv_zet()
2988 getvcol(curwin, &curwin->w_cursor, NULL, NULL, &col); in nv_zet()
3038 deleteFold(curwin->w_cursor.lnum, in nv_zet()
3039 curwin->w_cursor.lnum, nchar == 'D', FALSE); in nv_zet()
3069 case 'a': if (hasFolding(curwin->w_cursor.lnum, NULL, NULL)) in nv_zet()
3070 openFold(curwin->w_cursor.lnum, cap->count1); in nv_zet()
3073 closeFold(curwin->w_cursor.lnum, cap->count1); in nv_zet()
3079 case 'A': if (hasFolding(curwin->w_cursor.lnum, NULL, NULL)) in nv_zet()
3080 openFoldRecurse(curwin->w_cursor.lnum); in nv_zet()
3083 closeFoldRecurse(curwin->w_cursor.lnum); in nv_zet()
3092 openFold(curwin->w_cursor.lnum, cap->count1); in nv_zet()
3099 openFoldRecurse(curwin->w_cursor.lnum); in nv_zet()
3106 closeFold(curwin->w_cursor.lnum, cap->count1); in nv_zet()
3114 closeFoldRecurse(curwin->w_cursor.lnum); in nv_zet()
3210 pos_T pos = curwin->w_cursor; in nv_zet()
3218 if (len != 0 && curwin->w_cursor.col <= pos.col) in nv_zet()
3219 ptr = ml_get_pos(&curwin->w_cursor); in nv_zet()
3220 curwin->w_cursor = pos; in nv_zet()
3675 curwin->w_cursor.col = (colnr_T) (ptr - ml_get_curline()); in nv_ident()
3861 if (VIsual.lnum != curwin->w_cursor.lnum) in get_visual_text()
3874 if (LT_POS(curwin->w_cursor, VIsual)) in get_visual_text()
3876 *pp = ml_get_pos(&curwin->w_cursor); in get_visual_text()
3877 *lenp = VIsual.col - curwin->w_cursor.col + 1; in get_visual_text()
3882 *lenp = curwin->w_cursor.col - VIsual.col + 1; in get_visual_text()
3923 curwin->w_cursor.lnum = curwin->w_botline - 1; in nv_scroll()
3924 if (cap->count1 - 1 >= curwin->w_cursor.lnum) in nv_scroll()
3925 curwin->w_cursor.lnum = 1; in nv_scroll()
3933 && curwin->w_cursor.lnum > curwin->w_topline; --n) in nv_scroll()
3935 (void)hasFolding(curwin->w_cursor.lnum, in nv_scroll()
3936 &curwin->w_cursor.lnum, NULL); in nv_scroll()
3937 --curwin->w_cursor.lnum; in nv_scroll()
3942 curwin->w_cursor.lnum -= cap->count1 - 1; in nv_scroll()
3996 curwin->w_cursor.lnum = curwin->w_topline + n; in nv_scroll()
3997 if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) in nv_scroll()
3998 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; in nv_scroll()
4053 && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) in nv_right()
4060 && !LINEEMPTY(curwin->w_cursor.lnum)) in nv_right()
4064 ++curwin->w_cursor.lnum; in nv_right()
4065 curwin->w_cursor.col = 0; in nv_right()
4066 curwin->w_cursor.coladd = 0; in nv_right()
4080 if (!LINEEMPTY(curwin->w_cursor.lnum)) in nv_right()
4093 curwin->w_cursor.col += (*mb_ptr2len)(ml_get_cursor()); in nv_right()
4095 ++curwin->w_cursor.col; in nv_right()
4141 && curwin->w_cursor.lnum > 1) in nv_left()
4143 --(curwin->w_cursor.lnum); in nv_left()
4153 && !LINEEMPTY(curwin->w_cursor.lnum)) in nv_left()
4160 curwin->w_cursor.col += (*mb_ptr2len)(cp); in nv_left()
4162 ++curwin->w_cursor.col; in nv_left()
4233 && curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count) in nv_down()
4289 curwin->w_cursor.lnum = lnum; in nv_gotofile()
4346 pos_T save_cursor = curwin->w_cursor; in nv_search()
4368 (cap->arg || !EQUAL_POS(save_cursor, curwin->w_cursor)) in nv_search()
4379 pos_T old = curwin->w_cursor; in nv_next()
4383 if (i == 1 && !wrapped && EQUAL_POS(old, curwin->w_cursor)) in nv_next()
4426 curwin->w_cursor.coladd = 0; in normal_search()
4467 getvcol(curwin, &curwin->w_cursor, &scol, NULL, &ecol); in nv_csearch()
4468 curwin->w_cursor.coladd = ecol - scol; in nv_csearch()
4471 curwin->w_cursor.coladd = 0; in nv_csearch()
4498 old_pos = curwin->w_cursor; in nv_brackets()
4499 curwin->w_cursor.coladd = 0; // TODO: don't do this for an error. in nv_brackets()
4541 cap->cmdchar == ']' ? curwin->w_cursor.lnum + 1 : (linenr_T)1, in nv_brackets()
4592 curwin->w_cursor = *pos; in nv_brackets()
4595 curwin->w_cursor = old_pos; in nv_brackets()
4613 curwin->w_cursor = prev_pos; in nv_brackets()
4638 new_pos = curwin->w_cursor; in nv_brackets()
4646 new_pos = curwin->w_cursor; in nv_brackets()
4655 curwin->w_cursor = *pos; in nv_brackets()
4661 curwin->w_cursor = old_pos; in nv_brackets()
4668 curwin->w_cursor = *pos; in nv_brackets()
4721 pos = &curwin->w_cursor; in nv_brackets()
4806 linenr_T lnum = curwin->w_cursor.lnum; in nv_percent()
4823 curwin->w_cursor.lnum = (curbuf->b_ml.ml_line_count + 99L) in nv_percent()
4826 curwin->w_cursor.lnum = (curbuf->b_ml.ml_line_count * in nv_percent()
4828 if (curwin->w_cursor.lnum < 1) in nv_percent()
4829 curwin->w_cursor.lnum = 1; in nv_percent()
4830 if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) in nv_percent()
4831 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; in nv_percent()
4844 curwin->w_cursor = *pos; in nv_percent()
4846 curwin->w_cursor.coladd = 0; in nv_percent()
4852 && lnum != curwin->w_cursor.lnum in nv_percent()
4878 curwin->w_cursor.coladd = 0; in nv_brace()
4914 curwin->w_cursor.coladd = 0; in nv_findpar()
5025 curwin->w_cursor.col -= cap->count1; in nv_replace()
5081 curbuf->b_op_start = curwin->w_cursor; in nv_replace()
5099 int c = ins_copychar(curwin->w_cursor.lnum in nv_replace()
5105 ++curwin->w_cursor.col; in nv_replace()
5130 int c = ins_copychar(curwin->w_cursor.lnum in nv_replace()
5133 ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE); in nv_replace()
5135 ptr[curwin->w_cursor.col] = c; in nv_replace()
5139 ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE); in nv_replace()
5140 ptr[curwin->w_cursor.col] = cap->nchar; in nv_replace()
5144 ++curwin->w_cursor.col; in nv_replace()
5149 colnr_T start = (colnr_T)(curwin->w_cursor.col - cap->count1); in nv_replace()
5151 netbeans_removed(curbuf, curwin->w_cursor.lnum, start, in nv_replace()
5153 netbeans_inserted(curbuf, curwin->w_cursor.lnum, start, in nv_replace()
5159 changed_bytes(curwin->w_cursor.lnum, in nv_replace()
5160 (colnr_T)(curwin->w_cursor.col - cap->count1)); in nv_replace()
5162 --curwin->w_cursor.col; // cursor on the last replaced char in nv_replace()
5167 curbuf->b_op_end = curwin->w_cursor; in nv_replace()
5185 old_cursor = curwin->w_cursor; in v_swap_corners()
5187 curwin->w_cursor.lnum = VIsual.lnum; in v_swap_corners()
5189 VIsual = curwin->w_cursor; in v_swap_corners()
5191 curwin->w_cursor.lnum = old_cursor.lnum; in v_swap_corners()
5198 if (curwin->w_cursor.col == old_cursor.col in v_swap_corners()
5200 || curwin->w_cursor.coladd == old_cursor.coladd)) in v_swap_corners()
5202 curwin->w_cursor.lnum = VIsual.lnum; in v_swap_corners()
5206 VIsual = curwin->w_cursor; in v_swap_corners()
5208 curwin->w_cursor.lnum = old_cursor.lnum; in v_swap_corners()
5215 old_cursor = curwin->w_cursor; in v_swap_corners()
5216 curwin->w_cursor = VIsual; in v_swap_corners()
5296 if (LINEEMPTY(curwin->w_cursor.lnum) && vim_strchr(p_ww, '~') == NULL) in n_swapchar()
5307 startpos = curwin->w_cursor; in n_swapchar()
5313 did_change |= swapchar(cap->oap->op_type, &curwin->w_cursor); in n_swapchar()
5318 && curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count) in n_swapchar()
5336 ++curwin->w_cursor.lnum; in n_swapchar()
5337 curwin->w_cursor.col = 0; in n_swapchar()
5340 if (u_savesub(curwin->w_cursor.lnum) == FAIL) in n_swapchar()
5353 count = curwin->w_cursor.col - pos.col; in n_swapchar()
5364 changed_lines(startpos.lnum, startpos.col, curwin->w_cursor.lnum + 1, in n_swapchar()
5367 curbuf->b_op_end = curwin->w_cursor; in n_swapchar()
5388 curwin->w_cursor = *pos; in nv_cursormark()
5491 cap->oap->start = curwin->w_cursor; in nv_optrans()
5522 pos_T old_cursor = curwin->w_cursor; in nv_gomark()
5546 curwin->w_cursor.coladd = 0; in nv_gomark()
5567 linenr_T lnum = curwin->w_cursor.lnum; in nv_pcmark()
5603 && (pos == (pos_T *)-1 || lnum != curwin->w_cursor.lnum) in nv_pcmark()
5678 VIsual = curwin->w_cursor; in nv_visual()
5694 curwin->w_cursor.lnum += in nv_visual()
5791 VIsual = curwin->w_cursor; in n_start_visual_mode()
5816 curwin->w_old_cursor_lnum = curwin->w_cursor.lnum; in n_start_visual_mode()
5817 curwin->w_old_visual_lnum = curwin->w_cursor.lnum; in n_start_visual_mode()
5932 curbuf->b_visual.vi_end = curwin->w_cursor; in nv_g_cmd()
5933 curwin->w_cursor = curbuf->b_visual.vi_start; in nv_g_cmd()
5941 curwin->w_cursor = curbuf->b_visual.vi_start; in nv_g_cmd()
5950 VIsual = curwin->w_cursor; in nv_g_cmd()
5951 curwin->w_cursor = tpos; in nv_g_cmd()
6127 if (curwin->w_cursor.col > 0 && ptr[curwin->w_cursor.col] == NUL) in nv_g_cmd()
6128 --curwin->w_cursor.col; in nv_g_cmd()
6131 while (curwin->w_cursor.col > 0 in nv_g_cmd()
6132 && VIM_ISWHITE(ptr[curwin->w_cursor.col])) in nv_g_cmd()
6133 --curwin->w_cursor.col; in nv_g_cmd()
6166 if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) in nv_g_cmd()
6174 --curwin->w_cursor.col; in nv_g_cmd()
6190 if (curwin->w_cursor.col > 0 in nv_g_cmd()
6195 getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &vcol); in nv_g_cmd()
6197 --curwin->w_cursor.col; in nv_g_cmd()
6246 curwin->w_cursor = curbuf->b_last_insert; in nv_g_cmd()
6249 if (curwin->w_cursor.col > (colnr_T)i) in nv_g_cmd()
6252 curwin->w_cursor.coladd += curwin->w_cursor.col - i; in nv_g_cmd()
6253 curwin->w_cursor.col = i; in nv_g_cmd()
6341 oap->cursor_start = curwin->w_cursor; in nv_g_cmd()
6460 linenr_T oldline = curwin->w_cursor.lnum; in n_opencmd()
6468 (void)hasFolding(curwin->w_cursor.lnum, in n_opencmd()
6469 &curwin->w_cursor.lnum, NULL); in n_opencmd()
6472 (void)hasFolding(curwin->w_cursor.lnum, in n_opencmd()
6473 NULL, &curwin->w_cursor.lnum); in n_opencmd()
6475 if (u_save((linenr_T)(curwin->w_cursor.lnum - in n_opencmd()
6477 (linenr_T)(curwin->w_cursor.lnum + in n_opencmd()
6485 if (curwin->w_p_cole > 0 && oldline != curwin->w_cursor.lnum) in n_opencmd()
6597 cap->oap->start = curwin->w_cursor; in nv_operator()
6718 pos_T startpos = curwin->w_cursor; in nv_wordcmd()
6781 if (LT_POS(startpos, curwin->w_cursor)) in nv_wordcmd()
6808 if (curwin->w_cursor.col > 0 && gchar_cursor() == NUL in adjust_cursor()
6812 --curwin->w_cursor.col; in adjust_cursor()
6845 && gchar_cursor() != NUL && LT_POS(VIsual, curwin->w_cursor)) in adjust_for_sel()
6850 ++curwin->w_cursor.col; in adjust_for_sel()
6865 if (*p_sel == 'e' && !EQUAL_POS(VIsual, curwin->w_cursor)) in unadjust_for_sel()
6867 if (LT_POS(VIsual, curwin->w_cursor)) in unadjust_for_sel()
6868 pp = &curwin->w_cursor; in unadjust_for_sel()
6929 curwin->w_cursor.lnum = lnum; in nv_goto()
7055 curwin->w_cursor.col += (colnr_T)STRLEN(ml_get_cursor()); in set_cursor_for_append_to_line()
7113 pos_T old_pos = curwin->w_cursor; in nv_edit()
7117 if (VIsual_mode == 'V' || curwin->w_cursor.lnum != VIsual.lnum) in nv_edit()
7132 if (*ml_get_cursor() != NUL && LT_POS(curwin->w_cursor, old_pos) in nv_edit()
7133 && LT_POS(curwin->w_cursor, old_visual)) in nv_edit()
7157 if (curwin->w_cursor.col == 0) in nv_edit()
7165 && (curwin->w_cursor.coladd > 0 in nv_edit()
7168 curwin->w_cursor.coladd++; in nv_edit()
7174 if (curwin->w_cursor.coladd && cap->cmdchar != 'A') in nv_edit()
7372 if ((cap->cmdchar == Ctrl_U && curwin->w_cursor.lnum == 1) in nv_halfpage()
7374 && curwin->w_cursor.lnum == curbuf->b_ml.ml_line_count)) in nv_halfpage()
7392 if (curwin->w_cursor.lnum + cap->count0 - 1 > in nv_join()
7402 - curwin->w_cursor.lnum + 1; in nv_join()
7527 && curwin->w_cursor.col < curbuf->b_op_start.col) in nv_put_opt()
7529 && curwin->w_cursor.lnum < curbuf->b_op_start.lnum)) in nv_put_opt()
7562 if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) in nv_put_opt()
7564 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; in nv_put_opt()