From 9b8c2be3456bec8b650c550ef86bdab5cdec8952 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Fri, 17 Dec 2021 12:31:32 -0800 Subject: [PATCH] deprecate: input.prompt_buffer option Even once the fixes to the prompt buffer come out in the next version of Neovim, I'm really not sure what advantages we get from using the prompt buffer. And we will continue to have disadvantages because it does *not* function like a normal buffer. If anyone is using it and has a good reason for it, please let me know. Otherwise, I'll be removing that functionality in a later commit so I don't have to support two implementations. --- README.md | 3 --- doc/dressing.txt | 3 --- lua/dressing/config.lua | 3 --- lua/dressing/init.lua | 10 ++++++++++ 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e909aac..d733a48 100644 --- a/README.md +++ b/README.md @@ -138,9 +138,6 @@ require('dressing').setup({ -- Window transparency (0-100) winblend = 10, - -- see :help dressing-prompt - prompt_buffer = false, - -- see :help dressing_get_config get_config = nil, }, diff --git a/doc/dressing.txt b/doc/dressing.txt index 7db770a..642ddca 100644 --- a/doc/dressing.txt +++ b/doc/dressing.txt @@ -28,9 +28,6 @@ Configure dressing.nvim by calling the setup() function. -- Window transparency (0-100) winblend = 10, - -- see :help dressing-prompt - prompt_buffer = false, - -- see :help dressing_get_config get_config = nil, }, diff --git a/lua/dressing/config.lua b/lua/dressing/config.lua index e32ddfb..a69ca68 100644 --- a/lua/dressing/config.lua +++ b/lua/dressing/config.lua @@ -21,9 +21,6 @@ local default_config = { -- Window transparency (0-100) winblend = 10, - -- see :help dressing-prompt - prompt_buffer = false, - -- see :help dressing_get_config get_config = nil, }, diff --git a/lua/dressing/init.lua b/lua/dressing/init.lua index 2244cf5..a8b8c23 100644 --- a/lua/dressing/init.lua +++ b/lua/dressing/init.lua @@ -4,6 +4,16 @@ local M = {} M.setup = function(opts) config.update(opts) + -- Wait until vim has fully started up before we show deprecation warnings + vim.defer_fn(function() + if config.input.prompt_buffer then + vim.notify( + "dressing.nvim option 'input.prompt_buffer = true' is deprecated and will be removed in a future version. If you want it to continue to be supported please file an issue with your use case: https://github.com/stevearc/dressing.nvim/issues/new", + vim.log.levels.WARN, + {} + ) + end + end, 100) end local original_input