This commit is contained in:
sxyazi
2024-07-12 21:36:17 +08:00
parent c8b3e3979d
commit 3783ea0feb
8 changed files with 33 additions and 36 deletions

View File

@@ -16,7 +16,7 @@ Add this to your `~/.config/yazi/keymap.toml`:
```toml
[[manager.prepend_keymap]]
on = [ "T" ]
on = "T"
run = "plugin --sync hide-preview"
desc = "Hide or show preview"
```

View File

@@ -1,20 +1,18 @@
local function entry(st)
if st.old then
Manager.layout, st.old = st.old, nil
Tab.layout, st.old = st.old, nil
else
st.old = Manager.layout
Manager.layout = function(self, area)
self.area = area
st.old = Tab.layout
Tab.layout = function(self)
local all = MANAGER.ratio.parent + MANAGER.ratio.current
return ui.Layout()
self._chunks = ui.Layout()
:direction(ui.Layout.HORIZONTAL)
:constraints({
ui.Constraint.Ratio(MANAGER.ratio.parent, all),
ui.Constraint.Ratio(MANAGER.ratio.current, all),
ui.Constraint.Length(1),
})
:split(area)
:split(self._area)
end
end
ya.app_emit("resize", {})