Allow for persistent code evaluation in the watch window.#193
Allow for persistent code evaluation in the watch window.#193joonty merged 4 commits intovim-vdebug:masterfrom
Conversation
After ":VdebugEval! code", continue to evaluate code in the watch window after running through the code. Clear with ":VdebugEval!".
|
Sorry it's taken so long for me to get round to this. I really like the succinctness of this! Someone else implemented something similar, which is the However, I'm not convinced that it means we should throw away your PR - I don't see any harm in having the two routes to evaluating expressions, especially as some people would prefer not to have another window opened to trace an expression (and some people would). What do you think? Thanks again, and the Python code looks good :) |
|
No need to apologize. My own projects are equally in need of attention. Looking at my first comment, I think I wrote Some years ago, on the vim mailing list (or maybe vim-dev) I pointed out that the stated design goals did not explain why vim should have so many options. Bram's response was to add a goal: I think that vim plugins should try to follow the same design goals as vim itself, which is my long-winded way of saying that I agree: let's give people both options for monitoring an expression. I will try to carve out some time tomorrow to update the documentation, and maybe even add a test. If not then, maybe next weekend. |
|
I see that I added some documentation for |
|
You convinced me! And this works really well. Thanks very much, I'm going to release this with another fix today, for version 1.5.1. |
Allow for persistent code evaluation in the watch window.
|
I just noticed that this PR is still labeled "on hold" even though it has been merged. |
|
@benjifisher It has a label 'on hold' but is closed because of the merge. |
|
Sorted :) |
After
:VdebugEval! expression, continue to evaluateexpressionin the watch window after running through the code. Clear with:VdebugEval!.Here is my use case. I set a breakpoint, and the watch window is filled with so many variables that I have to scroll to see the one I want. So I do
:VdebugEval array($myvar->property17, $myvar->property34). I run the code, and the same local variables fill the watch window. I know I can use@:, to repeat the:Vdebugcommand, but I want to save a few keystrokes.This patch provides a
:Vdebug!variant. After:Vdebug! expression, the watch window will continue showingexpressionas I step through the code or run to a breakpoint. I can use<F11>or:python debugger.get_context()to get the usual display, butexpressionwill return if I run the code again. To return to the usual behavior, use:Vdebug!(with noexpressionargument).If you like this idea, then I will complete it by adding tests and documentation. (I have not looked at the tests yet, but I think I can figure out how to do it.)
I know vim pretty well, but I am a novice at python, so I will be grateful for any advice or (constructive) criticism.