Skip to content

Commit

Permalink
feat: no_animation style (#237)
Browse files Browse the repository at this point in the history
This style has no animations (similarly as "static"),
but after any notification dissapears, the rest adjust
their positions (fall up/down as in "fade_in_slide_out").
  • Loading branch information
jdujava committed Dec 21, 2023
1 parent e4a2022 commit 3653a3b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lua/notify/stages/no_animation.lua
@@ -0,0 +1,30 @@
local stages_util = require("notify.stages.util")

return function(direction)
return {
function(state)
local next_height = state.message.height + 2
local next_row = stages_util.available_slot(state.open_windows, next_height, direction)
if not next_row then
return nil
end
return {
relative = "editor",
anchor = "NE",
width = state.message.width,
height = state.message.height,
col = vim.opt.columns:get(),
row = next_row,
border = "rounded",
style = "minimal",
}
end,
function(state, win)
return {
col = vim.opt.columns:get(),
time = true,
row = stages_util.slot_after_previous(win, state.open_windows, direction),
}
end,
}
end

0 comments on commit 3653a3b

Please sign in to comment.