summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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.
2016-12-07lua: move non-core code out of vis.luaMarc André Tanner
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
2016-12-07Cleanup .gitignore and ignore HTML and CSS filesMarc André Tanner
Close #424
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-06Reorganize READMEMarc André Tanner
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.
2016-12-06vis-lua: more extensive Lua API documentationMarc André Tanner
2016-12-05vis-lua: add preliminary version of LDoc based Lua API documentationMarc André Tanner
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.
2016-12-05view: make cursor placement more robustMarc André Tanner
Reject invalid cursor positions.
2016-12-05man: improve vis manual pageMarc André Tanner
2016-12-03vis: use file(1) for file type detectionMarc André Tanner
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.
2016-12-03build: do not define _FORTIFY_SOURCE for debug buildsMarc André Tanner
This avoids warnings like: "_FORTIFY_SOURCE requires compiling with optimization".
2016-12-03vis: improve :set option number parsingMarc André Tanner
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
2016-12-02build: simplify manual page installationMarc André Tanner
The version substitution does not seem to work with BSD make because ${VERSION} is expanded to an empty string.
2016-12-02build: add new `make man` targetMarc André Tanner
Uses mandoc(1) to generate manual pages in HTML format.
2016-12-02man: improve formatting and fix warningsMarc André Tanner
2016-12-02man: Make vis-{clipboard,menu,open} manpages lint-clean.Tim Allen
They now pass `mandoc -Tlint` (the BSD manpage renderer) and `man --warnings=w` (the GNU one).
2016-12-01man: first steps towards a proper manual pageMarc André Tanner
2016-12-01Merge branch 'master' of https://github.com/josuah/vis into manMarc André Tanner
Conflicts: vis.1