diff --git a/README.md b/README.md index c340cbd..2308e3b 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ require('smart-splits').setup({ -- }, -- direction = 'left'|'right'|'up'|'down', -- split(), -- utility function to split current Neovim pane in the current direction + -- wrap(), -- utility function to wrap to opposite Neovim pane -- } -- NOTE: `at_edge = 'wrap'` is not supported on Kitty terminal -- multiplexer, as there is no way to determine layout via the CLI diff --git a/lua/smart-splits/api.lua b/lua/smart-splits/api.lua index bc4e846..b54ec99 100644 --- a/lua/smart-splits/api.lua +++ b/lua/smart-splits/api.lua @@ -348,6 +348,9 @@ local function move_cursor(direction, opts) split = function() split_edge(direction) end, + wrap = function() + next_win_or_wrap(will_wrap, DirectionKeysReverse[direction]) + end, } at_edge(ctx) return