aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-30Improve Lua error reportingMarc André Tanner1-7/+29
Display Lua errors in a dedicated window/file. A typo or missing dependency (e.g. lpeg) in visrc.lua will no longer silently fail without any indication. The Lua integration in view.h is not yet converted.
2015-12-31vis-lua: implement vis.events.{start,quit} eventsMarc André Tanner1-2/+11
2015-12-31vis-lua: implement window.cursor.{line, col, pos}Marc André Tanner1-0/+57
These are currently read-only properties.
2015-12-31vis-lua: implement vis.lines[..] arrayMarc André Tanner1-14/+90
This allows access to specific lines of a file, array indicies/line numbers are 1 based. Read access is supported for [1, #lines] while assigning to the 0 element will insert a new line at the beginning of the file. Similarly assigning to lines[#lines+1] will add a new line at the end of the file. The returned lines will not contain any line termination characters.
2015-12-31vis-lua: implement vis.open(filename)Marc André Tanner1-0/+12
2015-12-31vis-lua: rename a few functionsMarc André Tanner1-35/+50
2015-12-31vis-lua: remove unnecessary castsMarc André Tanner1-8/+8
2015-12-29vis: fix default lua package.path and support $XDG_CONFIG_HOMEMarc André Tanner1-13/+22
The ordered list of paths for startup and lexer files is: - $VIS_PATH/{,lexers} - $XDG_CONFIG_HOME/vis/{,lexers} (defaulting to $HOME/.config/vis/{,lexers}) - /usr/local/share/vis/{,lexers} - /usr/share/vis/{,lexers} - package.path (standard lua search path)
2015-12-26vis: change Lua package.path to also include vis base directoryMarc André Tanner1-8/+12
2015-12-26vis: refactor Lua integrationMarc André Tanner1-0/+491
Lua support can now be disabled at compile time using: $ make CONFIG_LUA=0 This commit also adds an initial Lua API and provides a few default hooks. We now also require Lua >= 5.2 due to the uservalue constructs. In principle the same functionality could be implemented using function environments from Lua 5.1.