Skip to content

Commit

Permalink
fix: apply filetype option after setting keymaps (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Mar 17, 2022
1 parent e05b473 commit 01afd7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/dressing/input.lua
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ setmetatable(M, {
-- Finish setting up the buffer
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').close()<CR>"
vim.api.nvim_buf_set_keymap(bufnr, "n", "<Esc>", close_rhs, keyopts)
Expand All @@ -287,6 +286,7 @@ setmetatable(M, {
"<cmd>lua require('dressing.input').history_next()<CR>",
keyopts
)
vim.api.nvim_buf_set_option(bufnr, "filetype", "DressingInput")
vim.api.nvim_buf_set_lines(bufnr, 0, -1, true, { opts.default or "" })
-- Disable nvim-cmp if installed
local ok, cmp = pcall(require, "cmp")
Expand Down

0 comments on commit 01afd7b

Please sign in to comment.