Lines Matching refs:w_cursor

150 	block_col = curwin->w_cursor.col;  in op_shift()
156 curwin->w_cursor.col = 0; in op_shift()
166 ++curwin->w_cursor.lnum; in op_shift()
172 curwin->w_cursor.lnum = oap->start.lnum; in op_shift()
173 curwin->w_cursor.col = block_col; in op_shift()
177 curwin->w_cursor.lnum = oap->start.lnum; in op_shift()
181 --curwin->w_cursor.lnum; // put cursor on last line, for ":>" in op_shift()
283 int oldcol = curwin->w_cursor.col; in shift_block()
298 block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); in shift_block()
462 ml_replace(curwin->w_cursor.lnum, newp, FALSE); in shift_block()
463 changed_bytes(curwin->w_cursor.lnum, (colnr_T)bd.textcol); in shift_block()
465 curwin->w_cursor.col = oldcol; in shift_block()
768 for (lnum = curwin->w_cursor.lnum; lnum <= oap->end.lnum; ++lnum) in op_delete()
775 if (lnum == curwin->w_cursor.lnum) in op_delete()
777 curwin->w_cursor.col = bd.textcol + bd.startspaces; in op_delete()
778 curwin->w_cursor.coladd = 0; in op_delete()
807 changed_lines(curwin->w_cursor.lnum, curwin->w_cursor.col, in op_delete()
820 lnum = curwin->w_cursor.lnum; in op_delete()
821 ++curwin->w_cursor.lnum; in op_delete()
823 curwin->w_cursor.lnum = lnum; in op_delete()
831 ai_col = curwin->w_cursor.col; in op_delete()
861 oap->start = curwin->w_cursor; in op_delete()
865 oap->end.col = curwin->w_cursor.col; in op_delete()
866 oap->end.coladd = curwin->w_cursor.coladd; in op_delete()
867 curwin->w_cursor = oap->start; in op_delete()
879 curwin->w_cursor = oap->end; in op_delete()
881 oap->end = curwin->w_cursor; in op_delete()
882 curwin->w_cursor = oap->start; in op_delete()
896 && oap->end.lnum == curwin->w_cursor.lnum in op_delete()
919 curwin->w_cursor.coladd = 0; in op_delete()
929 if (u_save((linenr_T)(curwin->w_cursor.lnum - 1), in op_delete()
930 (linenr_T)(curwin->w_cursor.lnum + oap->line_count)) == FAIL) in op_delete()
935 curpos = curwin->w_cursor; // remember curwin->w_cursor in op_delete()
936 ++curwin->w_cursor.lnum; in op_delete()
941 curwin->w_cursor.col = 0; in op_delete()
944 curwin->w_cursor = curpos; // restore curwin->w_cursor in op_delete()
1042 for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum) in op_replace()
1044 curwin->w_cursor.col = 0; // make sure cursor position is valid in op_replace()
1045 block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); in op_replace()
1058 vpos.lnum = curwin->w_cursor.lnum; in op_replace()
1134 ml_replace(curwin->w_cursor.lnum, newp, FALSE); in op_replace()
1137 ml_append(curwin->w_cursor.lnum++, after_p, 0, FALSE); in op_replace()
1138 appended_lines_mark(curwin->w_cursor.lnum, 1L); in op_replace()
1152 curwin->w_cursor.col = 0; in op_replace()
1160 while (LTOREQ_POS(curwin->w_cursor, oap->end)) in op_replace()
1169 if (curwin->w_cursor.lnum == oap->end.lnum) in op_replace()
1179 if (curwin->w_cursor.lnum == oap->end.lnum) in op_replace()
1187 if (curwin->w_cursor.lnum == oap->end.lnum) in op_replace()
1190 PBYTE(curwin->w_cursor, c); in op_replace()
1193 else if (virtual_op && curwin->w_cursor.lnum == oap->end.lnum) in op_replace()
1197 if (curwin->w_cursor.lnum == oap->start.lnum in op_replace()
1205 curwin->w_cursor.col -= (virtcols + 1); in op_replace()
1211 PBYTE(curwin->w_cursor, c); in op_replace()
1212 if (inc(&curwin->w_cursor) == -1) in op_replace()
1223 curwin->w_cursor = oap->start; in op_replace()
1404 pos_T sp = curwin->w_cursor; in swapchar()
1407 curwin->w_cursor = *pos; in swapchar()
1411 curwin->w_cursor = sp; in swapchar()
1436 pos_T sp = curwin->w_cursor; in swapchar()
1438 curwin->w_cursor = *pos; in swapchar()
1442 curwin->w_cursor = sp; in swapchar()
1471 curwin->w_cursor.lnum = oap->start.lnum; in op_insert()
1483 if (curwin->w_cursor.coladd > 0) in op_insert()
1494 --curwin->w_cursor.col; in op_insert()
1510 if (oap->block_mode && curwin->w_cursor.coladd == 0) in op_insert()
1515 && (curwin->w_cursor.col < bd.textcol + bd.textlen)) in op_insert()
1516 ++curwin->w_cursor.col; in op_insert()
1530 curwin->w_cursor = oap->end; in op_insert()
1534 if (!LINEEMPTY(curwin->w_cursor.lnum) in op_insert()
1541 start_insert = curwin->w_cursor; in op_insert()
1554 if (curwin->w_cursor.lnum != oap->start.lnum || got_int) in op_insert()
1673 curwin->w_cursor.col = oap->start.col; in op_insert()
1724 if ((l > curwin->w_cursor.col) && !LINEEMPTY(curwin->w_cursor.lnum) in op_change()
1733 if (virtual_op && (curwin->w_cursor.coladd > 0 in op_change()
1739 bd.textcol = curwin->w_cursor.col; in op_change()
1829 if (curwin->w_cursor.col > 0 in adjust_cursor_eol()
1842 getvcol(curwin, &curwin->w_cursor, &scol, NULL, &ecol); in adjust_cursor_eol()
1843 curwin->w_cursor.coladd = ecol - scol + 1; in adjust_cursor_eol()
1956 if (save_undo && u_save((linenr_T)(curwin->w_cursor.lnum - 1), in do_join()
1957 (linenr_T)(curwin->w_cursor.lnum + count)) == FAIL) in do_join()
1983 curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t)); in do_join()
1985 propcount += count_props((linenr_T) (curwin->w_cursor.lnum + t), t > 0); in do_join()
1990 curwin->w_buffer->b_op_start.lnum = curwin->w_cursor.lnum; in do_join()
2113 mark_col_adjust(curwin->w_cursor.lnum + t, (colnr_T)0, (linenr_T)-t, in do_join()
2117 curwin->w_cursor.lnum + t, t == count - 1, in do_join()
2123 curr = curr_start = ml_get((linenr_T)(curwin->w_cursor.lnum + t - 1)); in do_join()
2131 ml_replace_len(curwin->w_cursor.lnum, newp, (colnr_T)newp_len, TRUE, FALSE); in do_join()
2136 curwin->w_buffer->b_op_end.lnum = curwin->w_cursor.lnum; in do_join()
2142 changed_lines(curwin->w_cursor.lnum, currsize, in do_join()
2143 curwin->w_cursor.lnum + 1, 0L); in do_join()
2149 t = curwin->w_cursor.lnum; in do_join()
2150 ++curwin->w_cursor.lnum; in do_join()
2152 curwin->w_cursor.lnum = t; in do_join()
2159 curwin->w_cursor.col = in do_join()
2163 curwin->w_cursor.coladd = 0; in do_join()
2351 pos = curwin->w_cursor; in op_addsub()
2392 curwin->w_cursor.col = 0; in op_addsub()
2494 pos_T save_cursor = curwin->w_cursor; in do_addsub()
2512 curwin->w_cursor = *pos; in do_addsub()
2677 curwin->w_cursor.col = col; in do_addsub()
2679 startpos = curwin->w_cursor; in do_addsub()
2683 endpos = curwin->w_cursor; in do_addsub()
2684 curwin->w_cursor.col = col; in do_addsub()
2777 curwin->w_cursor.col = col; in do_addsub()
2779 startpos = curwin->w_cursor; in do_addsub()
2790 save_pos = curwin->w_cursor; in do_addsub()
2803 curwin->w_cursor = save_pos; in do_addsub()
2871 save_pos = curwin->w_cursor; in do_addsub()
2881 - curwin->w_cursor.col; in do_addsub()
2884 curwin->w_cursor = save_pos; in do_addsub()
2886 curwin->w_cursor.col = (colnr_T)(STRLEN(ml_get_curline()) in do_addsub()
2893 endpos = curwin->w_cursor; in do_addsub()
2894 if (did_change && curwin->w_cursor.col) in do_addsub()
2895 --curwin->w_cursor.col; in do_addsub()
2909 curwin->w_cursor = save_cursor; in do_addsub()
2913 curwin->w_cursor.coladd = save_coladd; in do_addsub()
3028 if (LT_POS(VIsual, curwin->w_cursor)) in cursor_pos_info()
3031 max_pos = curwin->w_cursor; in cursor_pos_info()
3035 min_pos = curwin->w_cursor; in cursor_pos_info()
3130 if (lnum == curwin->w_cursor.lnum) in cursor_pos_info()
3137 (varnumber_T)(curwin->w_cursor.col + 1), in cursor_pos_info()
3191 col_print(buf1, sizeof(buf1), (int)curwin->w_cursor.col + 1, in cursor_pos_info()
3201 (long)curwin->w_cursor.lnum, in cursor_pos_info()
3209 (long)curwin->w_cursor.lnum, in cursor_pos_info()
3262 if (oap->start.lnum == curwin->w_cursor.lnum) in op_colon()
3269 if (oap->end.lnum == curwin->w_cursor.lnum) in op_colon()
3273 else if (oap->start.lnum == curwin->w_cursor.lnum) in op_colon()
3430 curwin->w_cursor.col = MAXCOL; in get_op_vcol()
3432 for (curwin->w_cursor.lnum = oap->start.lnum; in get_op_vcol()
3433 curwin->w_cursor.lnum <= oap->end.lnum; in get_op_vcol()
3434 ++curwin->w_cursor.lnum) in get_op_vcol()
3436 getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &end); in get_op_vcol()
3448 curwin->w_cursor.lnum = oap->end.lnum; in get_op_vcol()
3450 oap->end = curwin->w_cursor; in get_op_vcol()
3452 curwin->w_cursor = oap->start; in get_op_vcol()
3454 oap->start = curwin->w_cursor; in get_op_vcol()
3494 old_cursor = curwin->w_cursor; in do_pending_operator()
3587 oap->start = curwin->w_cursor; in do_pending_operator()
3588 curwin->w_cursor.lnum += redo_VIsual_line_count - 1; in do_pending_operator()
3589 if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count) in do_pending_operator()
3590 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; in do_pending_operator()
3623 curbuf->b_visual.vi_end = curwin->w_cursor; in do_pending_operator()
3638 if (LT_POS(VIsual, curwin->w_cursor)) in do_pending_operator()
3641 curwin->w_cursor.col = in do_pending_operator()
3642 (colnr_T)STRLEN(ml_get(curwin->w_cursor.lnum)); in do_pending_operator()
3646 curwin->w_cursor.col = 0; in do_pending_operator()
3666 if (LT_POS(oap->start, curwin->w_cursor)) in do_pending_operator()
3674 if ((curwin->w_cursor.col > 0 || oap->inclusive in do_pending_operator()
3676 && hasFolding(curwin->w_cursor.lnum, NULL, in do_pending_operator()
3677 &curwin->w_cursor.lnum)) in do_pending_operator()
3678 curwin->w_cursor.col = (colnr_T)STRLEN(ml_get_curline()); in do_pending_operator()
3681 oap->end = curwin->w_cursor; in do_pending_operator()
3682 curwin->w_cursor = oap->start; in do_pending_operator()
3695 if (hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum, in do_pending_operator()
3697 curwin->w_cursor.col = 0; in do_pending_operator()
3703 oap->start = curwin->w_cursor; in do_pending_operator()
3926 if (curwin->w_cursor.lnum + oap->line_count - 1 > in do_pending_operator()
4199 curwin->w_cursor = old_cursor; in do_pending_operator()