mrjones2014 / smart-splits.nvim

🧠 Smart, seamless, directional navigation and resizing of Neovim + terminal multiplexer splits. Supports tmux, Wezterm, and Kitty. Think about splits in terms of "up/down/left/right".
MIT License
831 stars 33 forks source link

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

Open thenbe opened 1 month ago

thenbe commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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. :)