To: vim_dev@googlegroups.com Subject: Patch 8.0.0476 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0476 (after 8.0.0475) Problem: Missing change to main.c. Solution: Add new function. Files: src/main.c *** ../vim-8.0.0475/src/main.c 2017-03-16 15:13:41.924472198 +0100 --- src/main.c 2017-03-18 17:59:29.844263098 +0100 *************** *** 4140,4145 **** --- 4140,4150 ---- char_u *res; int save_dbl = debug_break_level; int save_ro = redir_off; + void *fc; + + /* Evaluate the expression at the toplevel, don't use variables local to + * the calling function. */ + fc = clear_current_funccal(); /* Disable debugging, otherwise Vim hangs, waiting for "cont" to be * typed. */ *************** *** 4156,4161 **** --- 4161,4167 ---- --emsg_silent; if (emsg_silent < 0) emsg_silent = 0; + restore_current_funccal(fc); /* A client can tell us to redraw, but not to display the cursor, so do * that here. */ *************** *** 4170,4175 **** --- 4176,4216 ---- } /* + * Evaluate a command or expression sent to ourselves. + */ + int + sendToLocalVim(char_u *cmd, int asExpr, char_u **result) + { + if (asExpr) + { + char_u *ret; + + ret = eval_client_expr_to_string(cmd); + if (result != NULL) + { + if (ret == NULL) + { + char *err = _(e_invexprmsg); + size_t len = STRLEN(cmd) + STRLEN(err) + 5; + char_u *msg; + + msg = alloc(len); + if (msg != NULL) + vim_snprintf((char *)msg, len, "%s: \"%s\"", err, cmd); + *result = msg; + } + else + *result = ret; + } + else + vim_free(ret); + return ret == NULL ? -1 : 0; + } + server_to_input_buf(cmd); + return 0; + } + + /* * If conversion is needed, convert "data" from "client_enc" to 'encoding' and * return an allocated string. Otherwise return "data". * "*tofree" is set to the result when it needs to be freed later. *** ../vim-8.0.0475/src/version.c 2017-03-18 18:10:08.771696859 +0100 --- src/version.c 2017-03-18 18:14:21.389891053 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 476, /**/ -- hundred-and-one symptoms of being an internet addict: 147. You finally give up smoking...because it made the monitor dirty. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///