From 55b7d08c12a637e56392c3e780acc680e8866211 Mon Sep 17 00:00:00 2001 From: windwp Date: Tue, 7 Sep 2021 09:33:46 +0700 Subject: [PATCH] fix: add a message about update change --- README.md | 2 +- lua/windline/init.lua | 5 +++++ lua/windline/utils.lua | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9586629..59f7753 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ local explorer = { --- show active components when the window is inactive always_active = true, - --- it will display a last window status event that window should inactive + --- it will display a last window statusline even that window should inactive show_last_status = true } diff --git a/lua/windline/init.lua b/lua/windline/init.lua index b554797..16cb681 100644 --- a/lua/windline/init.lua +++ b/lua/windline/init.lua @@ -198,8 +198,13 @@ end M.add_status = function(lines) + -- FIXME update change. It will be remove on the future for _, line in ipairs(lines) do + utils.update_check(line.in_active ~= nil, + "You need to change status line 'in_active' to 'inactive'. ':%s/in_active/inactive/g'") line.inactive = line.inactive or line.in_active + utils.update_check(line.show_in_active ~= nil, + "You need to change status line 'show_in_active' to 'always_active'. ':%s/show_in_active/always_active/g'") line.always_active = line.always_active or line.show_in_active end if lines.filetypes then diff --git a/lua/windline/utils.lua b/lua/windline/utils.lua index 7c349ce..1b9692e 100644 --- a/lua/windline/utils.lua +++ b/lua/windline/utils.lua @@ -141,4 +141,9 @@ M.get_unique_bufname = function(bufnr) return string.reverse(string.sub(tmp_name, 1, position)) end +M.update_check = function(check, message) + if check then + vim.notify("WindLine Update: " .. message) + end +end return M