-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stages): place bottom up (#127)
- Loading branch information
Showing
8 changed files
with
215 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,48 @@ | ||
local stages_util = require("notify.stages.util") | ||
|
||
return { | ||
function(state) | ||
local next_height = state.message.height + 2 | ||
local next_row = | ||
stages_util.available_slot(state.open_windows, next_height, stages_util.DIRECTION.TOP_DOWN) | ||
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", | ||
opacity = 0, | ||
} | ||
end, | ||
function() | ||
return { | ||
opacity = { 100 }, | ||
col = { vim.opt.columns:get() }, | ||
} | ||
end, | ||
function() | ||
return { | ||
col = { vim.opt.columns:get() }, | ||
time = true, | ||
} | ||
end, | ||
function() | ||
return { | ||
opacity = { | ||
0, | ||
frequency = 2, | ||
complete = function(cur_opacity) | ||
return cur_opacity <= 4 | ||
end, | ||
}, | ||
col = { vim.opt.columns:get() }, | ||
} | ||
end, | ||
} | ||
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", | ||
opacity = 0, | ||
} | ||
end, | ||
function() | ||
return { | ||
opacity = { 100 }, | ||
col = { vim.opt.columns:get() }, | ||
} | ||
end, | ||
function() | ||
return { | ||
col = { vim.opt.columns:get() }, | ||
time = true, | ||
} | ||
end, | ||
function() | ||
return { | ||
opacity = { | ||
0, | ||
frequency = 2, | ||
complete = function(cur_opacity) | ||
return cur_opacity <= 4 | ||
end, | ||
}, | ||
col = { vim.opt.columns:get() }, | ||
} | ||
end, | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,77 @@ | ||
local stages_util = require("notify.stages.util") | ||
|
||
return { | ||
function(state) | ||
local next_height = state.message.height + 2 | ||
local next_row = | ||
stages_util.available_slot(state.open_windows, next_height, stages_util.DIRECTION.TOP_DOWN) | ||
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", | ||
opacity = 0, | ||
} | ||
end, | ||
function(state, win) | ||
return { | ||
opacity = { 100 }, | ||
col = { vim.opt.columns:get() }, | ||
row = { | ||
stages_util.slot_after_previous(win, state.open_windows, stages_util.DIRECTION.TOP_DOWN), | ||
frequency = 3, | ||
complete = function() | ||
return true | ||
end, | ||
}, | ||
} | ||
end, | ||
function(state, win) | ||
return { | ||
col = { vim.opt.columns:get() }, | ||
time = true, | ||
row = { | ||
stages_util.slot_after_previous(win, state.open_windows, stages_util.DIRECTION.TOP_DOWN), | ||
frequency = 3, | ||
complete = function() | ||
return true | ||
end, | ||
}, | ||
} | ||
end, | ||
function(state, win) | ||
return { | ||
width = { | ||
1, | ||
frequency = 2.5, | ||
damping = 0.9, | ||
complete = function(cur_width) | ||
return cur_width < 3 | ||
end, | ||
}, | ||
opacity = { | ||
0, | ||
frequency = 2, | ||
complete = function(cur_opacity) | ||
return cur_opacity <= 4 | ||
end, | ||
}, | ||
col = { vim.opt.columns:get() }, | ||
row = { | ||
stages_util.slot_after_previous(win, state.open_windows, stages_util.DIRECTION.TOP_DOWN), | ||
frequency = 3, | ||
complete = function() | ||
return true | ||
end, | ||
}, | ||
} | ||
end, | ||
} | ||
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", | ||
opacity = 0, | ||
} | ||
end, | ||
function(state, win) | ||
return { | ||
opacity = { 100 }, | ||
col = { vim.opt.columns:get() }, | ||
row = { | ||
stages_util.slot_after_previous(win, state.open_windows, direction), | ||
frequency = 3, | ||
complete = function() | ||
return true | ||
end, | ||
}, | ||
} | ||
end, | ||
function(state, win) | ||
return { | ||
col = { vim.opt.columns:get() }, | ||
time = true, | ||
row = { | ||
stages_util.slot_after_previous(win, state.open_windows, direction), | ||
frequency = 3, | ||
complete = function() | ||
return true | ||
end, | ||
}, | ||
} | ||
end, | ||
function(state, win) | ||
return { | ||
width = { | ||
1, | ||
frequency = 2.5, | ||
damping = 0.9, | ||
complete = function(cur_width) | ||
return cur_width < 3 | ||
end, | ||
}, | ||
opacity = { | ||
0, | ||
frequency = 2, | ||
complete = function(cur_opacity) | ||
return cur_opacity <= 4 | ||
end, | ||
}, | ||
col = { vim.opt.columns:get() }, | ||
row = { | ||
stages_util.slot_after_previous(win, state.open_windows, direction), | ||
frequency = 3, | ||
complete = function() | ||
return true | ||
end, | ||
}, | ||
} | ||
end, | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.