Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. local GUI = require("GUI")
  2. local buffer = require("doubleBuffering")
  3.  
  4. --------------------------------------------------------------------------------
  5.  
  6. buffer.clear(0x1E1E1E)
  7.  
  8. -- Open file and read it's lines
  9. local y = 1
  10. for line in io.lines("/lib/advancedLua.lua") do
  11. -- Replace tab symbols to 2 whitespaces and Windows line endings to UNIX line endings
  12. line = line:gsub("\t", " "):gsub("\r\n", "")
  13. -- Highlight result
  14. GUI.highlightString(3, y, buffer.getWidth(), 1, 2, GUI.LUA_SYNTAX_PATTERNS, GUI.LUA_SYNTAX_COLOR_SCHEME, line)
  15.  
  16. y = y + 1
  17. if y > buffer.getHeight() then
  18. break
  19. end
  20. end
  21.  
  22. buffer.drawChanges(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement