Skip to content

Commit

Permalink
fix: add a message about update change
Browse files Browse the repository at this point in the history
  • Loading branch information
windwp committed Sep 7, 2021
1 parent 64a43a0 commit 55b7d08
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
5 changes: 5 additions & 0 deletions lua/windline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lua/windline/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 55b7d08

Please sign in to comment.