| Age | Commit message (Collapse) | Author | Files | Lines |
|
Previously we only made sure that the register content is NUL terminated
when reading it out. This made it impossible to distinguish between an
empty register and one which stores a single NUL byte. Now the in memory
representation of a non-empty register is always NUL terminated. When
appending we temporarily remove the trailing NUL byte and restore
it later.
This should fix put commands of a previously yanked single NUL byte.
|
|
It can happen that the Buffer content used for the input queue becomes
<\000> where the NUL byte is intended to terminate the queue, but termkey
happily parses it and because it is delimited by < and > on both sides
we then interpret it as a key. In input mode this leads to the insertion
of a NUL byte which is displayed as ^@.
Close #432
|
|
Close #433
|
|
|
|
Differentiate between the case where the module is not found and
the case where an error occured while loading it.
This should make it easier to debug cases in which there is a
Lua version mismatch between vis and lpeg.
|
|
The very first thing we do if that check is false, is return from the function.
|
|
It links lpeg statically into the vis binary, meaning it does not need
to be dlopen(3)-ed at runtime. While this improves the portability of
the resulting vis binary, it is not necessary to enable this option to
get syntax highlighting support.
Maybe the option should be renamed to avoid further confusion.
|
|
Close #429
|
|
This should fix isses with `crontab -e` editing.
|
|
|
|
|
|
Specifies how the current file should be saved, `atomic` which uses
rename(2) to atomically replace the file, `inplace` which truncates the
file and then rewrites it or `auto` which tries the former before falling
back to the latter. The rename method fails for symlinks, hardlinks,
in case of insufficient directory permissions or when either the file
owner, group, POSIX ACL or SELinux labels can not be restored.
The option defaults to `auto`.
|
|
There are cases where it is useful to specify how the file should be saved.
|
|
The simple method lpeg uses to create a shared library does not seem
to work in Cygwin.
|
|
This fixes a warning when displaying the manual page on macOS systems.
|
|
These are used by `make standalone` but are not really appropriate
for normal usage and just cause confusion as demonstrated by #373.
|
|
|
|
If lpeg is built statically, this allows for a completely static vis
binary that still supports syntax highlighting.
|
|
Fixes CID 139067.
|
|
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.
|
|
The following structure is adapted:
* visrc.lua entry point for all Lua code
* vis.lua only implements the Lua part of the core API
* vis-std.lua registers standard event handlers (e.g. syntax highlighting,
statusbar handling, theme changes etc). It is sourced from vis.lua.
* plugins/* non essential editor functionality, needs to be explicitly
enabled by loading it from visrc.lua
|
|
Close #424
|
|
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.
|
|
Reference external manual page and Lua API documentation.
This is still work in progress the piece table documentation should
probably also be moved somewhere else.
|
|
|
|
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.
|
|
Reject invalid cursor positions.
|
|
|
|
File type detection works as follows:
1) strip off suffixes to be ignored and test against a
set of known file extensions
2) run `file -bL --mime-type` and check against a set
of known mime types
3) read out the first few bytes of the file and pass
them to custom Lua file type detection functions
For now the configured file extensions are literal strings
which are matched against the end of the file name. Maybe
we should use Lua patterns instead.
We will need to add more mime types to our mapping table.
For now only the `bash` file type was associated with the
text/x-shellscript mime type.
|
|
This avoids warnings like: "_FORTIFY_SOURCE requires
compiling with optimization".
|
|
Only accept numbers in range [0, INT_MAX]. Reject trailing garbage,
where before something like `:set cc 50NaN` worked it will now cause
an error.
Close #418
|
|
The version substitution does not seem to work with BSD make
because ${VERSION} is expanded to an empty string.
|
|
Uses mandoc(1) to generate manual pages in HTML format.
|
|
|
|
They now pass `mandoc -Tlint` (the BSD manpage renderer) and `man
--warnings=w` (the GNU one).
|
|
|
|
Conflicts:
vis.1
|