Skip to content

fix(#189): correct the top-bottom slot limits #228

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

Merged
merged 2 commits into from
Dec 28, 2024

Conversation

dasupradyumna
Copy link
Contributor

Old implementation does not work properly because it -

  1. overlaps the global statusline (off by 1 row), bottom limit
  2. uses tabline option instead of showtabline, top limit

Old implementation does not work properly because it -
1. overlaps the global statusline (off by 1 row), bottom limit
2. uses `tabline` option instead of `showtabline`, top limit
@jdujava
Copy link
Contributor

jdujava commented Dec 3, 2023

Can you check if this doesn't result in one extra row with stages = 'fade_in_slide_out'? (It does for my setup.)

@jdujava
Copy link
Contributor

jdujava commented Dec 3, 2023

Changing the following line

cur_win_conf[space_key(direction)] + border_padding(direction, cur_win_conf)
seems to fix the problem:

@@ -163,17 +163,17 @@ function M.slot_after_previous(win, open_windows, direction)
   if #preceding_wins == 0 then
     local start = M.get_slot_range(direction)
     if is_increasing(direction) then
       return start
     end
     return move_slot(
       direction,
       start,
-      cur_win_conf[space_key(direction)] + border_padding(direction, cur_win_conf)
+      cur_win_conf[space_key(direction)] + border_padding(direction, cur_win_conf)/2
     )
   end

@isak102
Copy link

isak102 commented Jan 28, 2024

Status on this? Seems like a good improvement to me, the fact that it hides the statusline atm is annoying

@dasupradyumna
Copy link
Contributor Author

Sorry I've been a bit busy. I'll check what @jdujava has mentioned.

@nullromo
Copy link
Contributor

I had the same issue as @jdujava with the extra line.

I can confirm that adding both changes from @dasupradyumna and @jdujava fixes the notification position for fade, slide, static, and fade_in_slide_out. With these two changes in place, my notifications always come up without overlapping the statusline and with no additional space.

@@ -85,9 +85,9 @@ local function window_intervals(windows, direction, cmp)
end

function M.get_slot_range(direction)
local top = vim.opt.tabline:get() == "" and 0 or 1
local top = vim.opt.showtabline:get() == 0 and 0 or 1
local bottom = vim.opt.lines:get()
Copy link

@MatejBransky MatejBransky Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the MR title generally relates to improving the notification slot limit, I would like to add a proposal to consider incorporating the visible winbar, which is also impractically obscured by notifications.

Suggested change
local bottom = vim.opt.lines:get()
if vim.wo.winbar then
top = top + 1
end
local bottom = vim.opt.lines:get()

I'm not sure if this is the proper way to handle it. So I'll be glad for any suggestion for an improvement. 🙏

@rcarriga rcarriga merged commit 217e0bd into rcarriga:master Dec 28, 2024
@rcarriga
Copy link
Owner

Apologies for the delay and thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants