Skip to content

Add keymaps to close commit log panel #258

Description

@pksunkara

I am currently adding keymaps to close the commit log panel using:

vim.api.nvim_create_autocmd('BufWinEnter', {
  group = vim.api.nvim_create_augroup('DiffviewCommitLogPanel', { clear = true }),
  pattern = 'diffview://*/log/*/commit_log',
  desc = 'Map keys to close the diffview commit log panel',
  callback = function(args)
    vim.keymap.set('n', 'q', '<CMD>q<CR>', { buffer = args.buf, desc = 'Close the panel' })
    vim.keymap.set('n', '<ESC>', '<CMD>q<CR>', { buffer = args.buf, desc = 'Close the panel' })
  end,
})
  1. Is there a log.close fn I can use instead of <CMD>q<CR>?
  2. WDYT about adding these 2 shortcuts to default keymaps under commit_log_panel similar to help_panel?

Previous work: sindrets#482, but I think it's wrong.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions