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

[Bug]: `at_edge` has no effect for floating windows when `float_win_behavior = 'mux'` #217

Open thenbe opened 1 month ago

thenbe commented 1 month ago

Steps to Reproduce

opts.at_edge is not called when float_win_behavior = 'mux'

Minimal Reproduction

{
    float_win_behavior = 'mux',
    at_edge = function(context)
        print('foo')
    end,
}
  1. Use the previous config.
  2. Open a floating window.
  3. Invoke the keymap that corresponds to move_cursor_right().
  4. . EXPECTED: foo should be printed ACTUAL: foo is not printed

Cause

Because we are returning early: https://github.com/mrjones2014/smart-splits.nvim/blob/9a6cd461000e518be35ae830e46695e9b8b4c315/lua/smart-splits/api.lua#L359-L363

We never reach the point where at_edge() is called: https://github.com/mrjones2014/smart-splits.nvim/blob/9a6cd461000e518be35ae830e46695e9b8b4c315/lua/smart-splits/api.lua#L393

Versions

nvim v0.10.0
kitty 0.35.1