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

[features] Quickily close CommitLogView #461

Open
tyalie opened this issue Feb 11, 2024 · 0 comments
Open

[features] Quickily close CommitLogView #461

tyalie opened this issue Feb 11, 2024 · 0 comments

Comments

@tyalie
Copy link

tyalie commented Feb 11, 2024

Hi there,

I've noticed that there's no action or otherwise that would allow one to quickly close the CommitLogView through e.g. Esc or similar keys. Currently it seems like that the only option would to be type in :q every time, which is rather unpractical. Additionally the CommitLogView class also doesn't seem to have a mechanism already which would allow configuring such behavior easily through the keymap config.

I've (for now) build a workaround, which registers a hook, but I feel like this should at best be a default behavior or at least an action.

hooks = {
  view_opened = function (view)
    if view.commit_log_panel then
      local opt = { desc = "Close commit log panel", buffer = view.commit_log_panel.bufid }
      vim.keymap.set("n", "<ESC>", function()view.commit_log_panel:close()end, opt)
    end
  end,
}

With best regards
Tyalie

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

1 participant