diff options
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index 6fa5531d0..c3514874f 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -688,24 +688,27 @@ getcmdline(firstc, count, indent) p = get_expr_line(); --textlock; restore_cmdline(&save_ccline); - len = (int)STRLEN(p); - if (p != NULL && realloc_cmdbuff(len + 1) == OK) + if (p != NULL) { - ccline.cmdlen = len; - STRCPY(ccline.cmdbuff, p); - vim_free(p); - - /* Restore the cursor or use the position set with - * set_cmdline_pos(). */ - if (new_cmdpos > ccline.cmdlen) - ccline.cmdpos = ccline.cmdlen; - else - ccline.cmdpos = new_cmdpos; - - KeyTyped = FALSE; /* Don't do p_wc completion. */ - redrawcmd(); - goto cmdline_changed; + len = (int)STRLEN(p); + if (realloc_cmdbuff(len + 1) == OK) + { + ccline.cmdlen = len; + STRCPY(ccline.cmdbuff, p); + vim_free(p); + + /* Restore the cursor or use the position set with + * set_cmdline_pos(). */ + if (new_cmdpos > ccline.cmdlen) + ccline.cmdpos = ccline.cmdlen; + else + ccline.cmdpos = new_cmdpos; + + KeyTyped = FALSE; /* Don't do p_wc completion. */ + redrawcmd(); + goto cmdline_changed; + } } } beep_flush(); |