[feature] Added silent parameter to the dap.repl.execute function to not repeat the command after execution.#1566
Open
banana59 wants to merge 1 commit intomfussenegger:masterfrom
Conversation
repeat the command after execution. Example:
local repl = require('dap.repl')
repl.commands = vim.tbl_extend('force', repl.commands, {
custom_commands = {
["."] = function(expr)
if not expr or expr:match("^%s*$") then
repl.append('Usage: . <expression>')
return
end
local wrapped = 'repr(' .. expr .. ')'
repl.execute(wrapped, {context='repl', silent=true})
end,
}
})
Execution in the repl:
. <variable>
e3947e2 to
eb0f578
Compare
Owner
|
Isn't this a bit confusing if there's no separation/variable indication in the output? |
Author
|
Certainly in some cases, that's why the default is still verbose. I quite liked the neatness in this usecase, that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example for Python
Execution in the repl:
to show a variable without meta information.
I have tested this in python for the nvim-dap commit 6782b09.
This is related to these issues: