1
0
forked from aniani/vim

patch 9.1.0613: tests: termdebug test may fail and leave file around

Problem:  tests: termdebug test may fail and leave temp file around
          (Dominique Pellé)
Solution: only run balloon_show() if the function exists, validate
          termdebug is running using the g: termdebug_is_running var,
          use defer to delete temporary files

fixes: #15334

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2024-07-24 21:37:39 +02:00
parent ddbb6fe2d0
commit 2979cfc262
3 changed files with 18 additions and 2 deletions

View File

@@ -1535,6 +1535,12 @@ def CleanupExpr(passed_expr: string): string
return expr
enddef
def Balloon_show(expr: string)
if has("+balloon_eval") || has("+balloon_eval_term")
balloon_show(expr)
endif
enddef
def HandleEvaluate(msg: string)
var value = msg
->substitute('.*value="\(.*\)"', '\1', '')
@@ -1555,7 +1561,7 @@ def HandleEvaluate(msg: string)
else
evalFromBalloonExprResult ..= $' = {value}'
endif
balloon_show(evalFromBalloonExprResult)
Balloon_show(evalFromBalloonExprResult)
else
echomsg $'"{evalexpr}": {value}'
endif