diff --git a/lua/dressing/config.lua b/lua/dressing/config.lua index b8f22c7..d8c36b5 100644 --- a/lua/dressing/config.lua +++ b/lua/dressing/config.lua @@ -16,7 +16,6 @@ local default_config = { start_in_insert = true, -- These are passed to nvim_open_win - anchor = "SW", border = "rounded", -- 'editor' and 'win' will default to being centered relative = "cursor", @@ -120,7 +119,6 @@ local default_config = { -- Options for built-in selector builtin = { -- These are passed to nvim_open_win - anchor = "NW", border = "rounded", -- 'editor' and 'win' will default to being centered relative = "editor", @@ -170,6 +168,13 @@ local M = vim.deepcopy(default_config) M.update = function(opts) local newconf = vim.tbl_deep_extend("force", default_config, opts or {}) + if newconf.input.anchor or newconf.select.builtin.anchor then + vim.notify( + "Deprecated: dressing no longer accepts an 'anchor' option. Use the 'override' function to change the anchor", + vim.log.levels.WARN + ) + end + for k, v in pairs(newconf) do M[k] = v end diff --git a/lua/dressing/input.lua b/lua/dressing/input.lua index 30a6b63..b275e16 100644 --- a/lua/dressing/input.lua +++ b/lua/dressing/input.lua @@ -229,7 +229,7 @@ local function create_or_update_win(config, prompt, opts) else winopt = { relative = config.relative, - anchor = config.anchor, + anchor = "SW", border = config.border, height = 1, style = "minimal", diff --git a/lua/dressing/select/builtin.lua b/lua/dressing/select/builtin.lua index 3387101..8067f95 100644 --- a/lua/dressing/select/builtin.lua +++ b/lua/dressing/select/builtin.lua @@ -76,7 +76,7 @@ M.select = function(config, items, opts, on_choice) local col = util.calculate_col(config.relative, width, 0) local winopt = { relative = config.relative, - anchor = config.anchor, + anchor = "NW", row = row, col = col, border = config.border,