summaryrefslogtreecommitdiff
path: root/src/ex_cmds2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-13 12:57:42 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-13 12:57:42 +0100
commit3198870137df64214317151726648af8e56f1729 (patch)
tree3289a72b287693be57b6484ba463176c96ecb377 /src/ex_cmds2.c
parentb48e96f61c87a64e38e3ac50732c92a84a4833b8 (diff)
downloadvim-git-3198870137df64214317151726648af8e56f1729.tar.gz
patch 8.0.1511: some code for the debugger watch expression is clumsyv8.0.1511
Problem: Some code for the debugger watch expression is clumsy. Solution: Clean up the code.
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r--src/ex_cmds2.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index c36435cc1..6476d5516 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -988,23 +988,20 @@ debuggy_find(
}
else
{
- typval_T val3;
-
- if (typval_copy(bp->dbg_val, &val3) == OK)
+ if (typval_compare(tv, bp->dbg_val, TYPE_EQUAL,
+ TRUE, FALSE) == OK
+ && tv->vval.v_number == FALSE)
{
- if (typval_compare(tv, &val3, TYPE_EQUAL,
- TRUE, FALSE, TRUE) == OK
- && tv->vval.v_number == FALSE)
- {
- typval_T *v;
-
- line = TRUE;
- debug_oldval = typval_tostring(bp->dbg_val);
- v = eval_expr(bp->dbg_name, NULL);
- debug_newval = typval_tostring(v);
- free_tv(bp->dbg_val);
- bp->dbg_val = v;
- }
+ typval_T *v;
+
+ line = TRUE;
+ debug_oldval = typval_tostring(bp->dbg_val);
+ /* Need to evaluate again, typval_compare() overwrites
+ * "tv". */
+ v = eval_expr(bp->dbg_name, NULL);
+ debug_newval = typval_tostring(v);
+ free_tv(bp->dbg_val);
+ bp->dbg_val = v;
}
free_tv(tv);
}