From 9dc75e73f99ff808f1536594cf0583d8b21a88a2 Mon Sep 17 00:00:00 2001 From: r0nsha Date: Sat, 20 Dec 2025 02:20:41 +0200 Subject: [PATCH] fix: completion in input window --- lua/lib/config.lua | 8 +++++--- lua/lib/input.lua | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lua/lib/config.lua b/lua/lib/config.lua index 97c6dd1..02f41d4 100644 --- a/lua/lib/config.lua +++ b/lua/lib/config.lua @@ -1,8 +1,9 @@ ---@class multinput.Config ----@field opts multinput.Opts ----@field width multinput.Limits ----@field height multinput.Limits +---@field opts multinput.Opts Additional options, see multinput.Opts +---@field width multinput.Limits The minimum and maximum width of the input buffer +---@field height multinput.Limits The minimum and maximum height of the input buffer ---@field padding integer How much padding will be added to the end of the input buffer +---@field completion boolean Whether to enable completion ---@field win vim.api.keyset.win_config ---@class multinput.Opts @@ -22,6 +23,7 @@ return { padding = 5, width = { min = 20, max = 60 }, height = { min = 1, max = 6 }, + completion = true, win = { title = "Input: ", style = "minimal", diff --git a/lua/lib/input.lua b/lua/lib/input.lua index a9d88af..d1d1e14 100644 --- a/lua/lib/input.lua +++ b/lua/lib/input.lua @@ -35,6 +35,7 @@ function Input:open(default) -- Create buffer and floating window. self.bufnr = vim.api.nvim_create_buf(false, true) utils.set_options({ buftype = "prompt", bufhidden = "wipe" }, { buf = self.bufnr }) + vim.api.nvim_buf_set_var(self.bufnr, "completion", self.config.completion) vim.fn.prompt_setprompt(self.bufnr, "") self.winnr = vim.api.nvim_open_win(self.bufnr, true, self.config.win) -- 2.51.2