diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-10 01:11:34 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-05-19 14:50:24 -0300 |
commit | a2f6a53b68d73cb585dcb67ea19579d446810176 (patch) | |
tree | fcfdf8790defe09f8f05cf8d063fb4a2eb64d6e6 | |
parent | 39a272c4db215c2f6043e8c5de5d2104d8118b4f (diff) | |
download | rneovim-a2f6a53b68d73cb585dcb67ea19579d446810176.tar.gz rneovim-a2f6a53b68d73cb585dcb67ea19579d446810176.tar.bz2 rneovim-a2f6a53b68d73cb585dcb67ea19579d446810176.zip |
Remove OOM checks: save_typebuf()
-rw-r--r-- | src/nvim/getchar.c | 6 | ||||
-rw-r--r-- | src/nvim/getchar.h | 2 | ||||
-rw-r--r-- | src/nvim/main.c | 3 |
3 files changed, 4 insertions, 7 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index cc9f65fe29..52322244e1 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1177,12 +1177,11 @@ void free_typebuf(void) */ static typebuf_T saved_typebuf[NSCRIPT]; -int save_typebuf(void) +void save_typebuf(void) { init_typebuf(); saved_typebuf[curscript] = typebuf; alloc_typebuf(); - return OK; } static int old_char = -1; /* character put back by vungetc() */ @@ -1262,8 +1261,7 @@ openscript ( --curscript; return; } - if (save_typebuf() == FAIL) - return; + save_typebuf(); /* * Execute the commands from the file right now when using ":source!" diff --git a/src/nvim/getchar.h b/src/nvim/getchar.h index edb008bd76..c34efc8d0c 100644 --- a/src/nvim/getchar.h +++ b/src/nvim/getchar.h @@ -33,7 +33,7 @@ int typebuf_maplen(void); void del_typebuf(int len, int offset); void alloc_typebuf(void); void free_typebuf(void); -int save_typebuf(void); +void save_typebuf(void); void save_typeahead(tasave_T *tp); void restore_typeahead(tasave_T *tp); void openscript(char_u *name, int directly); diff --git a/src/nvim/main.c b/src/nvim/main.c index 2c69f1e3bd..cbe53d168f 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1365,8 +1365,7 @@ scripterror: mch_errmsg("\"\n"); mch_exit(2); } - if (save_typebuf() == FAIL) - mch_exit(2); /* out of memory */ + save_typebuf(); break; case 't': /* "-t {tag}" */ |