Skip to content

Commit 9368dca

Browse files
committed
Add .clear repl command
Closes #702
1 parent 2f52569 commit 9368dca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lua/dap/repl.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ M.commands = {
7575
down = {'.down'},
7676
goto_ = {'.goto'},
7777
pause = {'.pause', '.p'},
78+
clear = {'.clear'},
7879
capabilities = {'.capabilities'},
7980
help = {'help', '.help', '.h'},
8081
custom_commands = {}
@@ -222,6 +223,12 @@ function execute(text)
222223
if vim.tbl_contains(M.commands.help, text) then
223224
print_commands()
224225
return
226+
elseif vim.tbl_contains(M.commands.clear, text) then
227+
if repl.buf and api.nvim_buf_is_loaded(repl.buf) then
228+
local layer = ui.layer(repl.buf)
229+
layer.render({}, tostring, {}, 0, - 1)
230+
end
231+
return
225232
end
226233
if not session then
227234
M.append('No active debug session')

0 commit comments

Comments
 (0)