Mercurial > vim
comparison src/getchar.c @ 958:e88950f0d4f6 v7.0.084
updated for version 7.0-084
author | vimboss |
---|---|
date | Tue, 05 Sep 2006 10:59:47 +0000 |
parents | 99305c4c42d4 |
children | cec8b867838b |
comparison
equal
deleted
inserted
replaced
957:3dc6072e0a25 | 958:e88950f0d4f6 |
---|---|
1449 void | 1449 void |
1450 before_blocking() | 1450 before_blocking() |
1451 { | 1451 { |
1452 updatescript(0); | 1452 updatescript(0); |
1453 #ifdef FEAT_EVAL | 1453 #ifdef FEAT_EVAL |
1454 garbage_collect(); | 1454 if (may_garbage_collect) |
1455 garbage_collect(); | |
1455 #endif | 1456 #endif |
1456 } | 1457 } |
1457 | 1458 |
1458 /* | 1459 /* |
1459 * updatescipt() is called when a character can be written into the script file | 1460 * updatescipt() is called when a character can be written into the script file |
1500 int n; | 1501 int n; |
1501 char_u buf[MB_MAXBYTES]; | 1502 char_u buf[MB_MAXBYTES]; |
1502 int i; | 1503 int i; |
1503 #endif | 1504 #endif |
1504 | 1505 |
1506 #ifdef FEAT_EVAL | |
1507 /* Do garbage collection when garbagecollect() was called previously and | |
1508 * we are now at the toplevel. */ | |
1509 if (may_garbage_collect && want_garbage_collect) | |
1510 garbage_collect(); | |
1511 #endif | |
1512 | |
1505 /* | 1513 /* |
1506 * If a character was put back with vungetc, it was already processed. | 1514 * If a character was put back with vungetc, it was already processed. |
1507 * Return it directly. | 1515 * Return it directly. |
1508 */ | 1516 */ |
1509 if (old_char != -1) | 1517 if (old_char != -1) |
1510 { | 1518 { |
1511 c = old_char; | 1519 c = old_char; |
1512 old_char = -1; | 1520 old_char = -1; |
1513 mod_mask = old_mod_mask; | 1521 mod_mask = old_mod_mask; |
1514 return c; | 1522 } |
1515 } | 1523 else |
1516 | 1524 { |
1517 mod_mask = 0x0; | 1525 mod_mask = 0x0; |
1518 last_recorded_len = 0; | 1526 last_recorded_len = 0; |
1519 for (;;) /* this is done twice if there are modifiers */ | 1527 for (;;) /* this is done twice if there are modifiers */ |
1520 { | 1528 { |
1521 if (mod_mask) /* no mapping after modifier has been read */ | 1529 if (mod_mask) /* no mapping after modifier has been read */ |
1522 { | 1530 { |
1523 ++no_mapping; | 1531 ++no_mapping; |
1524 ++allow_keys; | 1532 ++allow_keys; |
1525 } | 1533 } |
1693 --no_mapping; | 1701 --no_mapping; |
1694 c = (*mb_ptr2char)(buf); | 1702 c = (*mb_ptr2char)(buf); |
1695 } | 1703 } |
1696 #endif | 1704 #endif |
1697 | 1705 |
1698 return c; | 1706 break; |
1699 } | 1707 } |
1708 } | |
1709 | |
1710 #ifdef FEAT_EVAL | |
1711 /* | |
1712 * In the main loop "may_garbage_collect" can be set to do garbage | |
1713 * collection in the first next vgetc(). It's disabled after that to | |
1714 * avoid internally used Lists and Dicts to be freed. | |
1715 */ | |
1716 may_garbage_collect = FALSE; | |
1717 #endif | |
1718 | |
1719 return c; | |
1700 } | 1720 } |
1701 | 1721 |
1702 /* | 1722 /* |
1703 * Like vgetc(), but never return a NUL when called recursively, get a key | 1723 * Like vgetc(), but never return a NUL when called recursively, get a key |
1704 * directly from the user (ignoring typeahead). | 1724 * directly from the user (ignoring typeahead). |