Skip to content

fix: don't ignore at_edge for floating windows #218

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thenbe
Copy link
Contributor

@thenbe thenbe commented Jun 27, 2024

fixes #217

Before this PR, we never invoke the user's custom at_edge behavior for floating windows (see minimal repro). Instead, we return early.

This PR ensures that, for floating windows, we call handle_at_edge() just before returning early.

And since we now invoke that logic in two different places, I extracted it into its own function handle_at_edge(). So really, the only real of this PR is the additional logic introduced on line 410.

Off-topic

The noisy diff is largely due to the indentation change. Block out the noise using:

git config --global diff.colormoved dimmed-zebra
git config --global diff.colormovedws allow-indentation-change

@mrjones2014
Copy link
Owner

Sorry for the delay. Been crazy at my day job.

I am pretty sure that ignoring at_edge on floating windows is intended behavior. There is a separate option float_win_behavior that controls the intended behavior for floating windows, since most users want them to be treated differently from normal windows.

See: #201 #202

I would be open to adding support for float_win_behavior = 'at-edge' to make the floating window behavior mimic the regular at-edge behavior.

@thenbe
Copy link
Contributor Author

thenbe commented Jul 2, 2024

I would be open to adding support for float_win_behavior = 'at-edge' to make the floating window behavior mimic the regular at-edge behavior.

That would be even better. :)

@jkellz-dev
Copy link

jkellz-dev commented Mar 10, 2025

Did anything happen with this? I am running into it with LazyVim's Snacks.Explorer plugin. Since the file explorer is technically a floating window, it breaks navigation. Works great with NeoTree. I might be missing configuration to make it work, but it seems like its the floating window thats mucking it all up.

@mrjones2014
Copy link
Owner

I proposed an alternative approach here but the PR hasn't moved since then.

Happy for anyone to pick this up, it should be relatively straightforward to implement.

@jkellz-dev
Copy link

happy to submit a PR. Not completely familiar with the inner workings here. Looking at the related changes, adding a universal handling of floating windows at_edge may not be desired. Since the edges may be different depending on configuration. Would adding an exception list for buftype/filetype be amenable?

I'm thinking about how you could have 2 projects open side by side. smart-splits needs to know the pane is in a position.

Screenshot 2025-03-11 at 11 13 47

Maybe this is better fixed from the Snacks.Explorer side.

@mrjones2014
Copy link
Owner

Would adding an exception list for buftype/filetype be amenable?

That sounds fine. There's already global tables for that in config, but if we need a more context-specific config entry, that's also fine.

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.

[Bug]: at_edge has no effect for floating windows when float_win_behavior = 'mux'
3 participants