aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-12-20buffer: implement buffer_capacity utility functionMarc André Tanner2-0/+6
2016-12-20buffer: implement buffer_appendf to append formatted contentMarc André Tanner2-15/+26
2016-12-20buffer: fix error case in buffer_append0Marc André Tanner1-3/+6
Do not change buffer length when failing to append.
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: introduce vis_register_from utility functionMarc André Tanner3-37/+37
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-17test: updateMarc André Tanner1-5/+5
2016-12-17vis: allow boolean :set options to be toggledMarc André Tanner2-13/+32
Boolean options can be toggled by appending `!` to the option name. Close #435
2016-12-17vis: always remove consumed keys from input queueMarc André Tanner1-3/+3
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é Tanner1-1/+1
2016-12-16build: update unused make standalone/local Lua reference to 5.3.3Marc André Tanner1-2/+2
2016-12-16vis: process keys following an unmatched prefix individuallyMarc André Tanner1-1/+3
Fixes #434
2016-12-16vis: add section about compile time configuration to :help outputMarc André Tanner1-0/+15
2016-12-15build: move $CFLAGS_DEBUG into config.mkMarc André Tanner2-9/+6
This allows inclusion in other Makefiles (e.g. for C unit tests).
2016-12-15vis: always store registers values NUL terminatedMarc André Tanner1-4/+6
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é Tanner1-1/+1
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 Wainwright1-1/+1
Close #433
2016-12-14lua: make sure we always load a default themeMarc André Tanner2-1/+2
2016-12-14lua: improve error message when failing to load lpeg/lexer moduleMarc André Tanner2-9/+22
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é Tanner1-1/+1
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é Tanner1-1/+1
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é Tanner1-7/+7
Close #429
2016-12-14lua: add crontab file type and configure it to save in-placeMarc André Tanner1-0/+4
This should fix isses with `crontab -e` editing.
2016-12-14lua: allow per file type :commands being executedMarc André Tanner1-3/+11
2016-12-14lua: use Lua patterns to match file extensionsMarc André Tanner1-125/+120
2016-12-14vis: add new :set savemethod auto|atomic|inplace optionMarc André Tanner4-2/+38
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é Tanner3-11/+13
There are cases where it is useful to specify how the file should be saved.
2016-12-13build: fix Cygwin buildMarc André Tanner1-1/+2
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é Tanner1-2/+2
This fixes a warning when displaying the manual page on macOS systems.
2016-12-13build: remove internal configure options from help textMarc André Tanner1-2/+0
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é Tanner4-19/+68
2016-12-12Allow building lpeg into visMichael Forney2-0/+11
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é Tanner1-1/+0
Fixes CID 139067.
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-09man: fix mistakesMarc André Tanner1-6/+13
2016-12-09vis-lua: add comment about possibly outdated Lua API documentationMarc André Tanner2-1/+3
2016-12-09lua: add more mime types for file type detectionMarc André Tanner1-0/+21
2016-12-09vis-lua: expose input key event in insert and replace modesMarc André Tanner6-1/+53
2016-12-08vis: rename some internal C function pointersMarc André Tanner3-14/+12
2016-12-08build: include Lua files in windows zipMarc André Tanner1-1/+1
2016-12-08Update tests to changes in Lua APIMarc André Tanner1-12/+5
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-08Move manual pages to man/ subfolderMarc André Tanner5-3/+3
2016-12-08vis-lua: move mode constants from vis.MODE_* to vis.modes.*Marc André Tanner3-44/+44
2016-12-08vis-lua: add optional help parameter to mapping functionsMarc André Tanner3-12/+18
2016-12-08vis-lua: expose init event and use it to set default themeMarc André Tanner4-6/+15
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é Tanner6-24/+121
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.