summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-11-30build: try to avoid failed commit status when coverage slightly dropsMarc André Tanner
2016-11-30lexer: add standard mlMurray Calavera
2016-11-28sam: introduce `m as an address refering to mark mMarc André Tanner
2016-11-28vis: move mark description into core codeMarc André Tanner
2016-11-28vis-lua: add file.path property denoting the absolute path to the fileMarc André Tanner
Close #407
2016-11-27vis-lua: lua_pushtring already takes care of NULL stringMarc André Tanner
2016-11-27sam: stricter command parsingMarc André Tanner
Properly detect unbalanced curly braces and spurious output at the end of a group.
2016-11-27vis: cleanup signal handling codeMarc André Tanner
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é Tanner
2016-11-27ui: remove terminal restore codeMarc André Tanner
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é Tanner
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é Tanner
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é Tanner
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é Tanner
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é Tanner
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é Tanner
We are no longer using curses for input handling, hence this code is obsolete.
2016-11-22vis: populate :set option map at startupMarc André Tanner
2016-11-22vis-lua: also emit save events when writing to stdoutMarc André Tanner
The path argument will be nil.
2016-11-22vis-lua: introduce pre-save hookMarc André Tanner
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é Tanner
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é Tanner
Indicating that the event is triggered *after* a successfull write.
2016-11-21test: updateMarc André Tanner
2016-11-21sam: change default addresses used for commands in normal modeMarc André Tanner
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é Tanner
2016-11-19sam: change default address of "s" command to current lineMarc André Tanner
2016-11-19test: udpdateMarc André Tanner
2016-11-19vis: make gg and G move to first non-blank character of lineMarc André Tanner
2016-11-19vis: reformat motion definition block to avoid overly long linesMarc André Tanner
No functional changes.
2016-11-19build: install plan9port on Mac OS X buildsMarc André Tanner
Might be enough to get the sam based tests to run.
2016-11-19build: disable codecov comments in pull requestsMarc André Tanner
Avoid the additional spam for now.
2016-11-19Merge branch 'man' of https://github.com/michaelforney/visMarc André Tanner
2016-11-18Fix date format string in man pagesMichael Forney
%m is the decimal month value, not the day of the month.
2016-11-18Fix date command in man page installationMichael Forney
With a single $, make will try to expand it as a variable.
2016-11-18Update scheme.luaLuiz de Milon
The scheme syntax highlighting wasn't highlighting base functions, this fixes it.
2016-11-17Add code coverage badge to the READMEMarc André Tanner
2016-11-17test: updateMarc André Tanner
2016-11-17build: cache external source tarballs on Travis CIMarc André Tanner
2016-11-17build: add automated code coverage via Travis CI and codecov.ioMarc André Tanner
2016-11-17bulid: run individual tests directly from .travis.ymlMarc André Tanner
2016-11-16ui: work around libtermkey bug when stdin is /dev/nullMarc André Tanner
Libtermkey tries to write a terminal initialization sequence even when stdin is not a terminal as is the case when running `vis < /dev/null` or within the Travis CI environment. The broken code is in libtermkey's driver-ti.c function `start_driver`: /* There's no point trying to write() to a pipe */ if(fstat(tk->fd, &statbuf) == -1) return 0; if(S_ISFIFO(statbuf.st_mode)) return 1; Instead they should simply be using isatty(3). As a workaround we catch the resulting EBADF failure and try to re-open /dev/tty as stdin. If this fails too (as is the case in the Mac OS X Travis CI runner) create an abstract termkey instance instead. In this state vis will not be able to consume any input and will instead spin with 100% CPU usage in the mainloop. This is solely done to make the Lua tests, which control vis through other means, work within the Travis CI environment.
2016-11-16build: add automated Mac OS X builds via Travis CIMarc André Tanner
2016-11-16vis: treat vis_keys_feed input like a macro replayMarc André Tanner
We need to push keys individually to the input queue such that the state machine can advance and record keys into the operator macro if necessary. Previously feeding the following input: isome text<Escape>. would not work as expected because the complete key stream was pushed to the input queue at the same time during which the operator macro was not yet active. Thus the dot command at the end would have nothing to repeat.
2016-11-16sam: use default shell command for <, >, | and ! when applicapleMarc André Tanner
If the shell command is omitted, the last shell command (of any type) is substituted. The most recently used shell command is stored in a new register currently named `!`.
2016-11-16sam: support an empty regex as an alias for the most recently used oneMarc André Tanner
As in sam if an empty regex // is provided we substitute in the most recently used one. 0/regexp/// Will match the second occurrence in the fie.
2016-11-15test: updateMarc André Tanner
2016-11-15sam: make `:w` and `:wq` honor their given rangeMarc André Tanner
As in visual mode write commands have to be forced with ! if the changes are destructive i.e. only parts of the file are written.
2016-11-15sam: `e`, `q`, `X`, `Y`, `!` and all vi commands should not take addressesMarc André Tanner
2016-11-15sam: reformat command definition block to avoid overly long namesMarc André Tanner
No functional changes.
2016-11-15Fix documentation regarding Lua paths in README and manual pageMarc André Tanner
Wether `/usr/local/share/vis` or `/usr/share/vis` is used depends on how the configure script was invoked. However, both are never used at the same time. This section should be completely reworked at some point.
2016-11-15vis: defer UI initialization and overhaul argument parsingMarc André Tanner
Do not initalize curses UI before it is actually needed. Move vis command line argument parsing logic into main.c. This fixes `vis -v` output and exit status. Fix #351