summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-12-20buffer: implement buffer_capacity utility functionMarc André Tanner
2016-12-20buffer: implement buffer_appendf to append formatted contentMarc André Tanner
2016-12-20buffer: fix error case in buffer_append0Marc André Tanner
Do not change buffer length when failing to append.
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: introduce vis_register_from utility functionMarc André Tanner
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-17test: updateMarc André Tanner
2016-12-17vis: allow boolean :set options to be toggledMarc André Tanner
Boolean options can be toggled by appending `!` to the option name. Close #435
2016-12-17vis: always remove consumed keys from input queueMarc André Tanner
When given a mapping like: :map! insert >> ><>x> whose end is a prefix of another mapping we should still remove all already consumed keys from the input queue. Fixes #436
2016-12-16travis: try to enable code coverage for test/coreMarc André Tanner
2016-12-16build: update unused make standalone/local Lua reference to 5.3.3Marc André Tanner
2016-12-16vis: process keys following an unmatched prefix individuallyMarc André Tanner
Fixes #434
2016-12-16vis: add section about compile time configuration to :help outputMarc André Tanner
2016-12-15build: move $CFLAGS_DEBUG into config.mkMarc André Tanner
This allows inclusion in other Makefiles (e.g. for C unit tests).
2016-12-15vis: always store registers values NUL terminatedMarc André Tanner
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.
2016-12-15vis: respect terminating NUL bytes in the input queueMarc André Tanner
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
2016-12-15vis: more informative error message for :set optionJosh Wainwright
Close #433
2016-12-14lua: make sure we always load a default themeMarc André Tanner
2016-12-14lua: improve error message when failing to load lpeg/lexer moduleMarc André Tanner
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.
2016-12-14vis: remove useless NULL checkMarc André Tanner
The very first thing we do if that check is false, is return from the function.
2016-12-14build: improve description of --enable-lpeg configure optionMarc André Tanner
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.
2016-12-14lua: avoid errors if no theme is setMarc André Tanner
Close #429
2016-12-14lua: add crontab file type and configure it to save in-placeMarc André Tanner
This should fix isses with `crontab -e` editing.
2016-12-14lua: allow per file type :commands being executedMarc André Tanner
2016-12-14lua: use Lua patterns to match file extensionsMarc André Tanner
2016-12-14vis: add new :set savemethod auto|atomic|inplace optionMarc André Tanner
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`.
2016-12-14text: expose text save method to calling codeMarc André Tanner
There are cases where it is useful to specify how the file should be saved.
2016-12-13build: fix Cygwin buildMarc André Tanner
The simple method lpeg uses to create a shared library does not seem to work in Cygwin.
2016-12-13man: avoid standard directives which are undefined for some groff versionsMarc André Tanner
This fixes a warning when displaying the manual page on macOS systems.
2016-12-13build: remove internal configure options from help textMarc André Tanner
These are used by `make standalone` but are not really appropriate for normal usage and just cause confusion as demonstrated by #373.
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-09Remove useless variable assignmentMarc André Tanner
Fixes CID 139067.
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-09man: fix mistakesMarc André Tanner
2016-12-09vis-lua: add comment about possibly outdated Lua API documentationMarc André Tanner
2016-12-09lua: add more mime types for file type detectionMarc André Tanner
2016-12-09vis-lua: expose input key event in insert and replace modesMarc André Tanner
2016-12-08vis: rename some internal C function pointersMarc André Tanner
2016-12-08build: include Lua files in windows zipMarc André Tanner
2016-12-08Update tests to changes in Lua APIMarc 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-08Move manual pages to man/ subfolderMarc André Tanner
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.