aboutsummaryrefslogtreecommitdiff
path: root/register.c
AgeCommit message (Collapse)AuthorFilesLines
2017-04-20vis: start cleaning up register related codeMarc André Tanner1-178/+0
Now that register.h is no longer used by view.h we can move the struct and function declarations to vis-core.h.
2017-04-19vis: restructure register handlingMarc André Tanner1-32/+106
Decouple register content from cursors. Previously each cursor had exactly one corresponding register. Now each register can save a list of values whose lifetime is not tied to the cursor. If multiple cursors exist and a put with a register holding only a single value is performed, then this value is inserted at every cursor location. If there are fewer values available than cursors, then only the matching ones will be used. If a register holding multiple values is inserted in a single cursor context, only the first value will be used. Another option would be to join all existing values. The details of this behavior might be changed in the future. <C-r> in insert mode has not yet been adapted and register handling in general needs to be cleaned up further. Fix #527
2017-02-20buffer: add buffer_growMarc André Tanner1-2/+2
2017-02-20buffer: rename buffer_grow to buffer_reserveMarc André Tanner1-2/+2
2017-02-05vis: add file argument to vis_pipeMarc André Tanner1-3/+5
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-11-25vis: fix I/O redirection bugs, cleanup vis_pipeMarc André Tanner1-2/+2
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-05-18vis: add #define for VIS_MENUMarc André Tanner1-4/+0
2016-05-18vis: add an interactive mode to vis_pipe{,_collect}(...)Marc André Tanner1-2/+2
Previously the interactive mode was implicitly enabled by passing an invalid range. However for some use cases (e.g. completion) we need to be able to pipe a given text range to an external process without also redirecting stderr (which is used to draw the slmenu interface on top of vis).
2016-04-14vis: add #defines to ease overriding of utility namesMarc André Tanner1-2/+6
This should ease packaging for systems with an existing vis(1) binary.
2016-04-03vis: change vis_pipe API and cleanup related codeMarc André Tanner1-33/+13
2016-04-01vis: cleanup vis_pipe APIMarc André Tanner1-2/+2
2016-03-23vis: use vis-clipboard instead of vis-{copy,paste} scriptsMarc André Tanner1-2/+2
2016-03-15vis: slightly cleanup register related codeMarc André Tanner1-0/+4
2016-03-12register: add function to set register content to arbitrary dataMarc André Tanner1-0/+4
2016-03-12register: make sure returned register content is always NUL terminatedMarc André Tanner1-1/+4
2016-03-12register: rename register put related functionsMarc André Tanner1-3/+3
2016-02-25vis: ignore trailing NUL byte of register content by defaultMarc André Tanner1-1/+1
This is handy when editing registers used for macros.
2016-01-30Implement "A - "Z registersMarc André Tanner1-0/+2
2016-01-30Implement system clipboard registers "* and "+Marc André Tanner1-4/+56
Both registers are currently treated identically. The actual system integration is performed by two shell scripts vis-copy and vis-paste.
2016-01-30Implement blackhole register "_Marc André Tanner1-10/+33
2016-01-30Cleanup register implementationMarc André Tanner1-8/+12
2015-05-16Cleanup general purpose buffer APIMarc André Tanner1-4/+4
Introduce buffer_init to initialize a stack allocated buffer. Rename buffer_{alloc,free} functions because they do something different than the usual convention. They operate on the underlying buffer data but do not allocate/free an actual Buffer struct.
2014-12-18Macro supportMarc André Tanner1-25/+5
At some point this should be optimized further at the moment there is some 20 byte overhead for each entered key.
2014-09-10Add comments where appropriateMarc André Tanner1-9/+1
2014-09-03Rudimentary support for copy / paste via registersMarc André Tanner1-6/+0
2014-08-31Add rudimentary register implementationMarc André Tanner1-0/+62