comparison src/netbeans.c @ 1956:5d2f6d04c82f v7.2.253

updated for version 7.2-253
author vimboss
date Fri, 11 Sep 2009 12:19:51 +0000
parents 70a5e723eea2
children 85da03763130
comparison
equal deleted inserted replaced
1955:3f1b2e6496de 1956:5d2f6d04c82f
1497 netbeansFireChanges = oldFire; 1497 netbeansFireChanges = oldFire;
1498 netbeansSuppressNoLines = oldSuppress; 1498 netbeansSuppressNoLines = oldSuppress;
1499 return FAIL; 1499 return FAIL;
1500 } 1500 }
1501 first = *pos; 1501 first = *pos;
1502 nbdebug((" FIRST POS: line %d, col %d\n", first.lnum, first.col)); 1502 nbdebug((" FIRST POS: line %d, col %d\n",
1503 first.lnum, first.col));
1503 pos = off2pos(buf->bufp, off+count-1); 1504 pos = off2pos(buf->bufp, off+count-1);
1504 if (!pos) 1505 if (!pos)
1505 { 1506 {
1506 nbdebug((" !bad count\n")); 1507 nbdebug((" !bad count\n"));
1507 nb_reply_text(cmdno, (char_u *)"!bad count"); 1508 nb_reply_text(cmdno, (char_u *)"!bad count");
1508 netbeansFireChanges = oldFire; 1509 netbeansFireChanges = oldFire;
1509 netbeansSuppressNoLines = oldSuppress; 1510 netbeansSuppressNoLines = oldSuppress;
1510 return FAIL; 1511 return FAIL;
1511 } 1512 }
1512 last = *pos; 1513 last = *pos;
1513 nbdebug((" LAST POS: line %d, col %d\n", last.lnum, last.col)); 1514 nbdebug((" LAST POS: line %d, col %d\n",
1515 last.lnum, last.col));
1514 del_from_lnum = first.lnum; 1516 del_from_lnum = first.lnum;
1515 del_to_lnum = last.lnum; 1517 del_to_lnum = last.lnum;
1516 doupdate = 1; 1518 doupdate = 1;
1517 1519
1518 /* Get the position of the first byte after the deleted 1520 /* Get the position of the first byte after the deleted
1519 * section. "next" is NULL when deleting to the end of the 1521 * section. "next" is NULL when deleting to the end of the
1520 * file. */ 1522 * file. */
1521 next = off2pos(buf->bufp, off + count); 1523 next = off2pos(buf->bufp, off + count);
1522 1524
1523 /* Remove part of the first line. */ 1525 /* Remove part of the first line. */
1524 if (first.col != 0 || (next != NULL && first.lnum == next->lnum)) 1526 if (first.col != 0
1527 || (next != NULL && first.lnum == next->lnum))
1525 { 1528 {
1526 if (first.lnum != last.lnum 1529 if (first.lnum != last.lnum
1527 || (next != NULL && first.lnum != next->lnum)) 1530 || (next != NULL && first.lnum != next->lnum))
1528 { 1531 {
1529 /* remove to the end of the first line */ 1532 /* remove to the end of the first line */
1582 for (i = del_from_lnum; i <= del_to_lnum; i++) 1585 for (i = del_from_lnum; i <= del_to_lnum; i++)
1583 { 1586 {
1584 int id = buf_findsign_id(buf->bufp, (linenr_T)i); 1587 int id = buf_findsign_id(buf->bufp, (linenr_T)i);
1585 if (id > 0) 1588 if (id > 0)
1586 { 1589 {
1587 nbdebug((" Deleting sign %d on line %d\n", id, i)); 1590 nbdebug((" Deleting sign %d on line %d\n",
1591 id, i));
1588 buf_delsign(buf->bufp, id); 1592 buf_delsign(buf->bufp, id);
1589 } 1593 }
1590 else 1594 else
1591 { 1595 {
1592 nbdebug((" No sign on line %d\n", i)); 1596 nbdebug((" No sign on line %d\n", i));
1593 } 1597 }
1594 } 1598 }
1595 1599
1596 nbdebug((" Deleting lines %d through %d\n", del_from_lnum, del_to_lnum)); 1600 nbdebug((" Deleting lines %d through %d\n",
1601 del_from_lnum, del_to_lnum));
1597 curwin->w_cursor.lnum = del_from_lnum; 1602 curwin->w_cursor.lnum = del_from_lnum;
1598 curwin->w_cursor.col = 0; 1603 curwin->w_cursor.col = 0;
1599 del_lines(del_to_lnum - del_from_lnum + 1, FALSE); 1604 del_lines(del_to_lnum - del_from_lnum + 1, FALSE);
1600 } 1605 }
1601 1606
3512 eol_size = 2; 3517 eol_size = 2;
3513 else 3518 else
3514 eol_size = 1; 3519 eol_size = 1;
3515 for (lnum = 1; lnum <= bufp->b_ml.ml_line_count; ++lnum) 3520 for (lnum = 1; lnum <= bufp->b_ml.ml_line_count; ++lnum)
3516 { 3521 {
3517 char_count += (long)STRLEN(ml_get(lnum)) + eol_size; 3522 char_count += (long)STRLEN(ml_get_buf(bufp, lnum, FALSE))
3523 + eol_size;
3518 /* Check for a CTRL-C every 100000 characters */ 3524 /* Check for a CTRL-C every 100000 characters */
3519 if (char_count > last_check) 3525 if (char_count > last_check)
3520 { 3526 {
3521 ui_breakcheck(); 3527 ui_breakcheck();
3522 if (got_int) 3528 if (got_int)