comparison src/main.c @ 4217:6ce32844727d v7.3.860

updated for version 7.3.860 Problem: When using --remote-expr try/catch does not work. (Andrey Radev) Solution: Set emsg_silent instead of emsg_off.
author Bram Moolenaar <bram@vim.org>
date Wed, 13 Mar 2013 20:23:22 +0100
parents ecf21be84def
children 0fcb050fd79d
comparison
equal deleted inserted replaced
4216:4b6c1d915dfe 4217:6ce32844727d
4023 vim_free((char_u *)ptr); 4023 vim_free((char_u *)ptr);
4024 } 4024 }
4025 4025
4026 /* 4026 /*
4027 * Evaluate an expression that the client sent to a string. 4027 * Evaluate an expression that the client sent to a string.
4028 * Handles disabling error messages and disables debugging, otherwise Vim
4029 * hangs, waiting for "cont" to be typed.
4030 */ 4028 */
4031 char_u * 4029 char_u *
4032 eval_client_expr_to_string(expr) 4030 eval_client_expr_to_string(expr)
4033 char_u *expr; 4031 char_u *expr;
4034 { 4032 {
4035 char_u *res; 4033 char_u *res;
4036 int save_dbl = debug_break_level; 4034 int save_dbl = debug_break_level;
4037 int save_ro = redir_off; 4035 int save_ro = redir_off;
4038 4036
4037 /* Disable debugging, otherwise Vim hangs, waiting for "cont" to be
4038 * typed. */
4039 debug_break_level = -1; 4039 debug_break_level = -1;
4040 redir_off = 0; 4040 redir_off = 0;
4041 ++emsg_skip; 4041 /* Do not display error message, otherwise Vim hangs, waiting for "cont"
4042 * to be typed. Do generate errors so that try/catch works. */
4043 ++emsg_silent;
4042 4044
4043 res = eval_to_string(expr, NULL, TRUE); 4045 res = eval_to_string(expr, NULL, TRUE);
4044 4046
4045 debug_break_level = save_dbl; 4047 debug_break_level = save_dbl;
4046 redir_off = save_ro; 4048 redir_off = save_ro;
4047 --emsg_skip; 4049 --emsg_silent;
4050 if (emsg_silent < 0)
4051 emsg_silent = 0;
4048 4052
4049 /* A client can tell us to redraw, but not to display the cursor, so do 4053 /* A client can tell us to redraw, but not to display the cursor, so do
4050 * that here. */ 4054 * that here. */
4051 setcursor(); 4055 setcursor();
4052 out_flush(); 4056 out_flush();