mirror of
https://github.com/hyzendust/KickestEnd.nvim.git
synced 2026-02-15 03:41:14 +01:00
Fix: <leader>qa global keymap implementation in alpha window button.
This commit is contained in:
@@ -310,7 +310,7 @@ end, { desc = 'Discard changes in current window & quit' })
|
||||
|
||||
-- [[ Close Neovim ]]
|
||||
-- Function to close Neovim, discarding all unsaved changes if confirmed
|
||||
local function close_nvim_with_prompt()
|
||||
_G.close_nvim_with_prompt = function()
|
||||
-- Get list of all listed buffers
|
||||
local buffers = vim.fn.getbufinfo { buflisted = 1 }
|
||||
-- Check for unsaved buffers
|
||||
@@ -332,10 +332,10 @@ local function close_nvim_with_prompt()
|
||||
vim.cmd 'qa!'
|
||||
else
|
||||
-- Cancel quitting
|
||||
print 'Cancelled closing Neovim.'
|
||||
print '\nCancelled closing Neovim.'
|
||||
end
|
||||
end
|
||||
vim.keymap.set('n', '<leader>qa', close_nvim_with_prompt, { noremap = true, silent = true, desc = 'Quit Neovim' })
|
||||
vim.keymap.set('n', '<leader>qa', _G.close_nvim_with_prompt, { noremap = true, silent = true, desc = 'Quit Neovim' })
|
||||
|
||||
-- [[ Switch below/right split windows ]]
|
||||
vim.keymap.set('n', '<leader><Tab>', '<C-W><C-W>')
|
||||
|
||||
@@ -18,8 +18,8 @@ return {
|
||||
dashboard.button('i', ' New File', '<Cmd>ene <Bar> startinsert<CR>'),
|
||||
-- Open Neo-tree in starting directory
|
||||
dashboard.button('<leader>n', ' Open Neo-tree', '<Cmd>cd ' .. vim.fn.fnameescape(start_dir) .. ' | Neotree toggle float<CR>'),
|
||||
-- Quit Neovim
|
||||
dashboard.button('<leader>qa', ' Quit', '<Cmd>qa<CR>'),
|
||||
-- Quit Neovim using custom function
|
||||
dashboard.button('<leader>qa', ' Quit', '<Cmd>lua close_nvim_with_prompt()<CR>'),
|
||||
}
|
||||
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
Reference in New Issue
Block a user