A small lua function that allows to temporarily set column width of the active window to full (1.0 colsize)
0
hypland scrolling set window column size
1hl.bind(main_mod .. " + F", function()
2 local window = hl.get_active_window()
3 if window == nil then return end
4
5 if type(window.layout) == "table" then
6 -- Should only work on scrolling layout
7 if window.layout.name == "scrolling" then
8 local is_last = #window.workspace:get_windows() - 1 == window.layout.column.index
9
10 --common:debug("Is last", is_last)
11
12 local old_width = window.layout.column.width
13 local new_width
14 if old_width == 1.0 then
15 new_width = hl.get_config("scrolling.column_width")
16 else
17 new_width = 1.0
18 end
19
20 hl.dispatch(hl.dsp.layout("colresize " .. new_width))
21
22 if is_last and old_width == 1.0 then
23 hl.dispatch(hl.dsp.layout("move -col"))
24 end
25
26 -- Set focus back to the original window
27 hl.dispatch(hl.dsp.focus({ window = window }))
28 end
29 end
30end)