@@ -532,23 +532,17 @@ static linenr_T debuggy_find(int file,char_u *fname, linenr_T after, garray_T *g
532532
533533/*
534534 * Evaluate the "bp->dbg_name" expression and return the result.
535- * Restore the got_int and called_emsg flags .
535+ * Disables error messages .
536536 */
537537 static typval_T *
538- eval_expr_restore (struct debuggy * bp )
538+ eval_expr_no_emsg (struct debuggy * bp )
539539{
540540 typval_T * tv ;
541- int prev_called_emsg = called_emsg ;
542- int prev_did_emsg = did_emsg ;
543541
544- got_int = FALSE;
542+ // Disable error messages, a bad expression would make Vim unusable.
543+ ++ emsg_off ;
545544 tv = eval_expr (bp -> dbg_name , NULL );
546-
547- // Evaluating the expression should not result in breaking the sequence of
548- // commands.
549- got_int = FALSE;
550- called_emsg = prev_called_emsg ;
551- did_emsg = prev_did_emsg ;
545+ -- emsg_off ;
552546
553547 return tv ;
554548}
@@ -637,7 +631,7 @@ dbg_parsearg(
637631 {
638632 bp -> dbg_name = vim_strsave (p );
639633 if (bp -> dbg_name != NULL )
640- bp -> dbg_val = eval_expr_restore (bp );
634+ bp -> dbg_val = eval_expr_no_emsg (bp );
641635 }
642636 else
643637 {
@@ -983,7 +977,7 @@ debuggy_find(
983977 typval_T * tv ;
984978 int line = FALSE;
985979
986- tv = eval_expr_restore (bp );
980+ tv = eval_expr_no_emsg (bp );
987981 if (tv != NULL )
988982 {
989983 if (bp -> dbg_val == NULL )
@@ -1004,7 +998,7 @@ debuggy_find(
1004998 debug_oldval = typval_tostring (bp -> dbg_val , TRUE);
1005999 // Need to evaluate again, typval_compare() overwrites
10061000 // "tv".
1007- v = eval_expr_restore (bp );
1001+ v = eval_expr_no_emsg (bp );
10081002 debug_newval = typval_tostring (v , TRUE);
10091003 free_tv (bp -> dbg_val );
10101004 bp -> dbg_val = v ;
0 commit comments