Skip to content

Commit

Permalink
feat(calendar): unify exit keybind to always be q instead of a mix …
Browse files Browse the repository at this point in the history
…of `q`/`<Esc>`
  • Loading branch information
vhyrro committed Jul 16, 2024
1 parent 99dd721 commit 582d7b6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lua/neorg/modules/core/ui/calendar/views/monthly/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ module.private = {
end

vim.keymap.set("n", "q", quit, { buffer = buffer })
vim.keymap.set("n", "<Esc>", quit, { buffer = buffer })

vim.api.nvim_create_autocmd({ "BufLeave", "WinLeave" }, {
buffer = buffer,
Expand Down Expand Up @@ -586,6 +585,10 @@ module.public = {
view:render_view(ui_info, date, nil, options)

do
vim.keymap.set("n", "q", function()
vim.api.nvim_buf_delete(ui_info.buffer, { force = true })
end, { buffer = ui_info.buffer })

-- TODO: Make cursor wrapping behaviour configurable
vim.keymap.set("n", "l", function()
local new_date = reformat_time({
Expand Down Expand Up @@ -901,7 +904,7 @@ module.public = {
"?",
lib.wrap(module.private.display_help, {
{
{ "q/<Esc>", "@namespace" },
{ "q", "@namespace" },
{ " - " },
{ "close this window", "@text.strong" },
},
Expand Down Expand Up @@ -1041,7 +1044,7 @@ module.public = {
"?",
lib.wrap(module.private.display_help, {
{
{ "<Esc>", "@namespace" },
{ "q", "@namespace" },
{ " - " },
{ "close this window", "@text.strong" },
},
Expand Down

0 comments on commit 582d7b6

Please sign in to comment.