Skip to content
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

When jumping to a frame, prefer using open windows #980

Closed
LiadOz opened this issue Jul 6, 2023 · 6 comments
Closed

When jumping to a frame, prefer using open windows #980

LiadOz opened this issue Jul 6, 2023 · 6 comments

Comments

@LiadOz
Copy link

LiadOz commented Jul 6, 2023

Problem Statement

Jumping to buffer seems to only use the current window. If You have a split of windows [A] | B (brackets denote current window), when jumping to code that exists in the content of the file that B contains you will get [B] | B.
Instead I think its better to have A | [B]

Another considerations to make is whether or not to allow jumping between tabs, so some input is needed here.

I could implement it sometime in the near future.

Possible Solutions

No response

Considered Alternatives

No response

@mfussenegger
Copy link
Owner

This should already work if you change the switchbuf setting.

See :help dap.defaults and :help 'switchbuf'

E.g. try:

local dap = require("dap")
dap.defaults.fallback.switchbuf = 'useopen,uselast'

or

dap.defaults.fallback.switchbuf = 'usetab,uselast'

@LiadOz
Copy link
Author

LiadOz commented Jul 7, 2023

This should already work if you change the switchbuf setting.

See :help dap.defaults and :help 'switchbuf'

E.g. try:

local dap = require("dap")
dap.defaults.fallback.switchbuf = 'useopen,uselast'

or

dap.defaults.fallback.switchbuf = 'usetab,uselast'

Didn't notice this option, but for it seems that after jumping to frame in window B the focus is still on window A. Is there another setting that I should set?

mfussenegger added a commit that referenced this issue Jul 8, 2023
So far it set the cursor, but didn't change the active window.

See #980 (comment)
mfussenegger added a commit that referenced this issue Jul 9, 2023
So far it set the cursor, but didn't change the active window.

See #980 (comment)
@mfussenegger
Copy link
Owner

it seems that after jumping to frame in window B the focus is still on window A. Is there another setting that I should set?

There is no option but I changed the behavior with #982

@LiadOz
Copy link
Author

LiadOz commented Jul 9, 2023

Tested it on my end, works great, thanks!

@LiadOz LiadOz closed this as completed Jul 9, 2023
@TheBlob42
Copy link

Sorry to comment on a closed issue.

Any chance we could make this "configurable"? 🤔
I build myself a small floating utility window with custom mappings to quickly step through a debug session, but now that it always jumps to affected window this has become useless 😅

@mfussenegger
Copy link
Owner

@TheBlob42 I could imagine allowing the switchbuf setting to be either a string, or a function. If it's a function it would allow full customization of the jump logic.

Could you create a new issue that explains the use-case in more detail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants