function cmd(command, suffix)
suffix = suffix or ''
return '<cmd>' .. command .. '<CR>' .. suffix
end
hydra({
name = 'Debugging',
config = { color = 'pink', foreign_keys = 'warn', exit = true },
hint = hints.dap,
mode = 'n',
body = '<Leader>d',
heads = {
{ 'b', cmd('DapToggleBreakpoint') },
{ 'c', cmd('DapContinue') },
{ 's', cmd('DapStepOver') },
{ 'i', cmd('DapStepInto') },
{ 'o', cmd('DapStepOut') },
{ 'r', cmd('DapToggleRepl') },
{ 'u', function() require('dapui').toggle({ reset = true }) end },
{ 'w', function() require('dapui').elements.watches.add() end },
{ '<Esc>', nil, { exit = true, nowait = true, desc = false }, },
},
})
Hello everyone,
there's a sentence in the README that describes that
foreign_keysandexitconfiguration options actually overwrite the behavior specified by a color. At least I could not get it working.What is my problem?
I want to create a DAP hydra that has the policy of an
amaranthhydra. However, since DAP stepping/continuing is asynchronous, I have to use a pink hydra. When using a pink hydra and specifying{ foreign_keys = 'warn', exit = true }, the behavior of the hydra does not change, i.e. it still processes inputs that are not mapped to a head.What would solve my problem?
foreign_keysandexitand the configuration actually changes the behavior of the hydra{ on_key = function() vim.wait(20) end, color = 'amaranth' }that is used in the proposed git hydra, however that does not work as expected with the DAP since when i usedap.continue()it actually pastes some text into the popup created bydap.continue()Example code: