summaryrefslogtreecommitdiff
path: root/vis.c
AgeCommit message (Collapse)Author
2017-01-13vis: introduce registers 0-9 and & to capture search matchesMarc André Tanner
These are currently only updated for `x` and `y` sam commands, whether they should be updated for other search related activities (`/`, `?`, `n`, `N`, `*`, `#` etc.) needs to be investigated.
2017-01-10vis: add register description to :help outputMarc André Tanner
2017-01-10vis: add valid marks to :help outputMarc André Tanner
2016-12-31vis: allow user registered :-commands to specify a help textMarc André Tanner
2016-12-29vis: cleanup key action lifetime managementMarc André Tanner
2016-12-27vis: properly free dynamic key bindingsMarc André Tanner
The handling of :unmap needs to be revisited at some point.
2016-12-22text: change datatype of Mark to uintptr_tMarc André Tanner
This should avoid undefined pointer comparisons.
2016-12-20vis: improve literal insertion via <C-v> in insert modeMarc André Tanner
2016-12-19vis: introduce vis_register_from utility functionMarc André Tanner
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-16vis: process keys following an unmatched prefix individuallyMarc André Tanner
Fixes #434
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-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-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-11-28vis: move mark description into core codeMarc André Tanner
2016-11-27vis: cleanup signal handling codeMarc André Tanner
Move all signal handling code out of "library" code into user application.
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-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-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-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-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
2016-11-15vis: overhaul and unify event generation codeMarc André Tanner
Add another layer of indirection, move actual event generation code to a dedicated function.
2016-11-15vis: generalize special stdin handlingMarc André Tanner
In preparation to move argument parsing code out of vis.c.
2016-11-11vis: attempt to use the default shell of the user to execute external commandsMarc André Tanner
We first try $SHELL and then fall back to the shell field of the password file entry (/etc/passwd).
2016-11-10vis: make vis_draw actually draw each windowMarc André Tanner
2016-11-09vis: perform undo snapshotting more rarerlyMarc André Tanner
Do not take snapshots after every operation in insert/replace mode. As an example up until now we would take a snapshot after every <Backspace>/<Delete> press, hence when undoing changes each character would be restored individually. The same applies for <C-w> and related actions. From now on we only snaphost when: - transitioning from insert/replace mode to normal mode (but not when switching to operator pending mode) - an operation takes place from normal mode - an idle time expires in normal/replace mode
2016-11-09vis: unify VIS_OP_{INSERT,REPLACE} implementationMarc André Tanner
They both perform a motion before changing mode.
2016-11-08vis: fix key parsing/skipping logicMarc André Tanner
We should only attempt to parse special keys if they are delimited by angle brackets i.e. <Key> but not Key. Previously we would wrongly skip over the latter.
2016-10-27vis: fix :langmap behaviorMarc André Tanner
The mapped to latin key has typically a shorter UTF-8 representation, thus explicitly copy the NUL terminator to properly truncate the new key value.
2016-10-27vis: apply language map only to key values not modifiersMarc André Tanner
The language map translation should not take modifiers into account. For example if `a` is mapped to `b` then `<M-a>` should also be mapped to `<M-b>`. Fix #404
2016-10-05vis: check return value of fcntl(2) callMarc André Tanner
2016-09-26vis: also apply language map to operator pending modeMarc André Tanner
2016-09-25vis: disable language map for replacement character of `r` commandMarc André Tanner
The character following the `r` command in normal mode should be treated as regular input given in insert/replace mode, that is no tranformation should be applied. Temporarily disable the language map for this reason. Close #382
2016-09-19vis: set correct reference count when splitting windowsMarc André Tanner
The refcount is already incremented in the `window_new_file` function, no need to do it again.
2016-08-24vis: improve dot (repeat) command implmentationMarc André Tanner
Do not override implicit operator macro in command mode. Fix #334
2016-08-24vis: overhaul input queue handlingMarc André Tanner
Let vis_keys_feed always have an immediate effect. Previously, if called from a key input handler the keys would just be added to the input queue and processed once the current key handler returned. This also affects the exposed Lua API.
2016-07-06vis: fix inner text object variants when cursor is on opening delimiterMarc André Tanner
Except for special cases like gn and gN vis expected that a text object would be a function mapping a position to a range as follows: f: pos -> [start, end] with start <= f(pos) <= end Clearly this condition does not hold for inner text objects when the initial position i.e. the cursor is on the opening delimiter. This also obsoletes the need for the SPLIT text object flag which should be removed in a later commit if the current behavior is found to be working as expected.
2016-06-14Update the statusline when starting or ending the recording of a macroJosh Wainwright
2016-05-28vis: try to reduce number of redrawsMarc André Tanner
This is a not yet successful attempt to reduce terminal flickering when resizing windows as is for example the case when entering command mode. UI related debug output can be enabled with: $ make CFLAGS=-DDEBUG_UI=1 $ ./vis > log
2016-05-26vis: use normalized absolute file names as internal representationMarc André Tanner
Try to display a shorthand version in the status bar, this currently only works for files below the current working directory of the editor process.
2016-05-22Add a newline at the end of the fileSilvan Jegen
This is encouraged by the ISO C99 standard.
2016-05-22Remove unneeded header importSilvan Jegen
2016-05-22vis: refactor status line handlingMarc André Tanner
Make window status bar content configurable via Lua.
2016-05-22vis: add function to change window statusbar contentMarc André Tanner
2016-05-22vis: add functions to query window sizeMarc André Tanner
2016-05-22vis: consider :set horizon setting when syntax highlightingMarc André Tanner
2016-05-22vis: move syntax highlighting to pure Lua codeMarc André Tanner