Skip to content

Commit 7b305ec

Browse files
committed
fix(console): set options before changing buf
1 parent 643345a commit 7b305ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lua/dap-view/options/winbar.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,16 @@ local winbar_info = {
7777
require("dap-view.term.init").setup_term_win_cmd()
7878
end
7979

80+
-- Set options before changing the buffer
81+
-- The change in buffer would unassign the state.winnr
82+
-- Since the buffer wouldn't have a filetype
83+
-- See https://github.com/igorlfs/nvim-dap-view/issues/69
84+
require("dap-view.term.options").set_options(state.winnr, state.term_bufnr)
85+
8086
api.nvim_win_call(state.winnr, function()
8187
api.nvim_set_current_buf(state.term_bufnr)
8288
end)
8389

84-
require("dap-view.term.options").set_options(state.winnr, state.term_bufnr)
85-
8690
M.set_winbar_action_keymaps(state.term_bufnr)
8791
M.update_section("console")
8892
end

0 commit comments

Comments
 (0)