Skip to content

Commit de240dd

Browse files
authored
fix: window ordering on restore (#35)
* fix: reverse window layout recreation * fix typo
1 parent 959256c commit de240dd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/resession/layout.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ local function set_winlayout(layout)
8989
end
9090
else
9191
local winids = {}
92+
local splitright = vim.opt.splitright
93+
local splitbelow = vim.opt.splitbelow
94+
vim.opt.splitright = true
95+
vim.opt.splitbelow = true
9296
for i in ipairs(layout[2]) do
9397
if i > 1 then
9498
if type == "row" then
@@ -99,6 +103,8 @@ local function set_winlayout(layout)
99103
end
100104
table.insert(winids, vim.api.nvim_get_current_win())
101105
end
106+
vim.opt.splitright = splitright
107+
vim.opt.splitbelow = splitbelow
102108
for i, v in ipairs(layout[2]) do
103109
vim.api.nvim_set_current_win(winids[i])
104110
set_winlayout(v)

0 commit comments

Comments
 (0)