nvim-dap-ui
nvim-dap-ui copied to clipboard
How to change focus for all float_element()'s by default?
Hey,
I'm not sure if its intended or not, but when I start
require("dapui").float_element()
I can select following elements:
When I select repl or console it sets the focus inside the floating window. For anything else the focus stays outside. Now my problem is, when I move my cursor the floating window disappears. Currently I have to actively click into the floating window to keep it and do my work in there.
In the documentation, there is an enter attribute:
require('dapui').float_element('all elements', { enter = true })
but it is only possible to use it for a specific element? I would like to have it for all elements. I tried {}
and ''
as element argument but both didn't work.
Is there an option, I am missing?
Thank you!
but it is only possible to use it for a specific element? I would like to have it for all elements. I tried {} and '' as element argument but both didn't work.
I don't understand what you mean by have it for all elements instead of a specific one. Do you mean you want to open a window for each element?
I would like to use the picker for the elements.
require("dapui").float_element()
But for each element, I pick, the same behavior. Whereas the behavior is, that the cursor is set into the floating window of the element, when picked.
This behavior is currently only possible for the repl and console element.
I've found for myself a minimalistic solution :
dapui/init.lua#L138
+ args.enter = true
if you @rcarriga want this line of code in your repo I can create a PR with a config parameter instead of true.
another option would be to add for each element float_defaults with enter = true;
function dapui.elements.breakpoints.float_defaults()
return { enter = true }
end
or change the default behaviour in the window manager, if the keyval settings.enter
is not available enter by default:
windows/init.lua
but these 2 other options are tooo intrusive for this small change :)
@Fabian-programmer did you come up with a more sustainable fix for this? I use floats wit Eval a lot, would love this feature.
Nope, just the suggestions above, but was waiting for an answer. And forgot that this issue ticket even existed :)
but it is only possible to use it for a specific element? I would like to have it for all elements. I tried {} and '' as element argument but both didn't work.
@Fabian-programmer try nil
require('dapui').float_element(nil, {enter = true})
This works perfectly thank you @ciganandrea !!