Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --
- -- Purpose:
- --
- -- Make alt-t (or any other key) toggle between "Long" and "Custom" listing mode.
- --
- -- For use in mc^2.
- --
- -- Reference:
- --
- -- This snippet was written in response to:
- --
- -- https://mail.gnome.org/archives/mc/2017-June/msg00002.html
- -- "using 'alt-t' to switch to single-panel mode"
- --
- -- More info:
- --
- -- See the documentation for Panel's list_type property:
- --
- -- https://www.geek.co.il/~mooffie/mc-lua/docs/html/classes/ui.Panel.html#ui.Panel:list_type
- --
- -- (See there for how to install mc^2)
- --
- ui.Panel.bind('alt-t', function(pnl)
- if pnl.list_type ~= "long" then
- pnl.list_type = "long"
- else
- pnl.list_type = "custom"
- end
- tty.redraw()
- end)
Advertisement
Add Comment
Please, Sign In to add comment