Mercurial > vim
comparison src/ops.c @ 1982:b1b09b68d706 v7.2.279
updated for version 7.2-279
author | vimboss |
---|---|
date | Tue, 03 Nov 2009 15:44:21 +0000 |
parents | 2e915ea7110f |
children | 92809ecb9a47 |
comparison
equal
deleted
inserted
replaced
1981:31df87b80e56 | 1982:b1b09b68d706 |
---|---|
2018 if (oap->block_mode) | 2018 if (oap->block_mode) |
2019 { | 2019 { |
2020 bd.is_MAX = (curwin->w_curswant == MAXCOL); | 2020 bd.is_MAX = (curwin->w_curswant == MAXCOL); |
2021 for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum) | 2021 for ( ; curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum) |
2022 { | 2022 { |
2023 curwin->w_cursor.col = 0; /* make sure cursor position is valid */ | |
2023 block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); | 2024 block_prep(oap, &bd, curwin->w_cursor.lnum, TRUE); |
2024 if (bd.textlen == 0 && (!virtual_op || bd.is_MAX)) | 2025 if (bd.textlen == 0 && (!virtual_op || bd.is_MAX)) |
2025 continue; /* nothing to replace */ | 2026 continue; /* nothing to replace */ |
2026 | 2027 |
2027 /* n == number of extra chars required | 2028 /* n == number of extra chars required |
2033 * coladd offset as part of "startspaces" */ | 2034 * coladd offset as part of "startspaces" */ |
2034 if (virtual_op && bd.is_short && *bd.textstart == NUL) | 2035 if (virtual_op && bd.is_short && *bd.textstart == NUL) |
2035 { | 2036 { |
2036 pos_T vpos; | 2037 pos_T vpos; |
2037 | 2038 |
2039 vpos.lnum = curwin->w_cursor.lnum; | |
2038 getvpos(&vpos, oap->start_vcol); | 2040 getvpos(&vpos, oap->start_vcol); |
2039 bd.startspaces += vpos.coladd; | 2041 bd.startspaces += vpos.coladd; |
2040 n = bd.startspaces; | 2042 n = bd.startspaces; |
2041 } | 2043 } |
2042 else | 2044 else |
2691 | 2693 |
2692 /* If the block starts in virtual space, count the | 2694 /* If the block starts in virtual space, count the |
2693 * initial coladd offset as part of "startspaces" */ | 2695 * initial coladd offset as part of "startspaces" */ |
2694 if (bd.is_short) | 2696 if (bd.is_short) |
2695 { | 2697 { |
2696 linenr_T lnum = curwin->w_cursor.lnum; | 2698 vpos.lnum = linenr; |
2697 | |
2698 curwin->w_cursor.lnum = linenr; | |
2699 (void)getvpos(&vpos, oap->start_vcol); | 2699 (void)getvpos(&vpos, oap->start_vcol); |
2700 curwin->w_cursor.lnum = lnum; | |
2701 } | 2700 } |
2702 else | 2701 else |
2703 vpos.coladd = 0; | 2702 vpos.coladd = 0; |
2704 # endif | 2703 # endif |
2705 oldp = ml_get(linenr); | 2704 oldp = ml_get(linenr); |