Skip to content

discussion: how to toggle output windows #483

@webdavis

Description

@webdavis

Did you check existing requests?

  • I have searched the existing issues

Content

Before 2.0 I could toggle the output like so:

    local toggle_runner = function(cmd)
      -- Close if terminal.
      if vim.bo.buftype == "terminal" then
        vim.cmd("close")
        return
      end

      -- Check for Overseer window.
      for _, win in ipairs(vim.api.nvim_list_wins()) do
        local buf = vim.api.nvim_win_get_buf(win)
        if vim.bo[buf].filetype == "Overseer" then
          vim.api.nvim_win_close(win, true)
          return
        end
      end

      -- Otherwise, run command.
      vim.cmd(cmd)
    end

    map({
      mode = "n",
      lhs = "<M-;>",
      rhs = function()
        toggle_runner("OverseerQuickAction open float")
      end,
      desc = "Overseer: open task in floating window",
    })

Not sure how to achieve this after the update. Open to any suggestions...

Metadata

Metadata

Assignees

No one assigned

    Labels

    v2.0 discussionAn issue discussing the upcoming v2.0 changes

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions