-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat: expose terminal bufnr/winnr in state module #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: expose terminal bufnr/winnr in state module #19
Conversation
allows for creating terminal window before dap session has started
c26d777 to
ba3110e
Compare
Yeah, if we proceed with this change, I think it's better to store these variables in the state module. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to add the new option to the default config in the README.
I'm a bit wary of adding yet another option to control the terminal. The major issue is that it's not clear how this setting should behave when other settings are enabled. For instance: should hide take precedence over ignore_session? I'm fine with either behavior, but this should be documented, as to not give users any surprises.
I am in no rush to merge this PR because I want to do a bit of testing to make sure everything is good, but I will address your comments. |
Yeah of course, I understand. I'll test different configurations to make sure this doesn't conflict with the other terminal settings. |
|
Ok it seems that I can make this work without the opts = {
winbar = {
show = true,
sections = { "watches", "breakpoints", "repl" },
default_section = "breakpoints",
},
windows = {
height = 12,
terminal = {
position = "right",
-- hide = { "go" },
start_hidden = true,
},
},
},If I use In summary what we had to do was make the term By the way it seems that there is a |
Co-authored-by: Igor Lacerda <igorlfs@ufmg.br> ref: rename config.windows.terminal.ignore_session to ...bootstrap chore: adds comment about checking state.last_active_adapter for nil
…tate module ref: removes bootstrap configuration option
92010f2 to
14a6d44
Compare
9477390 to
08ed2d3
Compare
|
Hey! I'm glad you managed to make it work without having to introduce another option!
I've never written a single line of Go in my life, so I'm not really well versed with the language. But if you feel this belongs into the README example, go ahead! |
I think from reading that link that it would be more correct to reference |
6106ead to
a7bf821
Compare
Either way is fine by me ^^ |
a7bf821 to
65c0b62
Compare
|
Hm, oddly this is breaking my setup, which uses pretty much a default config :/ |
| -- Since there has not been a `last_active_adapter` yet, we don't need to | ||
| -- call `delete_term_buf`, which conflicts with bootstrapping the terminal | ||
| -- window. See: https://github.com/igorlfs/nvim-dap-view/issues/18 | ||
| if state.last_active_adapter and state.last_active_adapter ~= adapter then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is turns out, this line actually breaks the "standard" use case. If you first open a ndv's main window and then try to start a session, the terminal will be spawned on top of ndv's main a window (an additional split is also created). Perhaps we DO have to introduce an option for your use case!
For now, I'm reverting this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I'll try to recreate that issue and see what I can do in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I cannot reproduce. I am using the basic go debug adapter without my special magic, and for nvim-dap-view: no config overrides, open with DapViewOpen or require("dap-view").toggle(true), start debugger and it looks right:
Perhaps it's something with your debug adapter (or mine)? Can you post a screenshot of what is happening?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Sorry, for the past few days, my main concern was getting the stacks + threads view working!
For the reproduction, I'm also using the default options, but I'm using debugpy. I believe this is issue is actually being caused by how debugpy handles multiple sessions, though I haven't been able to confirm that. Can you try using debugpy to check if you can reproduce?
If this turns out to be an issue with debugpy, I'm not sure how to best handle the situation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is turns out, this line actually breaks the "standard" use case. If you first open a ndv's main window and then try to start a session, the terminal will be spawned on top of ndv's main a window (an additional split is also created). Perhaps we DO have to introduce an option for your use case!
I have no idea how I was observing this behavior. Seriously. Perhaps I had some uncommited change, which was interfering? No idea. I'm sorry for the trouble!
I'll be reverting the revert once I'm done with another portion of my refactoring.
* feat: creates windows.terminal.ignore_session configuration option allows for creating terminal window before dap session has started * fix: correctly position terminal if ignoring dap session * Update README.md Co-authored-by: Igor Lacerda <igorlfs@ufmg.br> ref: rename config.windows.terminal.ignore_session to ...bootstrap chore: adds comment about checking state.last_active_adapter for nil * ref: move terminal creation logic concerning terminal edge cases to state module ref: removes bootstrap configuration option * chore: removes unused import and converts function to local * ref: simplify logic for opening terminal window
* feat: threads and stacks view * auto-generate vimdoc * feat: expose terminal bufnr/winnr in state module (#19) * feat: creates windows.terminal.ignore_session configuration option allows for creating terminal window before dap session has started * fix: correctly position terminal if ignoring dap session * Update README.md Co-authored-by: Igor Lacerda <igorlfs@ufmg.br> ref: rename config.windows.terminal.ignore_session to ...bootstrap chore: adds comment about checking state.last_active_adapter for nil * ref: move terminal creation logic concerning terminal edge cases to state module ref: removes bootstrap configuration option * chore: removes unused import and converts function to local * ref: simplify logic for opening terminal window * auto-generate vimdoc * fix: revert not deleting term buf when no session was run yet --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Meow Honk <21010072+catgoose@users.noreply.github.com>

allows for creating terminal window before dap session has started
Addresses #18
I'm not sure about storing the terminal bufnr/winnr state in the terminal module, maybe we can store it in state module? I just needed some way to get
bufnrout of the plugin after openingnvim-dap-view