Advertisement
LDDestroier

Eldit BETA

Oct 5th, 2016
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. --Eldit text elditor
  2.  
  3. local tArg = {...}
  4. local filename, lineNo, doAutosave, doAutoDisplay = tArg[1], tArg[2] or 1, false, false
  5. if tArg[3] == "-s" or tArg[4] == "-s" then
  6.     doAutosave = true
  7. end
  8.  
  9. if tArg[3] == "-u" or tArg[4] == "-u" then
  10.     doAutoDisplay = true
  11. end
  12.  
  13. local displayHelp = function()
  14.     print("eldit <file> [line] [-u] [-s]")
  15.     print("-u - immediately display changes")
  16.     print("-s - autosave")
  17. end
  18.  
  19. if not filename then
  20.     return displayHelp()
  21. end
  22.  
  23. local scroll = 1
  24.  
  25. local render = function(text,scrollx,scrolly)
  26.     term.setCursorPos(1,scrolly)
  27.     term.write(text)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement