aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
AgeCommit message (Collapse)AuthorFilesLines
2017-02-02add /etc/vis to lua path for system-wide configuration by administratorChristian Hesse1-0/+3
2017-01-27vis-lua: introduce vis:replace functionMarc André Tanner1-0/+20
2017-01-27vis-lua: introduce vis:insert functionMarc André Tanner1-0/+20
2017-01-15vis-lua: pass pending keys to lua key handling functionsMarc André Tanner1-8/+69
2017-01-14vis-lua: allow mode changes by setting vis.modeMarc André Tanner1-1/+14
2017-01-10vis-lua: expose register names as vis:register_names()Marc André Tanner1-1/+38
2017-01-10vis-lua: expose valid marks as vis:mark_names()Marc André Tanner1-0/+38
2016-12-31vis: allow user registered :-commands to specify a help textMarc André Tanner1-1/+3
2016-12-29vis-lua: allow vis:map to set up key aliases and actionsMarc André Tanner1-15/+51
2016-12-29vis-lua: introduce vis:action_registerMarc André Tanner1-0/+32
2016-12-29vis: cleanup key action lifetime managementMarc André Tanner1-13/+5
2016-12-29vis-lua: simplify lua function reference handlingMarc André Tanner1-31/+17
2016-12-29vis-lua: luaL_checkstring already checks for NULL return valueMarc André Tanner1-7/+6
2016-12-27vis: properly free dynamic key bindingsMarc André Tanner1-5/+5
The handling of :unmap needs to be revisited at some point.
2016-12-22vis-lua: store Vis context in upvalues where neededMarc André Tanner1-5/+8
2016-12-22text: change datatype of Mark to uintptr_tMarc André Tanner1-1/+1
This should avoid undefined pointer comparisons.
2016-12-19vis-lua: implement vis.registers[] arrayMarc André Tanner1-1/+58
Notice that currently only single letter register names/array indices are supported. Register handling needs to be cleaned up at some point.
2016-12-19vis-lua: simplify obj_ref_new error handlingMarc André Tanner1-10/+9
2016-12-19vis-lua: simplify object reference checkingMarc André Tanner1-163/+58
Make obj_ref_check handle invalid object references. The luaL_argerror function throws a Lua error and never returns, hence all return value checks become obsolete.
2016-12-19vis-lua: implement file.marks[] arrayMarc André Tanner1-0/+65
We need to retrieve a pointer to the File struct but can not store it directly in the Lua uservalue because the address is already used for the regular file object (of type vis.file). For now we use file->marks as an address and then use offsetof to retrieve the start of the struct.
2016-12-19vis-lua: implement file:mark_{get,set}Marc André Tanner1-0/+38
2016-12-13build: add configure options for built-in lpeg supportMarc André Tanner1-1/+1
2016-12-12Allow building lpeg into visMichael Forney1-0/+9
If lpeg is built statically, this allows for a completely static vis binary that still supports syntax highlighting.
2016-12-09vis-lua: add generic way to expose C text objects to LuaMarc André Tanner1-1/+41
Expose text_object_word as an example.
2016-12-09vis-lua: add comment about possibly outdated Lua API documentationMarc André Tanner1-0/+2
2016-12-09vis-lua: expose input key event in insert and replace modesMarc André Tanner1-1/+34
2016-12-08vis-lua: only fail file_save_pre event if explicitly returned falseMarc André Tanner1-1/+1
Previously we would also interpret a missing return value `nil` as is the case when no pre save event handler is subscribed as failure.
2016-12-08vis-lua: move mode constants from vis.MODE_* to vis.modes.*Marc André Tanner1-33/+33
2016-12-08vis-lua: add optional help parameter to mapping functionsMarc André Tanner1-2/+6
2016-12-08vis-lua: expose init event and use it to set default themeMarc André Tanner1-1/+10
The init event is emitted immediately after `visrc.lua` has been sourced, but before any other events have occured, in particular the command line arguments have not yet been processed. Close #422
2016-12-08lua: add simple event multiplexing mechanismMarc André Tanner1-5/+6
The editor core calls into the functions registered in the `vis.events` table which then multiplex the events to all registered event handlers. The first handler which returns a non `nil` value terminates event propagation.
2016-12-07Move all lua related files to lua/ subfolderMarc André Tanner1-5/+13
Also remove the lexers sub directory from the Lua search path. As a result we attempt to open fewer files during startup: $ strace -e open -o log ./vis +q config.h && wc -l log In order to avoid having to modifiy all lexers which `require('lexer')` we instead place a symlink in the top level directory. $ ./configure --disable-lua $ rm -rf lua Should result in a source tree with most lua specifc functionality removed.
2016-12-06vis-lua: more extensive Lua API documentationMarc André Tanner1-30/+192
2016-12-05vis-lua: add preliminary version of LDoc based Lua API documentationMarc André Tanner1-3/+364
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é Tanner1-0/+5
Close #407
2016-11-27vis-lua: lua_pushtring already takes care of NULL stringMarc André Tanner1-16/+4
2016-11-22vis-lua: introduce pre-save hookMarc André Tanner1-0/+18
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é Tanner1-3/+7
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é Tanner1-3/+3
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é Tanner1-0/+26
2016-11-10vis: fix compilation with Lua support disabledMarc André Tanner1-1/+1
2016-11-10vis: change default status bar indication for Windows style line endingsMarc André Tanner1-2/+2
2016-11-10vis-lua: change misnamed attribute values of `file.newlines`Marc André Tanner1-5/+5
Also rename underlying C code.
2016-11-05vis: display Lua package.cpath in :help outputMarc André Tanner1-4/+10
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é Tanner1-1/+1
2016-09-19vis-lua: expose file save event to luaMarc André Tanner1-1/+7
Triggered after the new file content has been written to disk.
2016-09-19vis-lua: expose file open event to luaMarc André Tanner1-0/+7
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é Tanner1-0/+8
2016-05-26vis: use normalized absolute file names as internal representationMarc André Tanner1-2/+2
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é Tanner1-1/+10