Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. --
  2. -- Purpose:
  3. --
  4. --   Make alt-t (or any other key) toggle between "Long" and "Custom" listing mode.
  5. --
  6. --   For use in mc^2.
  7. --
  8. -- Reference:
  9. --
  10. --   This snippet was written in response to:
  11. --
  12. --     https://mail.gnome.org/archives/mc/2017-June/msg00002.html
  13. --     "using 'alt-t' to switch to single-panel mode"
  14. --
  15. -- More info:
  16. --
  17. --   See the documentation for Panel's list_type property:
  18. --
  19. --     https://www.geek.co.il/~mooffie/mc-lua/docs/html/classes/ui.Panel.html#ui.Panel:list_type
  20. --
  21. --   (See there for how to install mc^2)
  22. --
  23.  
  24. ui.Panel.bind('alt-t', function(pnl)
  25.   if pnl.list_type ~= "long" then
  26.     pnl.list_type = "long"
  27.   else
  28.     pnl.list_type = "custom"
  29.   end
  30.   tty.redraw()
  31. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement