Lines Matching refs:oap

17 static void shift_block(oparg_T *oap, int amount);
18 static void mb_adjust_opend(oparg_T *oap);
139 op_shift(oparg_T *oap, int curs_top, int amount) in op_shift() argument
145 if (u_save((linenr_T)(oap->start.lnum - 1), in op_shift()
146 (linenr_T)(oap->end.lnum + 1)) == FAIL) in op_shift()
149 if (oap->block_mode) in op_shift()
152 for (i = oap->line_count; --i >= 0; ) in op_shift()
157 else if (oap->block_mode) in op_shift()
158 shift_block(oap, amount); in op_shift()
165 shift_line(oap->op_type == OP_LSHIFT, p_sr, amount, FALSE); in op_shift()
169 changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L); in op_shift()
170 if (oap->block_mode) in op_shift()
172 curwin->w_cursor.lnum = oap->start.lnum; in op_shift()
177 curwin->w_cursor.lnum = oap->start.lnum; in op_shift()
189 if (oap->line_count > p_report) in op_shift()
195 if (oap->op_type == OP_RSHIFT) in op_shift()
204 NGETTEXT(msg_line_single, msg_line_plural, oap->line_count), in op_shift()
205 oap->line_count, op, amount); in op_shift()
212 curbuf->b_op_start = oap->start; in op_shift()
213 curbuf->b_op_end.lnum = oap->end.lnum; in op_shift()
214 curbuf->b_op_end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum)); in op_shift()
277 shift_block(oparg_T *oap, int amount) in shift_block() argument
279 int left = (oap->op_type == OP_LSHIFT); in shift_block()
298 block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); in shift_block()
410 block_space_width = non_white_col - oap->start_vcol; in shift_block()
477 oparg_T *oap, in block_insert() argument
495 for (lnum = oap->start.lnum + 1; lnum <= oap->end.lnum; lnum++) in block_insert()
497 block_prep(oap, bdp, lnum, TRUE); in block_insert()
525 spaces = (oap->end_vcol - bdp->end_vcol) + 1; in block_insert()
587 if (lnum == oap->end.lnum) in block_insert()
591 curbuf->b_op_end.lnum = oap->end.lnum; in block_insert()
596 changed_lines(oap->start.lnum + 1, 0, oap->end.lnum + 1, 0L); in block_insert()
607 op_delete(oparg_T *oap) in op_delete() argument
621 if (oap->empty) in op_delete()
631 adjust_clip_reg(&oap->regname); in op_delete()
635 mb_adjust_opend(oap); in op_delete()
642 if ( oap->motion_type == MCHAR in op_delete()
643 && !oap->is_VIsual in op_delete()
644 && !oap->block_mode in op_delete()
645 && oap->line_count > 1 in op_delete()
646 && oap->motion_force == NUL in op_delete()
647 && oap->op_type == OP_DELETE) in op_delete()
649 ptr = ml_get(oap->end.lnum) + oap->end.col; in op_delete()
651 ptr += oap->inclusive; in op_delete()
654 oap->motion_type = MLINE; in op_delete()
661 if ( oap->motion_type == MCHAR in op_delete()
662 && oap->line_count == 1 in op_delete()
663 && oap->op_type == OP_DELETE in op_delete()
664 && *ml_get(oap->start.lnum) == NUL) in op_delete()
684 if (oap->regname != '_') in op_delete()
686 if (oap->regname != 0) in op_delete()
689 if (!valid_yank_reg(oap->regname, TRUE)) in op_delete()
694 get_yank_register(oap->regname, TRUE); // yank into specif'd reg. in op_delete()
695 if (op_yank(oap, TRUE, FALSE) == OK) // yank without message in op_delete()
708 if (oap->motion_type == MLINE || oap->line_count > 1 in op_delete()
709 || oap->use_reg_one) in op_delete()
712 if (op_yank(oap, TRUE, FALSE) == OK) in op_delete()
720 ((clip_unnamed & CLIP_UNNAMED) && oap->regname == '*') || in op_delete()
721 ((clip_unnamed & CLIP_UNNAMED_PLUS) && oap->regname == '+') || in op_delete()
723 oap->regname == 0) && oap->motion_type != MLINE in op_delete()
724 && oap->line_count == 1) in op_delete()
726 oap->regname = '-'; in op_delete()
727 get_yank_register(oap->regname, TRUE); in op_delete()
728 if (op_yank(oap, TRUE, FALSE) == OK) in op_delete()
730 oap->regname = 0; in op_delete()
755 yank_do_autocmd(oap, get_y_current()); in op_delete()
762 if (oap->block_mode) in op_delete()
764 if (u_save((linenr_T)(oap->start.lnum - 1), in op_delete()
765 (linenr_T)(oap->end.lnum + 1)) == FAIL) in op_delete()
768 for (lnum = curwin->w_cursor.lnum; lnum <= oap->end.lnum; ++lnum) in op_delete()
770 block_prep(oap, &bd, lnum, TRUE); in op_delete()
808 oap->end.lnum + 1, 0L); in op_delete()
809 oap->line_count = 0; // no lines deleted in op_delete()
811 else if (oap->motion_type == MLINE) in op_delete()
813 if (oap->op_type == OP_CHANGE) in op_delete()
818 if (oap->line_count > 1) in op_delete()
822 del_lines((long)(oap->line_count - 1), TRUE); in op_delete()
837 if (oap->line_count > 1) in op_delete()
842 del_lines(oap->line_count, TRUE); in op_delete()
854 if (gchar_pos(&oap->start) == '\t') in op_delete()
858 if (oap->line_count == 1) in op_delete()
859 endcol = getviscol2(oap->end.col, oap->end.coladd); in op_delete()
860 coladvance_force(getviscol2(oap->start.col, oap->start.coladd)); in op_delete()
861 oap->start = curwin->w_cursor; in op_delete()
862 if (oap->line_count == 1) 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()
872 if (gchar_pos(&oap->end) == '\t' in op_delete()
873 && (int)oap->end.coladd < oap->inclusive) in op_delete()
876 if (u_save((linenr_T)(oap->end.lnum - 1), in op_delete()
877 (linenr_T)(oap->end.lnum + 1)) == FAIL) in op_delete()
879 curwin->w_cursor = oap->end; in op_delete()
880 coladvance_force(getviscol2(oap->end.col, oap->end.coladd)); in op_delete()
881 oap->end = curwin->w_cursor; in op_delete()
882 curwin->w_cursor = oap->start; in op_delete()
885 mb_adjust_opend(oap); in op_delete()
888 if (oap->line_count == 1) // delete characters within one line in op_delete()
895 && oap->op_type == OP_CHANGE in op_delete()
896 && oap->end.lnum == curwin->w_cursor.lnum in op_delete()
897 && !oap->is_VIsual) in op_delete()
898 display_dollar(oap->end.col - !oap->inclusive); in op_delete()
900 n = oap->end.col - oap->start.col + 1 - !oap->inclusive; in op_delete()
909 if (oap->end.coladd != 0 in op_delete()
910 && (int)oap->end.col >= len - 1 in op_delete()
911 && !(oap->start.coladd && (int)oap->end.col >= len - 1)) in op_delete()
914 if (n == 0 && oap->start.coladd != oap->end.coladd) in op_delete()
922 oap->op_type == OP_DELETE && !oap->is_VIsual); in op_delete()
930 (linenr_T)(curwin->w_cursor.lnum + oap->line_count)) == FAIL) in op_delete()
937 del_lines((long)(oap->line_count - 2), FALSE); in op_delete()
940 n = (oap->end.col + 1 - !oap->inclusive); in op_delete()
943 oap->op_type == OP_DELETE && !oap->is_VIsual); in op_delete()
947 if (oap->op_type == OP_DELETE) in op_delete()
956 if (oap->block_mode) in op_delete()
958 curbuf->b_op_end.lnum = oap->end.lnum; in op_delete()
959 curbuf->b_op_end.col = oap->start.col; in op_delete()
962 curbuf->b_op_end = oap->start; in op_delete()
963 curbuf->b_op_start = oap->start; in op_delete()
974 mb_adjust_opend(oparg_T *oap) in mb_adjust_opend() argument
978 if (oap->inclusive) in mb_adjust_opend()
980 p = ml_get(oap->end.lnum); in mb_adjust_opend()
981 oap->end.col += mb_tail_off(p, p + oap->end.col); in mb_adjust_opend()
1005 op_replace(oparg_T *oap, int c) in op_replace() argument
1015 if ((curbuf->b_ml.ml_flags & ML_EMPTY ) || oap->empty) in op_replace()
1030 mb_adjust_opend(oap); in op_replace()
1032 if (u_save((linenr_T)(oap->start.lnum - 1), in op_replace()
1033 (linenr_T)(oap->end.lnum + 1)) == FAIL) in op_replace()
1039 if (oap->block_mode) in op_replace()
1042 for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum) in op_replace()
1045 block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); in op_replace()
1059 getvpos(&vpos, oap->start_vcol); in op_replace()
1072 numc = oap->end_vcol - oap->start_vcol + 1; in op_replace()
1074 numc -= (oap->end_vcol - bd.end_vcol) + 1; in op_replace()
1139 oap->end.lnum++; in op_replace()
1149 if (oap->motion_type == MLINE) in op_replace()
1151 oap->start.col = 0; in op_replace()
1153 oap->end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum)); in op_replace()
1154 if (oap->end.col) in op_replace()
1155 --oap->end.col; in op_replace()
1157 else if (!oap->inclusive) in op_replace()
1158 dec(&(oap->end)); 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()
1170 oap->end.col += (*mb_char2len)(c) - (*mb_char2len)(n); in op_replace()
1179 if (curwin->w_cursor.lnum == oap->end.lnum) in op_replace()
1183 end_vcol = getviscol2(oap->end.col, in op_replace()
1184 oap->end.coladd); in op_replace()
1187 if (curwin->w_cursor.lnum == oap->end.lnum) in op_replace()
1188 getvpos(&oap->end, end_vcol); in op_replace()
1193 else if (virtual_op && curwin->w_cursor.lnum == oap->end.lnum) in op_replace()
1195 int virtcols = oap->end.coladd; in op_replace()
1197 if (curwin->w_cursor.lnum == oap->start.lnum in op_replace()
1198 && oap->start.col == oap->end.col && oap->start.coladd) in op_replace()
1199 virtcols -= oap->start.coladd; in op_replace()
1204 coladvance_force(getviscol2(oap->end.col, oap->end.coladd) + 1); in op_replace()
1223 curwin->w_cursor = oap->start; in op_replace()
1225 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, 0L); in op_replace()
1230 curbuf->b_op_start = oap->start; in op_replace()
1231 curbuf->b_op_end = oap->end; in op_replace()
1243 op_tilde(oparg_T *oap) in op_tilde() argument
1249 if (u_save((linenr_T)(oap->start.lnum - 1), in op_tilde()
1250 (linenr_T)(oap->end.lnum + 1)) == FAIL) in op_tilde()
1253 pos = oap->start; in op_tilde()
1254 if (oap->block_mode) // Visual block mode in op_tilde()
1256 for (; pos.lnum <= oap->end.lnum; ++pos.lnum) in op_tilde()
1260 block_prep(oap, &bd, pos.lnum, FALSE); in op_tilde()
1262 one_change = swapchars(oap->op_type, &pos, bd.textlen); in op_tilde()
1278 changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L); in op_tilde()
1282 if (oap->motion_type == MLINE) in op_tilde()
1284 oap->start.col = 0; in op_tilde()
1286 oap->end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum)); in op_tilde()
1287 if (oap->end.col) in op_tilde()
1288 --oap->end.col; in op_tilde()
1290 else if (!oap->inclusive) in op_tilde()
1291 dec(&(oap->end)); in op_tilde()
1293 if (pos.lnum == oap->end.lnum) in op_tilde()
1294 did_change = swapchars(oap->op_type, &pos, in op_tilde()
1295 oap->end.col - pos.col + 1); in op_tilde()
1299 did_change |= swapchars(oap->op_type, &pos, in op_tilde()
1300 pos.lnum == oap->end.lnum ? oap->end.col + 1: in op_tilde()
1302 if (LTOREQ_POS(oap->end, pos) || inc(&pos) == -1) in op_tilde()
1307 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, in op_tilde()
1315 pos = oap->start; in op_tilde()
1316 while (pos.lnum < oap->end.lnum) in op_tilde()
1327 count = oap->end.col - pos.col + 1; in op_tilde()
1336 if (!did_change && oap->is_VIsual) in op_tilde()
1343 curbuf->b_op_start = oap->start; in op_tilde()
1344 curbuf->b_op_end = oap->end; in op_tilde()
1347 if (oap->line_count > p_report) in op_tilde()
1349 oap->line_count), oap->line_count); in op_tilde()
1455 op_insert(oparg_T *oap, long count1) in op_insert() argument
1471 curwin->w_cursor.lnum = oap->start.lnum; in op_insert()
1474 if (oap->block_mode) in op_insert()
1491 coladvance_force(oap->op_type == OP_APPEND in op_insert()
1492 ? oap->end_vcol + 1 : getviscol()); in op_insert()
1493 if (oap->op_type == OP_APPEND) in op_insert()
1498 block_prep(oap, &bd, oap->start.lnum, TRUE); in op_insert()
1501 firstline = ml_get(oap->start.lnum) + bd.textcol; in op_insert()
1503 if (oap->op_type == OP_APPEND) in op_insert()
1508 if (oap->op_type == OP_APPEND) in op_insert()
1510 if (oap->block_mode && curwin->w_cursor.coladd == 0) in op_insert()
1530 curwin->w_cursor = oap->end; in op_insert()
1535 && oap->start_vcol != oap->end_vcol) in op_insert()
1540 t1 = oap->start; in op_insert()
1549 oap->start = curbuf->b_op_start_orig; in op_insert()
1554 if (curwin->w_cursor.lnum != oap->start.lnum || got_int) in op_insert()
1557 if (oap->block_mode) in op_insert()
1577 if (oap->start.lnum == curbuf->b_op_start_orig.lnum in op_insert()
1585 if (oap->op_type == OP_INSERT in op_insert()
1586 && oap->start.col + oap->start.coladd in op_insert()
1590 oap->start.col = curbuf->b_op_start_orig.col; in op_insert()
1591 pre_textlen -= t - oap->start_vcol; in op_insert()
1592 oap->start_vcol = t; in op_insert()
1594 else if (oap->op_type == OP_APPEND in op_insert()
1595 && oap->end.col + oap->end.coladd in op_insert()
1599 oap->start.col = curbuf->b_op_start_orig.col; in op_insert()
1602 pre_textlen -= t - oap->start_vcol; in op_insert()
1603 oap->start_vcol = t; in op_insert()
1604 oap->op_type = OP_INSERT; in op_insert()
1607 else if (bd.is_MAX && oap->op_type == OP_APPEND) in op_insert()
1611 pre_textlen -= t - oap->start_vcol; in op_insert()
1620 block_prep(oap, &bd2, oap->start.lnum, TRUE); in op_insert()
1623 if (oap->op_type == OP_APPEND) in op_insert()
1637 firstline = ml_get(oap->start.lnum); in op_insert()
1640 if (oap->op_type == OP_APPEND) in op_insert()
1650 if (oap->end_vcol > offset) in op_insert()
1651 oap->end_vcol -= (offset + 1); in op_insert()
1668 if (u_save(oap->start.lnum, in op_insert()
1669 (linenr_T)(oap->end.lnum + 1)) == OK) in op_insert()
1670 block_insert(oap, ins_text, (oap->op_type == OP_INSERT), in op_insert()
1673 curwin->w_cursor.col = oap->start.col; in op_insert()
1687 op_change(oparg_T *oap) in op_change() argument
1700 l = oap->start.col; in op_change()
1701 if (oap->motion_type == MLINE) in op_change()
1721 else if (op_delete(oap) == FAIL) in op_change()
1730 if (oap->block_mode) in op_change()
1736 firstline = ml_get(oap->start.lnum); in op_change()
1743 if (oap->motion_type == MLINE) in op_change()
1754 if (oap->block_mode && oap->start.lnum != oap->end.lnum && !got_int) in op_change()
1758 firstline = ml_get(oap->start.lnum); in op_change()
1775 for (linenr = oap->start.lnum + 1; linenr <= oap->end.lnum; in op_change()
1778 block_prep(oap, &bd, linenr, TRUE); in op_change()
1788 (void)getvpos(&vpos, oap->start_vcol); in op_change()
1810 changed_lines(oap->start.lnum + 1, 0, oap->end.lnum + 1, 0L); in op_change()
2188 oparg_T *oap, in block_prep() argument
2220 while (bdp->start_vcol < oap->start_vcol && *pstart) in block_prep()
2239 if (bdp->start_vcol < oap->start_vcol) // line too short in block_prep()
2243 if (!is_del || oap->op_type == OP_APPEND) in block_prep()
2244 bdp->endspaces = oap->end_vcol - oap->start_vcol + 1; in block_prep()
2250 bdp->startspaces = bdp->start_vcol - oap->start_vcol; in block_prep()
2255 if (bdp->end_vcol > oap->end_vcol) // it's all in one character in block_prep()
2258 if (oap->op_type == OP_INSERT) in block_prep()
2260 else if (oap->op_type == OP_APPEND) in block_prep()
2262 bdp->startspaces += oap->end_vcol - oap->start_vcol + 1; in block_prep()
2267 bdp->startspaces = oap->end_vcol - oap->start_vcol + 1; in block_prep()
2268 if (is_del && oap->op_type != OP_LSHIFT) in block_prep()
2274 - (bdp->start_vcol - oap->start_vcol); in block_prep()
2275 bdp->endspaces = bdp->end_vcol - oap->end_vcol - 1; in block_prep()
2282 while (bdp->end_vcol <= oap->end_vcol && *pend != NUL) in block_prep()
2289 if (bdp->end_vcol <= oap->end_vcol in block_prep()
2291 || oap->op_type == OP_APPEND in block_prep()
2292 || oap->op_type == OP_REPLACE)) // line too short in block_prep()
2299 if (oap->op_type == OP_APPEND || virtual_op) in block_prep()
2300 bdp->endspaces = oap->end_vcol - bdp->end_vcol in block_prep()
2301 + oap->inclusive; in block_prep()
2305 else if (bdp->end_vcol > oap->end_vcol) in block_prep()
2307 bdp->endspaces = bdp->end_vcol - oap->end_vcol - 1; in block_prep()
2333 oparg_T *oap, in op_addsub() argument
2359 change_cnt = do_addsub(oap->op_type, &pos, 0, amount); in op_addsub()
2372 if (u_save((linenr_T)(oap->start.lnum - 1), in op_addsub()
2373 (linenr_T)(oap->end.lnum + 1)) == FAIL) in op_addsub()
2381 pos = oap->start; in op_addsub()
2382 for (; pos.lnum <= oap->end.lnum; ++pos.lnum) in op_addsub()
2384 if (oap->block_mode) // Visual block mode in op_addsub()
2386 block_prep(oap, &bd, pos.lnum, FALSE); in op_addsub()
2390 else if (oap->motion_type == MLINE) in op_addsub()
2398 if (pos.lnum == oap->start.lnum && !oap->inclusive) in op_addsub()
2399 dec(&(oap->end)); in op_addsub()
2402 if (pos.lnum == oap->start.lnum) in op_addsub()
2404 pos.col += oap->start.col; in op_addsub()
2405 length -= oap->start.col; in op_addsub()
2407 if (pos.lnum == oap->end.lnum) in op_addsub()
2409 length = (int)STRLEN(ml_get(oap->end.lnum)); in op_addsub()
2410 if (oap->end.col >= length) in op_addsub()
2411 oap->end.col = length - 1; in op_addsub()
2412 length = oap->end.col - pos.col + 1; in op_addsub()
2415 one_change = do_addsub(oap->op_type, &pos, length, amount); in op_addsub()
2443 changed_lines(oap->start.lnum, 0, oap->end.lnum + 1, 0L); in op_addsub()
2445 if (!change_cnt && oap->is_VIsual) in op_addsub()
2919 clear_oparg(oparg_T *oap) in clear_oparg() argument
2921 CLEAR_POINTER(oap); in clear_oparg()
3254 op_colon(oparg_T *oap) in op_colon() argument
3257 if (oap->is_VIsual) in op_colon()
3262 if (oap->start.lnum == curwin->w_cursor.lnum) in op_colon()
3265 stuffnumReadbuff((long)oap->start.lnum); in op_colon()
3266 if (oap->end.lnum != oap->start.lnum) in op_colon()
3269 if (oap->end.lnum == curwin->w_cursor.lnum) in op_colon()
3271 else if (oap->end.lnum == curbuf->b_ml.ml_line_count) in op_colon()
3273 else if (oap->start.lnum == curwin->w_cursor.lnum) in op_colon()
3276 stuffnumReadbuff((long)oap->line_count - 1); in op_colon()
3279 stuffnumReadbuff((long)oap->end.lnum); in op_colon()
3282 if (oap->op_type != OP_COLON) in op_colon()
3284 if (oap->op_type == OP_INDENT) in op_colon()
3294 else if (oap->op_type == OP_FORMAT) in op_colon()
3335 op_function(oparg_T *oap UNUSED) in op_function()
3350 curbuf->b_op_start = oap->start; in op_function()
3351 curbuf->b_op_end = oap->end; in op_function()
3352 if (oap->motion_type != MLINE && !oap->inclusive) in op_function()
3357 if (oap->block_mode) in op_function()
3359 else if (oap->motion_type == MLINE) in op_function()
3393 oparg_T *oap, in get_op_vcol() argument
3400 || (!initial && oap->end.col < curwin->w_width)) in get_op_vcol()
3403 oap->block_mode = TRUE; in get_op_vcol()
3407 mb_adjustpos(curwin->w_buffer, &oap->end); in get_op_vcol()
3409 getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol); in get_op_vcol()
3413 getvvcol(curwin, &(oap->end), &start, NULL, &end); in get_op_vcol()
3415 if (start < oap->start_vcol) in get_op_vcol()
3416 oap->start_vcol = start; in get_op_vcol()
3417 if (end > oap->end_vcol) in get_op_vcol()
3420 && start - 1 >= oap->end_vcol) in get_op_vcol()
3421 oap->end_vcol = start - 1; in get_op_vcol()
3423 oap->end_vcol = end; in get_op_vcol()
3431 oap->end_vcol = 0; 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()
3437 if (end > oap->end_vcol) in get_op_vcol()
3438 oap->end_vcol = end; in get_op_vcol()
3442 oap->end_vcol = oap->start_vcol + redo_VIsual_vcol - 1; in get_op_vcol()
3448 curwin->w_cursor.lnum = oap->end.lnum; in get_op_vcol()
3449 coladvance(oap->end_vcol); in get_op_vcol()
3450 oap->end = curwin->w_cursor; in get_op_vcol()
3452 curwin->w_cursor = oap->start; in get_op_vcol()
3453 coladvance(oap->start_vcol); in get_op_vcol()
3454 oap->start = curwin->w_cursor; in get_op_vcol()
3464 oparg_T *oap = cap->oap; in do_pending_operator() local
3487 && oap->op_type != OP_NOP in do_pending_operator()
3491 && oap->regname == 0) in do_pending_operator()
3497 if ((finish_op || VIsual_active) && oap->op_type != OP_NOP) in do_pending_operator()
3509 oap->is_VIsual = VIsual_active; in do_pending_operator()
3510 if (oap->motion_force == 'V') in do_pending_operator()
3511 oap->motion_type = MLINE; in do_pending_operator()
3512 else if (oap->motion_force == 'v') in do_pending_operator()
3516 if (oap->motion_type == MLINE) in do_pending_operator()
3517 oap->inclusive = FALSE; in do_pending_operator()
3519 else if (oap->motion_type == MCHAR) in do_pending_operator()
3520 oap->inclusive = !oap->inclusive; in do_pending_operator()
3521 oap->motion_type = MCHAR; in do_pending_operator()
3523 else if (oap->motion_force == Ctrl_V) in do_pending_operator()
3529 VIsual = oap->start; in do_pending_operator()
3538 if ((redo_yank || oap->op_type != OP_YANK) in do_pending_operator()
3539 && ((!VIsual_active || oap->motion_force) in do_pending_operator()
3543 && oap->op_type != OP_COLON)) in do_pending_operator()
3546 && oap->op_type != OP_FOLD in do_pending_operator()
3547 && oap->op_type != OP_FOLDOPEN in do_pending_operator()
3548 && oap->op_type != OP_FOLDOPENREC in do_pending_operator()
3549 && oap->op_type != OP_FOLDCLOSE in do_pending_operator()
3550 && oap->op_type != OP_FOLDCLOSEREC in do_pending_operator()
3551 && oap->op_type != OP_FOLDDEL in do_pending_operator()
3552 && oap->op_type != OP_FOLDDELREC in do_pending_operator()
3556 prep_redo(oap->regname, cap->count0, in do_pending_operator()
3557 get_op_char(oap->op_type), get_extra_op_char(oap->op_type), in do_pending_operator()
3558 oap->motion_force, cap->cmdchar, cap->nchar); in do_pending_operator()
3587 oap->start = curwin->w_cursor; in do_pending_operator()
3636 && cap->oap->op_type != OP_DELETE) in do_pending_operator()
3656 oap->start = VIsual; in do_pending_operator()
3659 oap->start.col = 0; in do_pending_operator()
3660 oap->start.coladd = 0; in do_pending_operator()
3666 if (LT_POS(oap->start, curwin->w_cursor)) in do_pending_operator()
3672 if (hasFolding(oap->start.lnum, &oap->start.lnum, NULL)) in do_pending_operator()
3673 oap->start.col = 0; in do_pending_operator()
3674 if ((curwin->w_cursor.col > 0 || oap->inclusive in do_pending_operator()
3675 || oap->motion_type == MLINE) in do_pending_operator()
3681 oap->end = curwin->w_cursor; in do_pending_operator()
3682 curwin->w_cursor = oap->start; in do_pending_operator()
3693 if (!VIsual_active && oap->motion_type == MLINE) in do_pending_operator()
3698 if (hasFolding(oap->start.lnum, NULL, &oap->start.lnum)) in do_pending_operator()
3699 oap->start.col = (colnr_T)STRLEN(ml_get(oap->start.lnum)); in do_pending_operator()
3702 oap->end = oap->start; in do_pending_operator()
3703 oap->start = curwin->w_cursor; in do_pending_operator()
3707 check_pos(curwin->w_buffer, &oap->end); in do_pending_operator()
3708 oap->line_count = oap->end.lnum - oap->start.lnum + 1; in do_pending_operator()
3715 get_op_vcol(oap, redo_VIsual_vcol, TRUE); in do_pending_operator()
3727 getvvcol(curwin, &(oap->end), in do_pending_operator()
3728 NULL, NULL, &oap->end_vcol); in do_pending_operator()
3729 if (VIsual_mode == Ctrl_V || oap->line_count <= 1) in do_pending_operator()
3732 getvvcol(curwin, &(oap->start), in do_pending_operator()
3733 &oap->start_vcol, NULL, NULL); in do_pending_operator()
3734 resel_VIsual_vcol = oap->end_vcol - oap->start_vcol + 1; in do_pending_operator()
3737 resel_VIsual_vcol = oap->end_vcol; in do_pending_operator()
3739 resel_VIsual_line_count = oap->line_count; in do_pending_operator()
3743 if ((redo_yank || oap->op_type != OP_YANK) in do_pending_operator()
3744 && oap->op_type != OP_COLON in do_pending_operator()
3746 && oap->op_type != OP_FOLD in do_pending_operator()
3747 && oap->op_type != OP_FOLDOPEN in do_pending_operator()
3748 && oap->op_type != OP_FOLDOPENREC in do_pending_operator()
3749 && oap->op_type != OP_FOLDCLOSE in do_pending_operator()
3750 && oap->op_type != OP_FOLDCLOSEREC in do_pending_operator()
3751 && oap->op_type != OP_FOLDDEL in do_pending_operator()
3752 && oap->op_type != OP_FOLDDELREC in do_pending_operator()
3754 && oap->motion_force == NUL in do_pending_operator()
3761 prep_redo(oap->regname, cap->count0, in do_pending_operator()
3762 get_op_char(oap->op_type), in do_pending_operator()
3763 get_extra_op_char(oap->op_type), in do_pending_operator()
3764 oap->motion_force, cap->cmdchar, cap->nchar); in do_pending_operator()
3767 int nchar = oap->op_type == OP_REPLACE ? cap->nchar : NUL; in do_pending_operator()
3774 prep_redo(oap->regname, 0L, NUL, 'v', in do_pending_operator()
3775 get_op_char(oap->op_type), in do_pending_operator()
3776 get_extra_op_char(oap->op_type), in do_pending_operator()
3792 if (oap->motion_force == NUL || oap->motion_type == MLINE) in do_pending_operator()
3793 oap->inclusive = TRUE; in do_pending_operator()
3795 oap->motion_type = MLINE; in do_pending_operator()
3798 oap->motion_type = MCHAR; in do_pending_operator()
3799 if (VIsual_mode != Ctrl_V && *ml_get_pos(&(oap->end)) == NUL in do_pending_operator()
3802 oap->inclusive = FALSE; in do_pending_operator()
3806 && !op_on_lines(oap->op_type) in do_pending_operator()
3807 && oap->end.lnum < curbuf->b_ml.ml_line_count) in do_pending_operator()
3809 ++oap->end.lnum; in do_pending_operator()
3810 oap->end.col = 0; in do_pending_operator()
3811 oap->end.coladd = 0; in do_pending_operator()
3812 ++oap->line_count; in do_pending_operator()
3830 if ((oap->op_type == OP_YANK in do_pending_operator()
3831 || oap->op_type == OP_COLON in do_pending_operator()
3832 || oap->op_type == OP_FUNCTION in do_pending_operator()
3833 || oap->op_type == OP_FILTER) in do_pending_operator()
3834 && oap->motion_force == NUL) in do_pending_operator()
3846 if (has_mbyte && oap->inclusive) in do_pending_operator()
3850 l = (*mb_ptr2len)(ml_get_pos(&oap->end)); in do_pending_operator()
3852 oap->end.col += l - 1; in do_pending_operator()
3858 oap->empty = (oap->motion_type == MCHAR in do_pending_operator()
3859 && (!oap->inclusive in do_pending_operator()
3860 || (oap->op_type == OP_YANK in do_pending_operator()
3861 && gchar_pos(&oap->end) == NUL)) in do_pending_operator()
3862 && EQUAL_POS(oap->start, oap->end) in do_pending_operator()
3863 && !(virtual_op && oap->start.coladd != oap->end.coladd)); in do_pending_operator()
3866 empty_region_error = (oap->empty in do_pending_operator()
3871 if (oap->is_VIsual && (oap->empty || !curbuf->b_p_ma in do_pending_operator()
3873 || oap->op_type == OP_FOLD in do_pending_operator()
3888 if ( oap->motion_type == MCHAR in do_pending_operator()
3889 && oap->inclusive == FALSE in do_pending_operator()
3891 && oap->end.col == 0 in do_pending_operator()
3892 && (!oap->is_VIsual || *p_sel == 'o') in do_pending_operator()
3893 && !oap->block_mode in do_pending_operator()
3894 && oap->line_count > 1) in do_pending_operator()
3896 oap->end_adjusted = TRUE; // remember that we did this in do_pending_operator()
3897 --oap->line_count; in do_pending_operator()
3898 --oap->end.lnum; in do_pending_operator()
3900 oap->motion_type = MLINE; in do_pending_operator()
3903 oap->end.col = (colnr_T)STRLEN(ml_get(oap->end.lnum)); in do_pending_operator()
3904 if (oap->end.col) in do_pending_operator()
3906 --oap->end.col; in do_pending_operator()
3907 oap->inclusive = TRUE; in do_pending_operator()
3912 oap->end_adjusted = FALSE; in do_pending_operator()
3914 switch (oap->op_type) in do_pending_operator()
3918 op_shift(oap, TRUE, oap->is_VIsual ? (int)cap->count1 : 1); in do_pending_operator()
3924 if (oap->line_count < 2) in do_pending_operator()
3925 oap->line_count = 2; in do_pending_operator()
3926 if (curwin->w_cursor.lnum + oap->line_count - 1 > in do_pending_operator()
3931 (void)do_join(oap->line_count, oap->op_type == OP_JOIN, in do_pending_operator()
3946 (void)op_delete(oap); in do_pending_operator()
3948 if (oap->motion_type == MLINE && has_format_option(FO_AUTO) in do_pending_operator()
3968 oap->excl_tr_ws = cap->cmdchar == 'z'; in do_pending_operator()
3969 (void)op_yank(oap, FALSE, !gui_yank); in do_pending_operator()
3999 if (op_change(oap)) // will call edit() in do_pending_operator()
4018 if (oap->op_type == OP_INDENT && *get_equalprg() == NUL) in do_pending_operator()
4023 op_reindent(oap, get_lisp_indent); in do_pending_operator()
4028 op_reindent(oap, in do_pending_operator()
4038 op_colon(oap); in do_pending_operator()
4051 op_tilde(oap); in do_pending_operator()
4058 op_formatexpr(oap); // use expression in do_pending_operator()
4063 op_colon(oap); // use external command in do_pending_operator()
4065 op_format(oap, FALSE); // use internal function in do_pending_operator()
4069 op_format(oap, TRUE); // use internal function in do_pending_operator()
4078 op_function(oap); // call 'operatorfunc' in do_pending_operator()
4101 op_insert(oap, cap->count1); in do_pending_operator()
4132 op_replace(oap, cap->nchar); in do_pending_operator()
4139 foldCreate(oap->start.lnum, oap->end.lnum); in do_pending_operator()
4147 opFoldRange(oap->start.lnum, oap->end.lnum, in do_pending_operator()
4148 oap->op_type == OP_FOLDOPEN in do_pending_operator()
4149 || oap->op_type == OP_FOLDOPENREC, in do_pending_operator()
4150 oap->op_type == OP_FOLDOPENREC in do_pending_operator()
4151 || oap->op_type == OP_FOLDCLOSEREC, in do_pending_operator()
4152 oap->is_VIsual); in do_pending_operator()
4158 deleteFold(oap->start.lnum, oap->end.lnum, in do_pending_operator()
4159 oap->op_type == OP_FOLDDELREC, oap->is_VIsual); in do_pending_operator()
4175 op_addsub(oap, cap->count1, redo_VIsual_arg); in do_pending_operator()
4181 clearopbeep(oap); in do_pending_operator()
4187 if (!p_sol && oap->motion_type == MLINE && !oap->end_adjusted in do_pending_operator()
4188 && (oap->op_type == OP_LSHIFT || oap->op_type == OP_RSHIFT in do_pending_operator()
4189 || oap->op_type == OP_DELETE)) in do_pending_operator()
4201 oap->block_mode = FALSE; in do_pending_operator()
4202 clearop(oap); in do_pending_operator()