Skip to content

foreign_keys and exit options do not overwrite color as noted in README #37

@mintelm

Description

@mintelm

Hello everyone,

there's a sentence in the README that describes that foreign_keys and exit configuration 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 amaranth hydra. 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?

  • option 1: I can create a pink hydra and specify foreign_keys and exit and the configuration actually changes the behavior of the hydra
  • option 2: I can create a amaranth hydra that works with the asynchronous events of DAP (I tried the trick with { 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 use dap.continue() it actually pastes some text into the popup created by dap.continue()

Example code:

    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 }, },
        },
    })

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdocumentationImprovements or additions to documentation

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions