aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-12-05vis-lua: add preliminary version of LDoc based Lua API documentationMarc André Tanner2-3/+368
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é Tanner1-0/+5
Reject invalid cursor positions.
2016-12-05man: improve vis manual pageMarc André Tanner1-129/+203
2016-12-03vis: use file(1) for file type detectionMarc André Tanner1-174/+384
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é Tanner1-1/+1
This avoids warnings like: "_FORTIFY_SOURCE requires compiling with optimization".
2016-12-03vis: improve :set option number parsingMarc André Tanner3-8/+22
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é Tanner1-9/+5
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é Tanner1-0/+8
Uses mandoc(1) to generate manual pages in HTML format.
2016-12-02man: improve formatting and fix warningsMarc André Tanner1-112/+105
2016-12-02man: Make vis-{clipboard,menu,open} manpages lint-clean.Tim Allen3-44/+40
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é Tanner1-480/+808
2016-12-01Merge branch 'master' of https://github.com/josuah/vis into manMarc André Tanner1-39/+857
Conflicts: vis.1
2016-12-01vis-clipboard: fix detection of macOS systemsMarc André Tanner1-2/+6
macOS might also have $DISPLAY defined but neither of xclip nor xsel available. Keep trying different methods until we succeeded or ran out of options. Fix #417
2016-11-30man: use hard coded dates in manual pagesMarc André Tanner4-6/+6
Using the installation date might be misleading and harms reproducible builds. Omitting the dates completely might be dangerous because it seems to be a required field: The only firm requirement of the mdoc prologue is that the Dd macro comes first: many formatting systems will read up to the first macro to determine the formatting language. If Dd is not encountered first, the mdoc format may not be recognised. http://manpages.bsd.lv/mdoc.html
2016-11-30vis: avoid inconsistent state after file reloading with :eMarc André Tanner1-1/+6
When a file is opened in multiple windows we could end up in an inconsistent state by doing: $ vis some-file :spl :e At this point the two windows were referencing different file objects thus changes in one would not affect the other although they have the same path. Another option would be to reload all windows currently displaying the file being reloaded. We opt for the simpler fix for now.
2016-11-30build: try to avoid failed commit status when coverage slightly dropsMarc André Tanner1-0/+6
2016-11-30lexer: add standard mlMurray Calavera2-0/+109
2016-11-28sam: introduce `m as an address refering to mark mMarc André Tanner3-0/+21
2016-11-28vis: move mark description into core codeMarc André Tanner3-19/+17
2016-11-28vis-lua: add file.path property denoting the absolute path to the fileMarc André Tanner2-1/+7
Close #407
2016-11-27vis-lua: lua_pushtring already takes care of NULL stringMarc André Tanner1-16/+4
2016-11-27sam: stricter command parsingMarc André Tanner3-5/+22
Properly detect unbalanced curly braces and spurious output at the end of a group.
2016-11-27vis: cleanup signal handling codeMarc André Tanner4-39/+38
Move all signal handling code out of "library" code into user application.
2016-11-27vis: install SIGTERM handler to properly restore terminal when being killedMarc André Tanner1-19/+33
2016-11-27ui: remove terminal restore codeMarc André Tanner1-4/+0
This is already taken care of by libtermkey. Also we did not check whether we actually had a valid state to restore.
2016-11-26vis: redirect stdout and stderr streams to /dev/null when lacking a consumerMarc André Tanner1-7/+19
If the caller of vis_pipe is not interested in the output, redirect it to /dev/null and close the pipe. Otherwise we would wait for possible output (which might never arrive) only to throw it away. As a consequence background processes can now be started with: :> { plumber <&3 3<&- & } 3<&0 2>&- whereas before one also had to explicitly close stdout: :> { plumber <&3 3<&- & } 3<&0 1>&- 2>&-
2016-11-26vis: re-open /dev/tty read-writeableMarc André Tanner1-1/+1
libtermkey's initialization routine tries to write to the underlying file descriptor which fails with EBADF if it is opened read only. This was a problem in the terminal restore code called after a shell command is executed. It should fix the following: $ echo foo | vis - > bar :!/bin/sh exit where before vis would no longer accept any input.
2016-11-25vis: fix I/O redirection bugs, cleanup vis_pipeMarc André Tanner6-22/+23
The `:!` command did redirect stdout to a pipe which was used by `vis-menu` to return the selected entry. However, this breaks other interactive commands such as `:!/bin/sh` where command output was never displayed. Instead we modified `vis-menu` to re-open /dev/tty for its user interface which makes it work as a regular filter `:|` This patch also obsoletes the interactive flag previously passed to the vis_pipe function. Interactive mode is instead enabled by piping an invalid range.
2016-11-25vis-menu: also re-open /dev/tty as stderrMarc André Tanner1-1/+3
This means vis-menu will also work when stderr is used for other purposes. This will be used by the vis editor: - stdin is used for the initial completion candidates - stdout is used to return the selected entry - stderr is used for error reporting
2016-11-22vis: add `:set escdelay nn` optionMarc André Tanner3-0/+17
Make the delay used to distinguish between an <Escape> key and other terminal escape sequences such as for the Meta key run time configurable. The value is given in miliseconds and defaults to 50ms. Notice that terminal multiplexers like dvtm or tmux might also induce some delay which has to be configured independently.
2016-11-22ui: remove $ESCDELAY handlingMarc André Tanner1-9/+0
We are no longer using curses for input handling, hence this code is obsolete.
2016-11-22vis: populate :set option map at startupMarc André Tanner2-11/+8
2016-11-22vis-lua: also emit save events when writing to stdoutMarc André Tanner1-0/+6
The path argument will be nil.
2016-11-22vis-lua: introduce pre-save hookMarc André Tanner8-0/+32
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.
2016-11-22vis-lua: pass path as second argument to file_save_post event hookMarc André Tanner6-11/+17
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.
2016-11-21vis-lua: rename file_save event to file_save_postMarc André Tanner8-12/+12
Indicating that the event is triggered *after* a successfull write.
2016-11-21test: updateMarc André Tanner1-5/+12
2016-11-21sam: change default addresses used for commands in normal modeMarc André Tanner2-14/+18
Except for special commands like `w` and `wq` treat the cursor as an implicit one character selection to which the command is applied.
2016-11-19vis: keep track of whether "0 stores line wise dataMarc André Tanner1-1/+3
2016-11-19sam: change default address of "s" command to current lineMarc André Tanner1-1/+1
2016-11-19test: udpdateMarc André Tanner1-7/+5
2016-11-19vis: make gg and G move to first non-blank character of lineMarc André Tanner1-5/+15
2016-11-19vis: reformat motion definition block to avoid overly long linesMarc André Tanner1-67/+239
No functional changes.
2016-11-19build: install plan9port on Mac OS X buildsMarc André Tanner1-0/+6
Might be enough to get the sam based tests to run.
2016-11-19build: disable codecov comments in pull requestsMarc André Tanner1-0/+2
Avoid the additional spam for now.
2016-11-19Merge branch 'man' of https://github.com/michaelforney/visMarc André Tanner1-3/+3
2016-11-18Fix date format string in man pagesMichael Forney1-3/+3
%m is the decimal month value, not the day of the month.
2016-11-18Fix date command in man page installationMichael Forney1-3/+3
With a single $, make will try to expand it as a variable.
2016-11-18Update scheme.luaLuiz de Milon1-0/+1
The scheme syntax highlighting wasn't highlighting base functions, this fixes it.
2016-11-17Add code coverage badge to the READMEMarc André Tanner1-0/+1