summaryrefslogtreecommitdiff
path: root/vis-lua.c
AgeCommit message (Collapse)Author
2017-03-05vis-lua: expose vis:pipe functionMarc André Tanner
2017-03-03vis-lua: add vis:exit functionMarc André Tanner
2017-03-02vis-lua: fix bogus URL in LDoc commentMarc André Tanner
2017-03-01vis-lua: fix invalid LDoc tagMarc André Tanner
2017-03-01vis-lua: make cursor.pos return nil if cursor position is invalidMarc André Tanner
It remains to be seen whether that is a good idea, but at least it will reveal possible bugs.
2017-03-01vis-lua: document cursor behaviorMarc André Tanner
2017-02-28vis-lua: correctly treat return value of input event handlerMarc André Tanner
Returning true from the event handler, indicating that the keys were consumed, should now prevent insertion as mentioned in the documentation. vis.events.subscribe(vis.events.INPUT, function(key) if key == ' ' then -- do something fancy here return true end end)
2017-02-28vis-lua: fix wrong return value when setting vis.countMarc André Tanner
2017-02-27vis-lua: make vis:win assignableAlexandre Rames
2017-02-23vis-lua: use shorter type namesMarc André Tanner
2017-02-23vis-lua: cleanup type checks by using #define'sMarc André Tanner
2017-02-23vis-lua: make vis:count assignableMarc André Tanner
2017-02-22vis-lua: expose current count specifier as vis:countMarc André Tanner
2017-02-22vis-lua: expose type meta tables through vis.typesMarc André Tanner
This should allow the Lua code to add new methods even if it has no existing object references.
2017-02-22lua: expose vis:module_exist method, load lexer and lpeg module during startupMarc André Tanner
2017-02-22vis-lua: check for nil return value of text object callbackMarc André Tanner
2017-02-02update comment and readme about lua pathChristian Hesse
Commit 3570869c removed the lexers sub directory from the Lua search path. Update the comment and readme to reflect this change.
2017-02-02add /etc/vis to lua path for system-wide configuration by administratorChristian Hesse
2017-01-27vis-lua: introduce vis:replace functionMarc André Tanner
2017-01-27vis-lua: introduce vis:insert functionMarc André Tanner
2017-01-15vis-lua: pass pending keys to lua key handling functionsMarc André Tanner
2017-01-14vis-lua: allow mode changes by setting vis.modeMarc André Tanner
2017-01-10vis-lua: expose register names as vis:register_names()Marc André Tanner
2017-01-10vis-lua: expose valid marks as vis:mark_names()Marc André Tanner
2016-12-31vis: allow user registered :-commands to specify a help textMarc André Tanner
2016-12-29vis-lua: allow vis:map to set up key aliases and actionsMarc André Tanner
2016-12-29vis-lua: introduce vis:action_registerMarc André Tanner
2016-12-29vis: cleanup key action lifetime managementMarc André Tanner
2016-12-29vis-lua: simplify lua function reference handlingMarc André Tanner
2016-12-29vis-lua: luaL_checkstring already checks for NULL return valueMarc André Tanner
2016-12-27vis: properly free dynamic key bindingsMarc André Tanner
The handling of :unmap needs to be revisited at some point.
2016-12-22vis-lua: store Vis context in upvalues where neededMarc André Tanner
2016-12-22text: change datatype of Mark to uintptr_tMarc André Tanner
This should avoid undefined pointer comparisons.
2016-12-19vis-lua: implement vis.registers[] arrayMarc André Tanner
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é Tanner
2016-12-19vis-lua: simplify object reference checkingMarc André Tanner
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é Tanner
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é Tanner
2016-12-13build: add configure options for built-in lpeg supportMarc André Tanner
2016-12-12Allow building lpeg into visMichael Forney
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é Tanner
Expose text_object_word as an example.
2016-12-09vis-lua: add comment about possibly outdated Lua API documentationMarc André Tanner
2016-12-09vis-lua: expose input key event in insert and replace modesMarc André Tanner
2016-12-08vis-lua: only fail file_save_pre event if explicitly returned falseMarc André Tanner
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é Tanner
2016-12-08vis-lua: add optional help parameter to mapping functionsMarc André Tanner
2016-12-08vis-lua: expose init event and use it to set default themeMarc André Tanner
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é Tanner
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é Tanner
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é Tanner