Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lua/dap-view/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ end

M.add_expr = function()
local expression = expr.eval_expression()

require("dap-view.watches.actions").add_watch_expr(expression)

require("dap-view.watches.view").show()
require("dap-view.views").switch(require("dap-view.watches.view").show)
end

return M
2 changes: 1 addition & 1 deletion lua/dap-view/breakpoints/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ M._jump_to_breakpoint = function()
if bufnr == -1 then
vim.cmd("buffer " .. abs_path)
else
vim.cmd("buffer " .. bufnr)
api.nvim_set_current_buf(bufnr)
end
end)

Expand Down
12 changes: 3 additions & 9 deletions lua/dap-view/options/winbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ local winbar_info = {
keymap = "B",
action = function()
if vim.tbl_contains(setup.config.winbar.sections, "breakpoints") then
require("dap-view.views").switch(function()
require("dap-view.breakpoints.view").show()
end)
require("dap-view.views").switch(require("dap-view.breakpoints.view").show)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

end
end,
},
Expand All @@ -20,9 +18,7 @@ local winbar_info = {
keymap = "E",
action = function()
if vim.tbl_contains(setup.config.winbar.sections, "exceptions") then
require("dap-view.views").switch(function()
require("dap-view.exceptions.view").show()
end)
require("dap-view.views").switch(require("dap-view.exceptions.view").show)
end
end,
},
Expand All @@ -31,9 +27,7 @@ local winbar_info = {
keymap = "W",
action = function()
if vim.tbl_contains(setup.config.winbar.sections, "watches") then
require("dap-view.views").switch(function()
require("dap-view.watches.view").show()
end)
require("dap-view.views").switch(require("dap-view.watches.view").show)
end
end,
},
Expand Down
7 changes: 6 additions & 1 deletion lua/dap-view/views/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ M.cleanup_view = function(cond, message)
end

local switch_to_dapview_buf = function()
if not (state.winnr and api.nvim_win_is_valid(state.winnr)) then
return
end
-- The REPL is actually another buffer
if state.current_section == "repl" then
vim.cmd("buffer " .. state.bufnr)
api.nvim_win_call(state.winnr, function()
api.nvim_set_current_buf(state.bufnr)
end)
end
end

Expand Down