Lines Matching refs:curwin

491     int		old_col = curwin->w_curswant;  in normal_cmd()
790 if (curwin->w_p_rl && KeyTyped && !KeyStuffed in normal_cmd()
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()
1250 if (curwin->w_p_scb && toplevel) in normal_cmd()
1256 if (curwin->w_p_crb && toplevel) in normal_cmd()
1398 curbuf->b_visual.vi_end = curwin->w_cursor; in end_visual_mode_keep_button()
1399 curbuf->b_visual.vi_curswant = curwin->w_curswant; 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()
1847 char_u *saved_w_sbr = curwin->w_p_sbr; in clear_showcmd()
1851 curwin->w_p_sbr = empty_option; in clear_showcmd()
1853 getvcols(curwin, &curwin->w_cursor, &VIsual, &leftcol, &rightcol); in clear_showcmd()
1856 curwin->w_p_sbr = saved_w_sbr; in clear_showcmd()
1861 else if (VIsual_mode == 'V' || VIsual.lnum != curwin->w_cursor.lnum) in clear_showcmd()
2067 if (check && curwin->w_p_scb) in do_check_scrollbind()
2073 else if (curwin == old_curwin) in do_check_scrollbind()
2080 if ((curwin->w_buffer == old_buf in do_check_scrollbind()
2082 || curwin->w_p_diff in do_check_scrollbind()
2085 && (curwin->w_topline != old_topline in do_check_scrollbind()
2087 || curwin->w_topfill != old_topfill in do_check_scrollbind()
2089 || curwin->w_leftcol != old_leftcol)) in do_check_scrollbind()
2091 check_scrollbind(curwin->w_topline - old_topline, in do_check_scrollbind()
2092 (long)(curwin->w_leftcol - old_leftcol)); in do_check_scrollbind()
2107 check_scrollbind(curwin->w_topline - curwin->w_scbind_pos, 0L); in do_check_scrollbind()
2109 curwin->w_scbind_pos = curwin->w_topline; in do_check_scrollbind()
2112 old_curwin = curwin; in do_check_scrollbind()
2113 old_topline = curwin->w_topline; in do_check_scrollbind()
2115 old_topfill = curwin->w_topfill; in do_check_scrollbind()
2117 old_buf = curwin->w_buffer; in do_check_scrollbind()
2118 old_leftcol = curwin->w_leftcol; in do_check_scrollbind()
2131 win_T *old_curwin = curwin; in check_scrollbind()
2135 colnr_T tgt_leftcol = curwin->w_leftcol; in check_scrollbind()
2152 FOR_ALL_WINDOWS(curwin) in check_scrollbind()
2154 curbuf = curwin->w_buffer; in check_scrollbind()
2156 if (curwin != old_curwin && curwin->w_p_scb) in check_scrollbind()
2164 if (old_curwin->w_p_diff && curwin->w_p_diff) in check_scrollbind()
2166 diff_set_topline(old_curwin, curwin); in check_scrollbind()
2171 curwin->w_scbind_pos += topline_diff; in check_scrollbind()
2172 topline = curwin->w_scbind_pos; in check_scrollbind()
2178 y = topline - curwin->w_topline; in check_scrollbind()
2187 curwin->w_redr_status = TRUE; in check_scrollbind()
2193 if (want_hor && curwin->w_leftcol != tgt_leftcol) in check_scrollbind()
2195 curwin->w_leftcol = tgt_leftcol; in check_scrollbind()
2206 curwin = old_curwin; in check_scrollbind()
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()
2512 curwin->w_set_curswant = TRUE; in find_decl()
2544 oap->inclusive = (curwin->w_curswant == MAXCOL); in nv_screengo()
2548 width1 = curwin->w_width - col_off1; in nv_screengo()
2549 width2 = curwin->w_width - col_off2; in nv_screengo()
2553 if (curwin->w_width != 0) in nv_screengo()
2559 if (curwin->w_curswant == MAXCOL) in nv_screengo()
2564 curwin->w_curswant = 0; in nv_screengo()
2567 curwin->w_curswant = width1 - 1; in nv_screengo()
2568 if (curwin->w_virtcol > curwin->w_curswant) in nv_screengo()
2569 curwin->w_curswant += ((curwin->w_virtcol in nv_screengo()
2570 - curwin->w_curswant - 1) / width2 + 1) * width2; in nv_screengo()
2579 if (curwin->w_curswant >= (colnr_T)n) in nv_screengo()
2580 curwin->w_curswant = n - 1; in nv_screengo()
2587 if ((long)curwin->w_curswant >= width1 in nv_screengo()
2589 && !hasFolding(curwin->w_cursor.lnum, NULL, NULL) in nv_screengo()
2595 curwin->w_curswant -= width2; 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()
2615 curwin->w_curswant += (((linelen - width1 - 1) / width2) in nv_screengo()
2625 if (curwin->w_curswant + width2 < (colnr_T)n in nv_screengo()
2627 && !hasFolding(curwin->w_cursor.lnum, NULL, NULL) in nv_screengo()
2631 curwin->w_curswant += width2; 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()
2646 curwin->w_curswant %= width2; in nv_screengo()
2651 if (curwin->w_curswant >= width1) in nv_screengo()
2652 curwin->w_curswant -= width2; in nv_screengo()
2662 coladvance(curwin->w_curswant); in nv_screengo()
2664 if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) in nv_screengo()
2675 virtcol = curwin->w_virtcol; in nv_screengo()
2677 if (virtcol > (colnr_T)width1 && *get_showbreak_value(curwin) != NUL) in nv_screengo()
2678 virtcol -= vim_strsize(get_showbreak_value(curwin)); in nv_screengo()
2682 if (dir == FORWARD && virtcol < curwin->w_curswant in nv_screengo()
2683 && (curwin->w_curswant <= (colnr_T)width1) in nv_screengo()
2687 if (virtcol > curwin->w_curswant in nv_screengo()
2688 && (curwin->w_curswant < (colnr_T)width1 in nv_screengo()
2689 ? (curwin->w_curswant > (colnr_T)width1 / 2) in nv_screengo()
2690 : ((curwin->w_curswant - width1) % width2 in nv_screengo()
2692 --curwin->w_cursor.col; in nv_screengo()
2696 curwin->w_curswant = MAXCOL; // stick in the last column in nv_screengo()
2718 linenr_T prev_topline = curwin->w_topline; in scroll_redraw()
2720 int prev_topfill = curwin->w_topfill; in scroll_redraw()
2722 linenr_T prev_lnum = curwin->w_cursor.lnum; in scroll_redraw()
2733 check_cursor_moved(curwin); in scroll_redraw()
2734 curwin->w_valid |= VALID_TOPLINE; in scroll_redraw()
2739 while (curwin->w_topline == prev_topline in scroll_redraw()
2741 && curwin->w_topfill == prev_topfill 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()
2760 check_cursor_moved(curwin); in scroll_redraw()
2761 curwin->w_valid |= VALID_TOPLINE; in scroll_redraw()
2764 if (curwin->w_cursor.lnum != prev_lnum) in scroll_redraw()
2765 coladvance(curwin->w_curswant); in scroll_redraw()
2779 long old_fdl = curwin->w_p_fdl; in nv_zet()
2780 int old_fen = curwin->w_p_fen; in nv_zet()
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()
2877 if (curwin->w_botline > curbuf->b_ml.ml_line_count) 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()
2891 set_fraction(curwin); in nv_zet()
2900 set_fraction(curwin); in nv_zet()
2910 curwin->w_cursor.lnum = curwin->w_topline; in nv_zet()
2912 else if (curwin->w_topline == 1) in nv_zet()
2913 curwin->w_cursor.lnum = 1; in nv_zet()
2915 curwin->w_cursor.lnum = curwin->w_topline - 1; in nv_zet()
2923 set_fraction(curwin); in nv_zet()
2928 cap->count1 *= curwin->w_width / 2; in nv_zet()
2934 if (!curwin->w_p_wrap) in nv_zet()
2936 if ((colnr_T)cap->count1 > curwin->w_leftcol) in nv_zet()
2937 curwin->w_leftcol = 0; in nv_zet()
2939 curwin->w_leftcol -= (colnr_T)cap->count1; in nv_zet()
2945 case 'L': cap->count1 *= curwin->w_width / 2; in nv_zet()
2951 if (!curwin->w_p_wrap) in nv_zet()
2954 curwin->w_leftcol += (colnr_T)cap->count1; in nv_zet()
2960 case 's': if (!curwin->w_p_wrap) 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()
2972 if (curwin->w_leftcol != col) in nv_zet()
2974 curwin->w_leftcol = col; in nv_zet()
2981 case 'e': if (!curwin->w_p_wrap) 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()
2989 n = curwin->w_width - curwin_col_off(); in nv_zet()
2994 if (curwin->w_leftcol != col) in nv_zet()
2996 curwin->w_leftcol = col; in nv_zet()
3017 curwin->w_p_fen = TRUE; in nv_zet()
3038 deleteFold(curwin->w_cursor.lnum, in nv_zet()
3039 curwin->w_cursor.lnum, nchar == 'D', FALSE); in nv_zet()
3044 case 'E': if (foldmethodIsManual(curwin)) in nv_zet()
3046 clearFolding(curwin); in nv_zet()
3049 else if (foldmethodIsMarker(curwin)) in nv_zet()
3057 case 'n': curwin->w_p_fen = FALSE; in nv_zet()
3061 case 'N': curwin->w_p_fen = TRUE; in nv_zet()
3065 case 'i': curwin->w_p_fen = !curwin->w_p_fen; 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()
3074 curwin->w_p_fen = TRUE; 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()
3084 curwin->w_p_fen = TRUE; 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()
3107 curwin->w_p_fen = TRUE; in nv_zet()
3114 closeFoldRecurse(curwin->w_cursor.lnum); in nv_zet()
3115 curwin->w_p_fen = TRUE; in nv_zet()
3123 case 'x': curwin->w_p_fen = TRUE; in nv_zet()
3124 curwin->w_foldinvalid = TRUE; // recompute folds in nv_zet()
3130 case 'X': curwin->w_p_fen = TRUE; in nv_zet()
3131 curwin->w_foldinvalid = TRUE; // recompute folds in nv_zet()
3136 case 'm': if (curwin->w_p_fdl > 0) in nv_zet()
3138 curwin->w_p_fdl -= cap->count1; in nv_zet()
3139 if (curwin->w_p_fdl < 0) in nv_zet()
3140 curwin->w_p_fdl = 0; in nv_zet()
3143 curwin->w_p_fen = TRUE; in nv_zet()
3147 case 'M': curwin->w_p_fdl = 0; in nv_zet()
3149 curwin->w_p_fen = TRUE; in nv_zet()
3153 case 'r': curwin->w_p_fdl += cap->count1; in nv_zet()
3157 if (curwin->w_p_fdl >= d) in nv_zet()
3158 curwin->w_p_fdl = d; in nv_zet()
3163 case 'R': curwin->w_p_fdl = getDeepestNesting(); in nv_zet()
3210 pos_T pos = curwin->w_cursor; in nv_zet()
3216 len = spell_move_to(curwin, FORWARD, TRUE, TRUE, NULL); 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()
3245 if (old_fen != curwin->w_p_fen) in nv_zet()
3250 if (foldmethodIsDiff(curwin) && curwin->w_p_scb) in nv_zet()
3255 if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) in nv_zet()
3257 wp->w_p_fen = curwin->w_p_fen; in nv_zet()
3267 if (old_fdl != curwin->w_p_fdl) in nv_zet()
3493 syn_stack_free_all(curwin->w_s); in nv_clear()
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()
3929 if (hasAnyFolding(curwin)) 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()
3951 used -= diff_check_fill(curwin, curwin->w_topline) in nv_scroll()
3952 - curwin->w_topfill; in nv_scroll()
3955 half = (curwin->w_height - curwin->w_empty_rows + 1) / 2; in nv_scroll()
3956 for (n = 0; curwin->w_topline + n < curbuf->b_ml.ml_line_count; ++n) in nv_scroll()
3961 if (n > 0 && used + diff_check_fill(curwin, curwin->w_topline in nv_scroll()
3968 used += plines(curwin->w_topline + n); in nv_scroll()
3972 if (hasFolding(curwin->w_topline + n, NULL, &lnum)) in nv_scroll()
3973 n = lnum - curwin->w_topline; in nv_scroll()
3976 if (n > 0 && used > curwin->w_height) in nv_scroll()
3983 if (hasAnyFolding(curwin)) in nv_scroll()
3986 lnum = curwin->w_topline; in nv_scroll()
3987 while (n-- > 0 && lnum < curwin->w_botline - 1) in nv_scroll()
3992 n = lnum - curwin->w_topline; 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()
4067 curwin->w_set_curswant = TRUE; in nv_right()
4080 if (!LINEEMPTY(curwin->w_cursor.lnum)) in nv_right()
4087 curwin->w_set_curswant = TRUE; 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()
4145 curwin->w_set_curswant = TRUE; 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()
4286 buf_hide(curbuf) ? ECMD_HIDE : 0, curwin) == OK in nv_gotofile()
4289 curwin->w_cursor.lnum = lnum; in nv_gotofile()
4328 curwin->w_curswant = MAXCOL; // so we stay at the end in nv_dollar()
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()
4413 curwin->w_set_curswant = TRUE; in normal_search()
4426 curwin->w_cursor.coladd = 0; in normal_search()
4460 curwin->w_set_curswant = TRUE; in nv_csearch()
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()
4543 curwin->w_set_curswant = TRUE; 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()
4669 curwin->w_set_curswant = TRUE; in nv_brackets()
4688 curwin->w_set_curswant = TRUE; in nv_brackets()
4721 pos = &curwin->w_cursor; in nv_brackets()
4778 if (spell_move_to(curwin, cap->cmdchar == ']' ? FORWARD : BACKWARD, in nv_brackets()
4785 curwin->w_set_curswant = TRUE; 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()
4845 curwin->w_set_curswant = TRUE; in nv_percent()
4846 curwin->w_cursor.coladd = 0; in nv_percent()
4852 && lnum != curwin->w_cursor.lnum in nv_percent()
4870 curwin->w_set_curswant = TRUE; in nv_brace()
4878 curwin->w_cursor.coladd = 0; in nv_brace()
4909 curwin->w_set_curswant = TRUE; in nv_findpar()
4914 curwin->w_cursor.coladd = 0; in nv_findpar()
4955 curwin->w_set_curswant = TRUE; in nv_kundo()
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()
5168 curwin->w_set_curswant = TRUE; in nv_replace()
5185 old_cursor = curwin->w_cursor; in v_swap_corners()
5186 getvcols(curwin, &old_cursor, &VIsual, &left, &right); 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()
5192 curwin->w_curswant = right; in v_swap_corners()
5196 ++curwin->w_curswant; in v_swap_corners()
5197 coladvance(curwin->w_curswant); 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()
5210 curwin->w_curswant = left; in v_swap_corners()
5215 old_cursor = curwin->w_cursor; in v_swap_corners()
5216 curwin->w_cursor = VIsual; in v_swap_corners()
5218 curwin->w_set_curswant = TRUE; 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()
5361 curwin->w_set_curswant = TRUE; 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()
5398 curwin->w_set_curswant = TRUE; in nv_cursormark()
5419 curwin->w_curswant = MAXCOL; in v_visop()
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()
5585 curwin->w_set_curswant = TRUE; 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()
5704 curwin->w_curswant = curwin->w_virtcol in nv_visual()
5708 curwin->w_curswant = resel_VIsual_vcol; in nv_visual()
5709 coladvance(curwin->w_curswant); in nv_visual()
5713 curwin->w_curswant = MAXCOL; in nv_visual()
5719 curwin->w_curswant = curwin->w_virtcol in nv_visual()
5721 coladvance(curwin->w_curswant); in nv_visual()
5724 curwin->w_set_curswant = TRUE; in nv_visual()
5776 int cursor_line_was_concealed = curwin->w_p_cole > 0 in n_start_visual_mode()
5777 && conceal_cursor_line(curwin); in n_start_visual_mode()
5789 coladvance(curwin->w_virtcol); in n_start_visual_mode()
5791 VIsual = curwin->w_cursor; in n_start_visual_mode()
5814 if (curwin->w_redr_type < INVERTED) 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()
5927 i = curwin->w_curswant; in nv_g_cmd()
5928 curwin->w_curswant = curbuf->b_visual.vi_curswant; in nv_g_cmd()
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()
5939 curwin->w_curswant = curbuf->b_visual.vi_curswant; 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()
6019 if (!curwin->w_p_wrap) in nv_g_cmd()
6033 if (!curwin->w_p_wrap) in nv_g_cmd()
6065 if (curwin->w_p_wrap && curwin->w_width != 0) in nv_g_cmd()
6067 int width1 = curwin->w_width - curwin_col_off(); in nv_g_cmd()
6072 if (curwin->w_virtcol >= (colnr_T)width1 && width2 > 0) in nv_g_cmd()
6073 i = (curwin->w_virtcol - width1) / width2 * width2 + width1; in nv_g_cmd()
6076 i = curwin->w_leftcol; in nv_g_cmd()
6081 i += (curwin->w_width - curwin_col_off() in nv_g_cmd()
6082 + ((curwin->w_p_wrap && i > 0) in nv_g_cmd()
6090 curwin->w_valid &= ~VALID_WCOL; in nv_g_cmd()
6092 curwin->w_set_curswant = TRUE; in nv_g_cmd()
6109 curwin->w_set_curswant = TRUE; in nv_g_cmd()
6118 curwin->w_curswant = MAXCOL; 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()
6134 curwin->w_set_curswant = TRUE; in nv_g_cmd()
6147 if (curwin->w_p_wrap && curwin->w_width != 0) in nv_g_cmd()
6149 curwin->w_curswant = MAXCOL; // so we stay at the end in nv_g_cmd()
6152 int width1 = curwin->w_width - col_off; in nv_g_cmd()
6157 if (curwin->w_virtcol >= (colnr_T)width1) in nv_g_cmd()
6158 i += ((curwin->w_virtcol - width1) / width2 + 1) in nv_g_cmd()
6164 curwin->w_curswant = curwin->w_virtcol; in nv_g_cmd()
6165 curwin->w_set_curswant = FALSE; in nv_g_cmd()
6166 if (curwin->w_cursor.col > 0 && curwin->w_p_wrap) in nv_g_cmd()
6173 if (curwin->w_virtcol > (colnr_T)i) in nv_g_cmd()
6174 --curwin->w_cursor.col; in nv_g_cmd()
6186 i = curwin->w_leftcol + curwin->w_width - col_off - 1; 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()
6196 if (vcol >= curwin->w_leftcol + curwin->w_width - col_off) in nv_g_cmd()
6197 --curwin->w_cursor.col; in nv_g_cmd()
6202 curwin->w_curswant = curwin->w_virtcol; in nv_g_cmd()
6203 curwin->w_set_curswant = FALSE; in nv_g_cmd()
6227 curwin->w_set_curswant = TRUE; 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()
6486 redrawWinline(curwin, oldline); in n_opencmd()
6489 if (curwin->w_p_cul) in n_opencmd()
6491 curwin->w_valid &= ~VALID_CROW; in n_opencmd()
6528 curwin->w_set_curswant = TRUE; in nv_redo()
6549 curwin->w_set_curswant = TRUE; in nv_Undo()
6597 cap->oap->start = curwin->w_cursor; in nv_operator()
6681 curwin->w_curswant = (colnr_T)(cap->count0 - 1); in nv_pipe()
6684 curwin->w_curswant = 0; in nv_pipe()
6687 curwin->w_set_curswant = FALSE; in nv_pipe()
6699 curwin->w_set_curswant = TRUE; in nv_bck_word()
6718 pos_T startpos = curwin->w_cursor; in nv_wordcmd()
6773 curwin->w_set_curswant = TRUE; 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()
7024 curwin->w_set_curswant = TRUE; in nv_esc()
7043 curwin->w_set_curswant = TRUE; in set_cursor_for_append_to_line()
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()
7305 curwin->w_set_curswant = TRUE; in nv_object()
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()