-
-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with changing notification position - bug? #124
Comments
It seems to be working fine for me, are you sure you didn't miss changing one of the direction arguments to |
This is what I am currently using ( return {
function(state)
local next_row = stages_util.available_slot(
state.open_windows,
state.message.height + 2,
stages_util.DIRECTION.BOTTOM_UP
)
if not next_row then
return nil
end
return {
relative = "editor",
anchor = "NE",
width = state.message.width,
height = state.message.height,
col = notify.col_offset,
row = next_row,
border = "rounded",
style = "minimal",
opacity = 0,
}
end,
function(state, win)
return {
opacity = { 100 },
col = { notify.col_offset },
row = {
stages_util.slot_after_previous(win, state.open_windows, stages_util.DIRECTION.BOTTOM_UP),
frequency = 3,
complete = function()
return true
end,
},
}
end,
function(state, win)
return {
col = { notify.col_offset },
time = true,
row = {
stages_util.slot_after_previous(win, state.open_windows, stages_util.DIRECTION.BOTTOM_UP),
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 = { notify.col_offset },
row = {
stages_util.slot_after_previous(win, state.open_windows, stages_util.DIRECTION.BOTTOM_UP),
frequency = 3,
complete = function()
return true
end,
},
}
end,
} is what I'm using. I still cannot upload pictures or GIFs for some reason, otherwise I would show you what it looks like @rcarriga. |
Still can't reproduce unfortunately. I'm thinking there's some setting you have enabled/disabled that the previous slot function doesn't account for. Can you try with this init.lua
-- ignore default config and plugins
vim.opt.runtimepath:remove(vim.fn.stdpath("config"))
vim.opt.packpath:remove(vim.fn.stdpath("data") .. "/site")
vim.opt.termguicolors = true
-- append test directory
local test_dir = "/tmp/nvim-config"
vim.opt.runtimepath:append(vim.fn.expand(test_dir))
vim.opt.packpath:append(vim.fn.expand(test_dir))
-- install packer
local install_path = test_dir .. "/pack/packer/start/packer.nvim"
local install_plugins = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.cmd("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
vim.cmd("packadd packer.nvim")
install_plugins = true
end
local packer = require("packer")
packer.init({
package_root = test_dir .. "/pack",
compile_path = test_dir .. "/plugin/packer_compiled.lua",
})
packer.startup(function(use)
use("wbthomason/packer.nvim")
use({
"rcarriga/nvim-notify",
config = function()
local stages_util = require("notify.stages.util")
require("notify").setup({
background_colour = "#000000",
stages = {
function(state)
local next_row = stages_util.available_slot(
state.open_windows,
state.message.height + 2,
stages_util.DIRECTION.BOTTOM_UP
)
if not next_row then
return nil
end
return {
relative = "editor",
anchor = "NE",
width = state.message.width,
height = state.message.height,
col = 1,
row = next_row,
border = "rounded",
style = "minimal",
opacity = 0,
}
end,
function(state, win)
return {
opacity = { 100 },
col = { 1 },
row = {
stages_util.slot_after_previous(
win,
state.open_windows,
stages_util.DIRECTION.BOTTOM_UP
),
frequency = 3,
complete = function()
return true
end,
},
}
end,
function(state, win)
return {
col = { 1 },
time = true,
row = {
stages_util.slot_after_previous(
win,
state.open_windows,
stages_util.DIRECTION.BOTTOM_UP
),
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 = { 1 },
row = {
stages_util.slot_after_previous(
win,
state.open_windows,
stages_util.DIRECTION.BOTTOM_UP
),
frequency = 3,
complete = function()
return true
end,
},
}
end,
},
})
vim.notify = require("notify")
end,
})
if install_plugins then
packer.sync()
end
end) |
Good point - I should have started with this as well. The above minimal configuration does not see the same issues, so I will start to bisect mine to see where things are going wrong and report back. |
@rcarriga I was able to reproduce it with the vim.schedule(function()
vim.notify("foo")
vim.defer_fn(function()
vim.notify({"bar", "baz"})
end, 1500)
end) Also media works now so here's what it looks like from my side: bottom_left-2022-08-23_08.42.37.mp4 |
Not sure if it makes a difference @rcarriga, but when using (the first vim.notify("foo")
vim.defer_fn(function()
vim.notify({"bar", "baz"})
end, 1500) note that the top-most notification sliding down over the bottom one no longer happens: bottom_left_no_overlap-2022-08-24_08.56.43.mp4however the top-most notification doesn't move itself all the way down to the bottom either. |
Spamming a bit with debugging notes - apologies in advance. The For the first window ( and for the second window ( it starts in the right place with the return value from Will keep looking as time permits and post here if I find any updates, but hopefully this helps narrow in on what the problem actually is. |
I was able to reproduce the issue with the second notification not going to the bottom and have fixed it, pull the latest master to confirm. Unfortunately, I'm not seeing that issue with the second appearing over the first though |
Interesting that it does not reproduce for you. When you are testing, what are the values of Also note the example the reproduces the issue has a top level The issue with notifications not going back down all the way is fixed per your last commit, however the overlapping issue still exists. |
OK figured out the issue. Please try out master now 😄 |
Things are flip-flopped now. The issue with notifications overlapping is fixed, however now the second notification doesn't go all the way to the bottom of the screen. Appreciate the effort either way though @rcarriga. Let me know if you want me to try to setup a minimal config to reproduce the "not going all the way to the bottom" issue. |
Setting cmdheight to 0 and then entering a command would change the cmdheight to 1 temporarily. This small change meant that the bounce back was extremely slow and so never reached back to originial position. Rounding fixes this See #124
I found an issue with |
I have |
@rcarriga as far as I can tell it works: tint-2022-09-06_14.37.00.mp4There's a bit of jitter at the end there, but it goes down to the correct spot for sure. Thanks for all the work on this! |
Should reduce lag between .40 and .50 See #124
Brilliant 😄 I've updated the rounding to help a little with the jitter slightly. You can also tweak the |
Having trouble uploading gifs at the moment to demonstrate, but will update later when they are working
Taking what is in
fade_in_slide_out.lua
and changing thecol
value fromvim.opt.columns:get()
to just1
moves the notifications from the top right to the top left as I would expect.However, when changing the
stages_util.DIRECTION.TOP_DOWN
tostages_util.DIRECTION.BOTTOM_UP
in an attempt to then move them to the bottom left results in issues where a secondary notification overlaps the first one vertically by ~2 rows rather than having them stay disjointed. Because this is an issue with the row (and I the initial position of the 2+ notification is correct), I believe this is an issue withslot_after_previous
(which is used in [lua] index 2+ of thestages
configuration).Here is what I have after swapping things around:
The text was updated successfully, but these errors were encountered: