b0o / incline.nvim

🎈 Floating statuslines for Neovim, winbar alternative
MIT License
759 stars 14 forks source link

Hide label if cursor is directly within the label area #67

Open b0o opened 4 months ago

b0o commented 4 months ago

Discussed in https://github.com/b0o/incline.nvim/discussions/66

Originally posted by **MatejBransky** April 2, 2024 Hello, thanks for the plugin 🙏 , it's really awesome. 🎉 However, I'm trying to figure out how I could keep the label even when I'm hovering over the first row and the cursor isn't on the label itself. 🤔 Is it possible in the current version already? 🙂
b0o commented 4 months ago

@MatejBransky This is a feature I've wanted as well, and I've actually got an experimental implementation partially working. I will work on it more soon.

YoureMySoul commented 1 week ago

Hi, my proposal for the logic could be like that in pseudocode:

if (the cursor is in the label area, i.e., stacked on top of each other):
  move the status line to the second line of the window.
else if (the cursor is in the first line of the window) and (there is text under the status line):
  move the status line to the second line of the window.
else:
  move the status line to the first line of the window.

Thank you for this pretty plugin. I was able to quickly copy some code for an element from feline.nvim with ease, which has opened up infinite possibilities for me.