Mercurial > vim
comparison src/ops.c @ 1528:e212d1a40ca9 v7.1.243
updated for version 7.1-243
author | vimboss |
---|---|
date | Wed, 06 Feb 2008 13:44:43 +0000 |
parents | 76985a406456 |
children | d976f4da2a4d |
comparison
equal
deleted
inserted
replaced
1527:03ec0f2b9a40 | 1528:e212d1a40ca9 |
---|---|
2195 { | 2195 { |
2196 pos_T pos; | 2196 pos_T pos; |
2197 #ifdef FEAT_VISUAL | 2197 #ifdef FEAT_VISUAL |
2198 struct block_def bd; | 2198 struct block_def bd; |
2199 #endif | 2199 #endif |
2200 int did_change; | 2200 int did_change = FALSE; |
2201 | 2201 |
2202 if (u_save((linenr_T)(oap->start.lnum - 1), | 2202 if (u_save((linenr_T)(oap->start.lnum - 1), |
2203 (linenr_T)(oap->end.lnum + 1)) == FAIL) | 2203 (linenr_T)(oap->end.lnum + 1)) == FAIL) |
2204 return; | 2204 return; |
2205 | 2205 |
2240 --oap->end.col; | 2240 --oap->end.col; |
2241 } | 2241 } |
2242 else if (!oap->inclusive) | 2242 else if (!oap->inclusive) |
2243 dec(&(oap->end)); | 2243 dec(&(oap->end)); |
2244 | 2244 |
2245 did_change = swapchars(oap->op_type, &pos, oap->end.col - pos.col + 1); | 2245 if (pos.lnum == oap->end.lnum) |
2246 did_change = swapchars(oap->op_type, &pos, | |
2247 oap->end.col - pos.col + 1); | |
2248 else | |
2249 for (;;) | |
2250 { | |
2251 did_change |= swapchars(oap->op_type, &pos, | |
2252 pos.lnum == oap->end.lnum ? oap->end.col + 1: | |
2253 (int)STRLEN(ml_get_pos(&pos))); | |
2254 if (ltoreq(oap->end, pos) || inc(&pos) == -1) | |
2255 break; | |
2256 } | |
2246 if (did_change) | 2257 if (did_change) |
2247 { | 2258 { |
2248 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, | 2259 changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, |
2249 0L); | 2260 0L); |
2250 #ifdef FEAT_NETBEANS_INTG | 2261 #ifdef FEAT_NETBEANS_INTG |
2312 int did_change = 0; | 2323 int did_change = 0; |
2313 | 2324 |
2314 for (todo = length; todo > 0; --todo) | 2325 for (todo = length; todo > 0; --todo) |
2315 { | 2326 { |
2316 # ifdef FEAT_MBYTE | 2327 # ifdef FEAT_MBYTE |
2317 int pos_col = pos->col; | |
2318 | |
2319 if (has_mbyte) | 2328 if (has_mbyte) |
2320 /* we're counting bytes, not characters */ | 2329 /* we're counting bytes, not characters */ |
2321 todo -= (*mb_ptr2len)(ml_get_pos(pos)) - 1; | 2330 todo -= (*mb_ptr2len)(ml_get_pos(pos)) - 1; |
2322 # endif | 2331 # endif |
2323 did_change |= swapchar(op_type, pos); | 2332 did_change |= swapchar(op_type, pos); |
2324 # ifdef FEAT_MBYTE | |
2325 /* Changing German sharp s to SS increases the column. */ | |
2326 todo += pos->col - pos_col; | |
2327 # endif | |
2328 if (inc(pos) == -1) /* at end of file */ | 2333 if (inc(pos) == -1) /* at end of file */ |
2329 break; | 2334 break; |
2330 } | 2335 } |
2331 return did_change; | 2336 return did_change; |
2332 } | 2337 } |