summaryrefslogtreecommitdiff
path: root/vis.h
AgeCommit message (Collapse)Author
2017-04-20vis: start cleaning up register related codeMarc André Tanner
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-18vis: rename vis_register_set to vis_registerMarc André Tanner
2017-04-09vis: remove handling of \r\n line endingsMarc André Tanner
Use something like dos2unix(1) and unix2dos(1), if you need to edit such files.
2017-04-04vis: add motions to move by codepointsMarc André Tanner
Some people might prefer this for <Backspace> behavior. Except for that and debugging purposes using `ga` and `g8` it is not yet that useful.
2017-03-31vis: add non-default actions for vi compatible n/N motionsMarc André Tanner
The following key mappings should result in the vi behavior: :map! normal n <vis-motion-search-repeat> :map! normal N <vis-motion-search-repeat-reverse> The default remains unchanged, that is `n` (`N`) always searches towards the end (start) of the file. Fix #470
2017-03-31vis: rename search related constantsMarc André Tanner
2017-03-22vis: fix syntax highlighting glitches with split windowsMarc André Tanner
When a file was being displayed in multiple windows and changes were performed to the one showing the preceding file region, the syntax highlighting of the window showing the later parts would get messed up.
2017-03-21vis: make `cw` and `cW` more vim compatibleMarc André Tanner
If the starting position is: * on a space or tab use the `w` motion * on the last letter of a word use `l` or `e` depending on whether a count was given. This also applies for single letter words. * otherwise use the `e` motion As in vim `cw` and `dw` behave differently, whether that is desirable remains to be seen. Might fix #521
2017-03-19vis: add infrastructure for user specified operatorsMarc André Tanner
2017-03-19Move :set horizon option implementaiton to luaMarc André Tanner
2017-03-19Move :set theme option implementation to luaMarc André Tanner
2017-03-19Move :set syntax option implementation to luaMarc André Tanner
It is no longer possible to change the used syntax by assigning to the `win.syntax = name` field, instead the function win:set_syntax(name)` should be called. The distinction between filetype and syntax lexer to use should probably be clarified/cleaned up at some point.
2017-03-19vis: add infrastructure to dynamically add :set optionsMarc André Tanner
2017-03-14Restructure display codeMarc André Tanner
Use pull instead of push based model for display code. Previously view.c was calling into the ui frontend code, with the new scheme this switches around: the necessary data is fetched by the ui as necessary. The UI independent display code is moved out of view.c/ui-curses.c into vis.c. The cell styles are now directly embedded into the Cell struct. New UI styles are introduced for: - status bar (focused / non-focused) - info message - window separator - EOF symbol You will have to update your color themes. The terminal output code is further abstracted into a generic ui-terminal.c part which keeps track of the whole in-memory cell matrix and #includes ui-terminal-curses.c for the actual terminal output. This architecture currently assumes that there are no overlapping windows. It will also allow non-curses based terminal user interfaces.
2017-03-07vis: remove now unused #defineMarc André Tanner
2017-03-05vis: add file argument to vis_pipe_collectMarc André Tanner
2017-02-24vis: make help texts optional to produce a smaller binaryMarc André Tanner
$ ./configure --disable-help shrinks the binary by about 20K on a x86_64 system.
2017-02-10vis: introduce vis_keys_utf8Marc André Tanner
2017-02-05vis: add file argument to vis_pipeMarc André Tanner
2017-01-28vis: keep track of most recently processed keys of input queueMarc André Tanner
Currently the key handling functions do not know through which mapping they were invoked. As an example the `count` handler exploits the implementation detail that the input queue is stored in contiguous memory, meaning `keys[-1]` gives access to the digit being pressed. This adds infrastructure to keep track of the two most recently processed keys of the input queue. The information is guaranteed to be accurate for the initial invocation of the key handler but will be overwritten in case new keys are pushed to the input queue (e.g. through vis_keys_feed).
2017-01-20vis: slightly cleanup repeat code, always set dot registerMarc André Tanner
2017-01-18vis: do not take undo snaphots while replaying a macroMarc André Tanner
The vis_keys_feed function is currently unaffected by this change. It still creates individual undo points. While this is probably undesirable from an API point of view, it keeps the lua based tests that use undo points working.
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
2017-01-06vis: simplify mode lookup for :map and :unmapMarc André Tanner
2016-12-31vis: allow user registered :-commands to specify a help textMarc André Tanner
2016-12-31vis: typedef function type not pointer to functionMarc 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-23Apply format string attribute to printf style functionsMarc André Tanner
Not strictly C99 conform, but widely supported and easy enough to NOP for compilers which do not support it. Besides it was already used to mark certain functions as noreturn.
2016-12-21vis: implement `gh` and `gl` to move by relative byte offsetsMarc André Tanner
2016-12-21vis: implement `go` to move to absolute byte positionMarc André Tanner
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-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-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-11-28vis: move mark description into core codeMarc André Tanner
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-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-15vis: generalize special stdin handlingMarc André Tanner
In preparation to move argument parsing code out of vis.c.
2016-11-09vis: add replace operator VIS_OP_REPLACEMarc André Tanner
Delete the given range and insert the same number of replacement characters.
2016-11-09vis: unify VIS_OP_{INSERT,REPLACE} implementationMarc André Tanner
They both perform a motion before changing mode.
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-25vis: move file name and word completion logic to a shell scriptMarc André Tanner
The shell script should be reviewed for quoting issues, currently it allows command injections as in: $ vis-complete "'; rm -f some-file; echo " However it is intended for interactive usage and from within vis it is only ever called with a valid completion prefix. The file name completion logic now supports nested directories. Close #347
2016-08-24vis: implement gJ like behaviorMarc André Tanner
The behavior is not exactly the same because vim preserves any existing white spaces wihle we remove existing ones but do not insert additional ones. The vim behavior (essentially only deleating new lines) can be achived using something like: :x/\n/d Close #374