summaryrefslogtreecommitdiff
path: root/vis-lua.c
AgeCommit message (Collapse)Author
2016-12-05vis-lua: add preliminary version of LDoc based Lua API documentationMarc André Tanner
A new Makefile target `luadoc` has been added which generates HTML documentation in the doc subfolder using ldoc(1) from https://stevedonovan.github.io/ldoc/ There are still a few problems to resovle, for example the links (e.g. in parameter lists) to our custom types seem to be broken. At this point only the C part of the Lua API is covered and even that is not yet complete.
2016-11-28vis-lua: add file.path property denoting the absolute path to the fileMarc André Tanner
Close #407
2016-11-27vis-lua: lua_pushtring already takes care of NULL stringMarc André Tanner
2016-11-22vis-lua: introduce pre-save hookMarc André Tanner
The first argument is the file object while the second argument denotes the full path to which it will be written. Path might be `nil` if the file is going to be written to stdout. The Lua function is expected to return a boolean value indicating whether the write operation should proceed or be aborted.
2016-11-22vis-lua: pass path as second argument to file_save_post event hookMarc André Tanner
The passed path can be different from file.name for instance when opening a file `a` and then doing `:w b` where file.name will be the former and path the latter.
2016-11-21vis-lua: rename file_save event to file_save_postMarc André Tanner
Indicating that the event is triggered *after* a successfull write.
2016-11-14vis-lua: add vis.ui.colors denoting the number of available colorsMarc André Tanner
2016-11-10vis: fix compilation with Lua support disabledMarc André Tanner
2016-11-10vis: change default status bar indication for Windows style line endingsMarc André Tanner
2016-11-10vis-lua: change misnamed attribute values of `file.newlines`Marc André Tanner
Also rename underlying C code.
2016-11-05vis: display Lua package.cpath in :help outputMarc André Tanner
These paths are used to load the Lua LPeg module (lpeg.so) and are thus helpful when diagnosing setup problems in case syntax highlighting does not work.
2016-10-05Fix various issues reported by coverity scanMarc André Tanner
2016-09-19vis-lua: expose file save event to luaMarc André Tanner
Triggered after the new file content has been written to disk.
2016-09-19vis-lua: expose file open event to luaMarc André Tanner
The event is only triggerred for new files read from disk (e.g. splitting an existing window will not cause an event to be emitted).
2016-08-24vis-lua: add win:draw() functionMarc André Tanner
2016-05-26vis: use normalized absolute file names as internal representationMarc André Tanner
Try to display a shorthand version in the status bar, this currently only works for files below the current working directory of the editor process.
2016-05-24vis-lua: cleanup Lua status bar display codeMarc André Tanner
2016-05-24vis: cleanup C status bar display codeMarc André Tanner
2016-05-24vis-lua: improve error handling when loading visrc.luaMarc André Tanner
If loading fails because visrc.lua is not found, then simply display an information message. However if there is a syntax error, display a complete stack trace. This fixes commit 352155889aad57f8cb6d20317ffef81073fb6533.
2016-05-24vis-lua: add debug infrastructure to trace object lifetimeMarc André Tanner
Output will be printed to stdout and can be enabled by: $ make debug CFLAGS=-DDEBUG_LUA=1 $ ./vis > log This commit also tries to make object creation slightly more robust.
2016-05-22vis: only display mode in status bar of active windowMarc André Tanner
2016-05-22vis-lua: introduce light references for short lived objectsMarc André Tanner
Light object references are used to type check, but contrary to full object references they are not stored in the Lua registry. This means that they are not bound to the object lifetime of their corresponding C object. Hence such objects must not be used after they have been free(3)-ed by the editor core. Such lightweight object references are always re-created, thus custom properties will not be stored across subsequent accesses. For now light object references are only used for cursor objects. This should ix the crashes introduced by the recent changes which make heavy use of the Lua API.
2016-05-22vis-lua: fall back to C status bar handling if the Lua implementation is not ↵Marc André Tanner
available
2016-05-22vis-lua: do not report errors recursivelyMarc André Tanner
Displaying an error might create a new window which in turn can trigger new events (all other windows are resized+redrawn) which might again cause errors. There is still no sane way to exit the editor in this case, but at least the error messages should be readable.
2016-05-22vis: refactor status line handlingMarc André Tanner
Make window status bar content configurable via Lua.
2016-05-22vis-lua: add win:status functionMarc André Tanner
2016-05-22vis-lua: add vis.recording propertyMarc André Tanner
2016-05-22vis-lua: add window.{width, height} read only propertiesMarc André Tanner
2016-05-22vis-lua: add vis.VERSION propertyMarc André Tanner
It is a string in `git describe` format, as reporte by `vis -v`.
2016-05-22vis: consider :set horizon setting when syntax highlightingMarc André Tanner
2016-05-22vis: move syntax highlighting to pure Lua codeMarc André Tanner
2016-05-22vis-lua: add window.viewport rangeMarc André Tanner
2016-05-22vis-lua: add bindings for new view style functionsMarc André Tanner
2016-05-22vis-lua: cleanup vis.MODE_* constants handlingMarc André Tanner
2016-05-18vis-lua: fail more silently when visrc.lua can not be loadedMarc André Tanner
This prevents opening a separate window to display a full stack trace and improves usage of a vis binary compiled with lua support on a system without the necessary *.lua files.
2016-05-14vis-lua: add win:map function for window local key mappingsMarc André Tanner
Based on a patch by Josh Wainwright. Close #306
2016-05-13vis: clean up key mapping implementationMarc André Tanner
2016-05-13vis-lua: add more restrictive checks for position argumentsMarc André Tanner
Negative and fractional arguments are rejected.
2016-05-04vis-lua: add new theme_change event hookMarc André Tanner
2016-05-04vis-lua: simplify event callback codeMarc André Tanner
2016-05-04Fixed bug, use $XDG_CONFIG_HOME correctlyAdrian Room
Vis should look for files in `$XDG_CONFIG_HOME/vis`, not just `$XDG_CONFIG_HOME` directly.
2016-05-01vis-lua: let vis:map override existing mappingsMarc André Tanner
It now also unmaps all previously mapped prefixes of the new mapping. See 0ef138085f885d4576a8e53d079e1f00f80799bf and #271.
2016-05-01vis-lua: expose vis:feedkeys APIMarc André Tanner
2016-04-27vis-lua: fix vis.win to always return currently focused windowMarc André Tanner
2016-04-26vis-lua: add file.modified propertyMarc André Tanner
2016-04-23vis: display lua search paths in :help outputMarc André Tanner
2016-04-21vis-lua: allow selection modification by assigning to cursor.selectionMarc André Tanner
2016-04-21vis-lua: implement vis:message(msg)Marc André Tanner
2016-04-21vis-lua: also accept a range as argument for file:delete and file:contentMarc André Tanner
2016-04-21vis-lua: add vis:command_register to map a Lua function to a :-commandMarc André Tanner
The following registers `:foo` as a command which prints a few things to stdout: vis:command_register("foo", function(argv, force, win, cursor, range) for i,arg in ipairs(argv) do print(i..": "..arg) end print("was command forced with ! "..(force and "yes" or "no")) print(win.file.name) print(cursor.pos) print(range ~= nil and ('['..range.start..', '..range.finish..']') or "invalid range") return true; end)