| Age | Commit message (Collapse) | Author | Files | Lines |
|
Notice that currently only single letter register names/array indices are
supported.
Register handling needs to be cleaned up at some point.
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
If lpeg is built statically, this allows for a completely static vis
binary that still supports syntax highlighting.
|
|
Expose text_object_word as an example.
|
|
|
|
|
|
Previously we would also interpret a missing return value `nil` as
is the case when no pre save event handler is subscribed as failure.
|
|
|
|
|
|
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
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
Close #407
|
|
|
|
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.
|
|
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.
|
|
Indicating that the event is triggered *after* a successfull write.
|
|
|
|
|
|
|
|
Also rename underlying C code.
|
|
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.
|
|
|
|
Triggered after the new file content has been written to disk.
|
|
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).
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
available
|
|
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.
|
|
Make window status bar content configurable via Lua.
|
|
|
|
|
|
|
|
It is a string in `git describe` format, as reporte by `vis -v`.
|
|
|
|
|
|
|
|
|