aboutsummaryrefslogtreecommitdiff
path: root/vis.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner1-45/+45
2017-06-15view: rename view_cursorsMarc André Tanner1-7/+7
2017-06-15view: rename view_cursors_numberMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_countMarc André Tanner1-3/+3
2017-06-15view: rename view_cursors_nextMarc André Tanner1-7/+7
2017-06-15view: rename view_cursors_prevMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_saveMarc André Tanner1-2/+2
2017-06-15view: rename view_cursors_selection_getMarc André Tanner1-6/+6
2017-06-15view: rename view_cursors_primary_{get,set}Marc André Tanner1-2/+2
2017-06-15view: rename view_cursors_disposeMarc André Tanner1-2/+2
2017-06-15view: remove view_cursors_multipleMarc André Tanner1-3/+3
2017-06-15vis: promote selections to first class primitivesMarc André Tanner1-25/+8
This unifies cursors and selections. The cursor are now represendted as singleton selections.
2017-06-15vis: strip double leading slashes of pathsMarc André Tanner1-1/+3
This fixes the internal representation as well as the path displayed in the status bar. Previously opening a file in the root directory e.g. /foo would be display as //foo.
2017-05-31vis: fix compiler warning concerning write(2) return valueMarc André Tanner1-1/+1
2017-05-19vis: improve `:<` command implementationMarc André Tanner1-3/+13
When we have nothing to write to an external process, redirect stdin to /dev/null instead of using a pipe which is immediately closed. Some commands change their behavior when used in a shell pipeline. As an example the following did not work as expected: :< ag pattern Fix #556
2017-05-17vis: ensure complete ! command output is displayedMarc André Tanner1-3/+11
For interactive processes started using `:!` stdout is redirected to stderr normally used by vis to draw its user interface. For some reason the first byte written by the interactive application is not being displayed. I suspect it has something to do with the terminal state change. For now we are writing a dummy space (which is never shown) ourself to ensure that the complete output is visible. Fix #545
2017-05-12vis: immediately update screen after a vis_redraw callMarc André Tanner1-0/+1
By default we only update the screen once per main loop iteration. This might change in the future, but for now we force an update when a redraw is explicitly requested.
2017-05-06vis: add vis_interrupt{,requested} functionsMarc André Tanner1-0/+8
2017-05-06vis: add doxygen commentsMarc André Tanner1-2/+7
Rename some structures, add typedefs for function pointers, remove unused arguments from vis_run.
2017-05-04vis: improve job control for forked processMarc André Tanner1-2/+27
We need to unblock SIGTERM for the child process. Also we should deliver signals to the correct process group. This is still fragile and will need to be rewritten when we finally introduce a global event loop.
2017-05-03vis: introduce count iterator to handle interrupted flagMarc André Tanner1-0/+22
2017-05-03text: rename text_sigbus to text_mmapedMarc André Tanner1-1/+1
Add casts to uintptr_t to avoid unrelated pointer comparisons.
2017-04-24vis: fix newline insertion at end of fileMarc André Tanner1-1/+1
With enabled auto indentation and tab expansion in an empty buffer, the following would insert one newline too many: i<Tab><Enter>
2017-04-23vis: fix # register countMarc André Tanner1-1/+1
Previously the # register was always reported as containing only one entry. This wrongly caused the first value to be put at all locations. Fix #544
2017-04-20vis: add # register to insert cursor numberMarc André Tanner1-0/+1
2017-04-20vis: start cleaning up register related codeMarc André Tanner1-57/+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-7/+24
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-04-18vis: rename vis_register_set to vis_registerMarc André Tanner1-1/+1
2017-04-14vis: make certain operations interruptible with <C-c>Marc André Tanner1-3/+11
As currently implemented this will only work for operations which are individually fast, but repeated many times (e.g. `1000000itext<Escape>`).
2017-04-09vis: remove handling of \r\n line endingsMarc André Tanner1-7/+6
Use something like dos2unix(1) and unix2dos(1), if you need to edit such files.
2017-04-04vis: remove unused struct memberMarc André Tanner1-1/+0
2017-04-04vis: automatically dispose invalid cursorsMarc André Tanner1-0/+7
2017-03-31vis: rename search related constantsMarc André Tanner1-1/+1
2017-03-24vis: properly redraw status bar of windows displaying internal filesMarc André Tanner1-1/+1
Currently the only "internal window" with a status bar is the information window used to display Lua stack traces. We do not want to trigger events for it, because that could result in further Lua errors. Nonetheless its status bar should be properly redrawn to avoid display artifacts. That is why we fall back to the built-in default status bar as used by non-Lua builds.
2017-03-22vis: fix syntax highlighting glitches with split windowsMarc André Tanner1-17/+14
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-19vis: add infrastructure for user specified operatorsMarc André Tanner1-0/+3
2017-03-19Move :set horizon option implementaiton to luaMarc André Tanner1-2/+1
2017-03-19Move :set syntax option implementation to luaMarc André Tanner1-18/+0
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é Tanner1-0/+4
2017-03-17vis: fix selection background colorMarc André Tanner1-1/+1
2017-03-16ui: further cleanup display codeMarc André Tanner1-2/+1
2017-03-16vis: remove special case when invalidating windowsMarc André Tanner1-2/+1
There is no need to treat the currently focused window specially.
2017-03-14Restructure display codeMarc André Tanner1-10/+177
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-05vis: add file argument to vis_pipe_collectMarc André Tanner1-2/+2
2017-03-03vis-lua: add vis:exit functionMarc André Tanner1-0/+3
2017-02-25vis: tweak handling of end inclusivenessMarc André Tanner1-2/+3
Only extend end of range when the motion did so too. As an example this prevents motions like `$dg_` from deleting the newline which was the starting position.
2017-02-25vis: add vis- prefix to pseudo editor keysMarc André Tanner1-3/+3
2017-02-24vis: remove unused struct memberMarc André Tanner1-4/+3
The macro replay code has since been refactored, making this obsolete. There is only ever one input queue from which keys are interpreted.
2017-02-24vis: make help texts optional to produce a smaller binaryMarc André Tanner1-20/+20
$ ./configure --disable-help shrinks the binary by about 20K on a x86_64 system.
2017-02-24vis: fix display after newline insertion at the start of viewportMarc André Tanner1-2/+8
Previously the window content would not be scrolled down when inserting a newline exactly at the start of the display area as in the case when a file starts with an empty line and the following is performed: <PageDown><PageUp><PageUp>o