feat: set unique filetype on built-in modals (#3)
This commit is contained in:
parent
08c0cf3217
commit
a3255df4a5
|
@ -148,6 +148,7 @@ setmetatable(M, {
|
|||
vim.api.nvim_buf_set_option(bufnr, "buftype", "prompt")
|
||||
vim.api.nvim_buf_set_option(bufnr, "swapfile", false)
|
||||
vim.api.nvim_buf_set_option(bufnr, "bufhidden", "wipe")
|
||||
vim.api.nvim_buf_set_option(bufnr, "filetype", "DressingInput")
|
||||
local keyopts = { silent = true, noremap = true }
|
||||
local close_rhs = "<cmd>lua require('dressing.input').confirm()<CR>"
|
||||
vim.api.nvim_buf_set_keymap(bufnr, "n", "<Esc>", close_rhs, keyopts)
|
||||
|
|
|
@ -43,6 +43,7 @@ M.select = function(config, items, opts, on_choice)
|
|||
vim.api.nvim_win_set_option(winnr, "winblend", config.winblend)
|
||||
vim.api.nvim_win_set_option(winnr, "cursorline", true)
|
||||
pcall(vim.api.nvim_win_set_option, winnr, "cursorlineopt", "both")
|
||||
vim.api.nvim_buf_set_option(bufnr, "filetype", "DressingSelect")
|
||||
|
||||
-- Create the title window once the main window is placed.
|
||||
-- Have to defer here or the title will be in the wrong location
|
||||
|
|
Loading…
Reference in New Issue