Mercurial > vim
comparison src/ex_cmds.c @ 481:66080ac5dab7 v7.0130
updated for version 7.0130
author | vimboss |
---|---|
date | Mon, 15 Aug 2005 21:41:48 +0000 |
parents | a5fcf36ef512 |
children | f012c4ed8c38 |
comparison
equal
deleted
inserted
replaced
480:bf5ba8a0cdee | 481:66080ac5dab7 |
---|---|
423 else | 423 else |
424 /* Store the column to sort at. */ | 424 /* Store the column to sort at. */ |
425 nrs[lnum - eap->line1].col_nr = col; | 425 nrs[lnum - eap->line1].col_nr = col; |
426 | 426 |
427 nrs[lnum - eap->line1].lnum = lnum; | 427 nrs[lnum - eap->line1].lnum = lnum; |
428 | |
429 if (regmatch.regprog != NULL) | |
430 fast_breakcheck(); | |
431 if (got_int) | |
432 goto theend; | |
428 } | 433 } |
429 | 434 |
430 /* Allocate a buffer that can hold the longest line. */ | 435 /* Allocate a buffer that can hold the longest line. */ |
431 sortbuf = alloc((unsigned)maxlen + 1); | 436 sortbuf = alloc((unsigned)maxlen + 1); |
432 if (sortbuf == NULL) | 437 if (sortbuf == NULL) |
433 goto theend; | 438 goto theend; |
434 | 439 |
435 /* sort the array of line numbers */ | 440 /* Sort the array of line numbers. Note: can't be interrupted! */ |
436 qsort((void *)nrs, count, sizeof(sorti_T), sort_compare); | 441 qsort((void *)nrs, count, sizeof(sorti_T), sort_compare); |
437 | 442 |
438 /* Insert the lines in the sorted order below the last one. */ | 443 /* Insert the lines in the sorted order below the last one. */ |
439 lnum = eap->line2; | 444 lnum = eap->line2; |
440 for (i = 0; i < count; ++i) | 445 for (i = 0; i < count; ++i) |
446 if (ml_append(lnum++, s, (colnr_T)0, FALSE) == FAIL) | 451 if (ml_append(lnum++, s, (colnr_T)0, FALSE) == FAIL) |
447 break; | 452 break; |
448 if (unique) | 453 if (unique) |
449 STRCPY(sortbuf, s); | 454 STRCPY(sortbuf, s); |
450 } | 455 } |
456 fast_breakcheck(); | |
457 if (got_int) | |
458 goto theend; | |
451 } | 459 } |
452 | 460 |
453 /* delete the original lines if appending worked */ | 461 /* delete the original lines if appending worked */ |
454 if (i == count) | 462 if (i == count) |
455 for (i = 0; i < count; ++i) | 463 for (i = 0; i < count; ++i) |
470 | 478 |
471 theend: | 479 theend: |
472 vim_free(nrs); | 480 vim_free(nrs); |
473 vim_free(sortbuf); | 481 vim_free(sortbuf); |
474 vim_free(regmatch.regprog); | 482 vim_free(regmatch.regprog); |
483 if (got_int) | |
484 EMSG(_(e_interr)); | |
475 } | 485 } |
476 | 486 |
477 /* | 487 /* |
478 * ":retab". | 488 * ":retab". |
479 */ | 489 */ |