Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local GUI = require("GUI")
- local buffer = require("doubleBuffering")
- --------------------------------------------------------------------------------
- buffer.clear(0x1E1E1E)
- -- Open file and read it's lines
- local y = 1
- for line in io.lines("/lib/advancedLua.lua") do
- -- Replace tab symbols to 2 whitespaces and Windows line endings to UNIX line endings
- line = line:gsub("\t", " "):gsub("\r\n", "")
- -- Highlight result
- GUI.highlightString(3, y, buffer.getWidth(), 1, 2, GUI.LUA_SYNTAX_PATTERNS, GUI.LUA_SYNTAX_COLOR_SCHEME, line)
- y = y + 1
- if y > buffer.getHeight() then
- break
- end
- end
- buffer.drawChanges(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement