aboutsummaryrefslogtreecommitdiff
path: root/vis.c
AgeCommit message (Collapse)AuthorFilesLines
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
2017-02-22vis: add exact count motion flagMarc André Tanner1-1/+9
Some motions should fail (i.e. keep the initial position) when the specified count can not be satisfied exactly. Examples include t, f, T, and F. Fix #497
2017-02-10vis: introduce vis_keys_utf8Marc André Tanner1-0/+9
2017-02-07vis: improve text object handlingMarc André Tanner1-3/+12
Fix `gN` and delimited inner variants when given a count.
2017-02-07vis: reformat text object definitionsMarc André Tanner1-1/+1
2017-02-05vis: set $vis_file{name,path} environment variables for external commandsMarc André Tanner1-0/+6
2017-02-05vis: add file argument to vis_pipeMarc André Tanner1-3/+4
2017-02-02Slight code cleanups, use buffer API where appropriateMarc André Tanner1-3/+7
2017-02-01vis: refactor autoindent handlingMarc André Tanner1-37/+44
Rather than inserting a newline and then looking for leading white space of the previous line we now gather the white space before newline insertion. Also we no longer indent empty lines. Close #472
2017-01-31vis: improve cursor positioning after operators in visual modeMarc André Tanner1-0/+4
Make sure the selection setting code (used to restore selections) does not move the cursor. Fix #479
2017-01-31vis: add workaround for broken color handling in Terminal.appMarc André Tanner1-0/+1
Terminal.app sets $TERM=xterm-256color and ships a corresponding terminfo description advocating that it is capable of color changes to the 256 color palette when in fact it can not. We introduce a new boolean option "change-256colors" which is true by default but can be used to disable color changes. It is automatically set if Terminal.app is detected using $TERM_PROGRAM. This should fix display artifacts as described in #456.
2017-01-28vis: keep track of most recently processed keys of input queueMarc André Tanner1-0/+8
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é Tanner1-8/+8
2017-01-20vis: improve new line handling at end of fileMarc André Tanner1-2/+18
<Enter> at the end of the file now inserts two newlines, unless there is already one in place. This ensures that in 'normal' operation the file is always new line terminated (as mandated by POSIX). It also means that there is no problem displaying the right amount of ~ symbols at the end of the file. Unlike in vim the cell beyond the end of the file remains adressable even in normal mode. This means something like the following (starting from an empty file) might be a little confusing: o<Escape><Left>dd Because the starting position is beyond the last newline of the file, nothing will be deleted. For now we prefer to avoid the additional complexity, and difference in behavior between normal and insert mode, needed to fix this slight inconsistency. Fix #294
2017-01-19vis: simplify count handling for insertionMarc André Tanner1-1/+1
2017-01-18vis: fix count handling for appendMarc André Tanner1-8/+10
Fix #371
2017-01-18vis: support count for insertion and replacementMarc André Tanner1-1/+1
Fix #372
2017-01-18vis: support count for macro replayMarc André Tanner1-1/+4
Fix #448
2017-01-18vis: do not take undo snaphots while replaying a macroMarc André Tanner1-5/+22
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-16vis: change key input handling modelMarc André Tanner1-17/+28
Previously if you had a mapping for both `a` and `ab` the latter would in effect be unreachable because the greedy search would always match and then execute the former. With the new behavior we keep reading keys until we have a non ambigious sequence. That is after pressing `a` nothing will happen, if the next key is a `b` we will execute the `ab` mapping otherwise we will perform `a` and whatever the action is for the next key. Close #386
2017-01-16vis: cleanup regex header inclusionMarc André Tanner1-1/+0
2017-01-13vis: introduce registers 0-9 and & to capture search matchesMarc André Tanner1-0/+10
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é Tanner1-15/+24
2017-01-10vis: add valid marks to :help outputMarc André Tanner1-4/+9
2016-12-31vis: allow user registered :-commands to specify a help textMarc André Tanner1-1/+5
2016-12-29vis: cleanup key action lifetime managementMarc André Tanner1-0/+4
2016-12-27vis: properly free dynamic key bindingsMarc André Tanner1-0/+4
The handling of :unmap needs to be revisited at some point.
2016-12-22text: change datatype of Mark to uintptr_tMarc André Tanner1-1/+1
This should avoid undefined pointer comparisons.
2016-12-20vis: improve literal insertion via <C-v> in insert modeMarc André Tanner1-0/+42
2016-12-19vis: introduce vis_register_from utility functionMarc André Tanner1-0/+19