Skip to content

Commit

Permalink
feat(lsp/codeAction): add <ESC> keymap to close buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Feb 23, 2024
1 parent ed78036 commit b44e1db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.10.0] - 2024-02-23

### Added

- LSP/Grouped ode actions: Add `<ESC>` keymap to close buffer.
This is consistent with the behaviour of the hover actions buffer.

## [4.9.0] - 2024-02-23

### Added
Expand Down
5 changes: 3 additions & 2 deletions lua/rustaceanvim/commands/code_action_group.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ local function on_code_action_results(results, ctx)

vim.api.nvim_buf_set_lines(M.state.primary.bufnr, 0, 1, false, {})

vim.keymap.set('n', '<CR>', on_primary_enter_press, { buffer = M.state.primary.bufnr })
vim.keymap.set('n', '<CR>', on_primary_enter_press, { buffer = M.state.primary.bufnr, noremap = true, silent = true })

vim.keymap.set('n', 'q', on_primary_quit, { buffer = M.state.primary.bufnr })
vim.keymap.set('n', 'q', on_primary_quit, { buffer = M.state.primary.bufnr, noremap = true, silent = true })
vim.keymap.set('n', '<Esc>', on_primary_quit, { buffer = M.state.primary.bufnr, noremap = true, silent = true })

M.codeactionify_window_buffer(M.state.primary.winnr, M.state.primary.bufnr)

Expand Down

0 comments on commit b44e1db

Please sign in to comment.