diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-09-05 10:59:47 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-09-05 10:59:47 +0000 |
commit | 9fecb460fea33e190904e70274345e42fb44ed52 (patch) | |
tree | ce0f4442c1bc1a78c5fe1285615e3b38341f399c /src/getchar.c | |
parent | 203335e4a9a4fb4c2d034fe950bdb12043b93f6e (diff) | |
download | vim-git-9fecb460fea33e190904e70274345e42fb44ed52.tar.gz |
updated for version 7.0-084v7.0.084
Diffstat (limited to 'src/getchar.c')
-rw-r--r-- | src/getchar.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/src/getchar.c b/src/getchar.c index 7d2cfd786..f840e0bd4 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1451,7 +1451,8 @@ before_blocking() { updatescript(0); #ifdef FEAT_EVAL - garbage_collect(); + if (may_garbage_collect) + garbage_collect(); #endif } @@ -1502,6 +1503,13 @@ vgetc() int i; #endif +#ifdef FEAT_EVAL + /* Do garbage collection when garbagecollect() was called previously and + * we are now at the toplevel. */ + if (may_garbage_collect && want_garbage_collect) + garbage_collect(); +#endif + /* * If a character was put back with vungetc, it was already processed. * Return it directly. @@ -1511,13 +1519,13 @@ vgetc() c = old_char; old_char = -1; mod_mask = old_mod_mask; - return c; } - - mod_mask = 0x0; - last_recorded_len = 0; - for (;;) /* this is done twice if there are modifiers */ + else { + mod_mask = 0x0; + last_recorded_len = 0; + for (;;) /* this is done twice if there are modifiers */ + { if (mod_mask) /* no mapping after modifier has been read */ { ++no_mapping; @@ -1695,8 +1703,20 @@ vgetc() } #endif - return c; + break; + } } + +#ifdef FEAT_EVAL + /* + * In the main loop "may_garbage_collect" can be set to do garbage + * collection in the first next vgetc(). It's disabled after that to + * avoid internally used Lists and Dicts to be freed. + */ + may_garbage_collect = FALSE; +#endif + + return c; } /* |