aboutsummaryrefslogtreecommitdiff
path: root/view.c
AgeCommit message (Collapse)AuthorFilesLines
2017-07-14vis-lua: make selection first class primitives in Lua APIMarc André Tanner1-2/+2
2017-07-08view: keep but clear primary selection if instructed to replace allMarc André Tanner1-1/+4
Previously the last selection was kept implicitly to statisfy the invariant that at least one selection needs to exist.
2017-07-05vis: make sure all selections have same anchored stateMarc André Tanner1-1/+3
With the current model the differences between normal and visual mode is that in the latter selections are anchored (meaning one endpoint remains fixed), while in normal mode both endpoints can in principle be updated simultaneously (currently they are always colapsed to a singleton selection, giving the impression of cursors).
2017-07-04vis: implement `gv` by means of new "^ registerMarc André Tanner1-20/+0
This window local register holds the last active selections.
2017-06-27vis: properly set initial window ui optionsMarc André Tanner1-1/+1
This should keep the EOF markers visible when another option is enabled. The whole UI option handling is a bit of a mess. In the longterm more of the drawing code should be moved into Lua.
2017-06-27Merge branch 'show-eof' of https://github.com/p-e-w/visMarc André Tanner1-1/+9
Conflicts: view.c view.h
2017-06-27Merge branch 'theme-tweaks-2' of https://github.com/p-e-w/visMarc André Tanner1-1/+1
Conflicts: view.c
2017-06-15view: make sure primary selection is visibleMarc André Tanner1-0/+3
2017-06-15view: add functions to save/restore arbitrary rangesMarc André Tanner1-0/+23
2017-06-15view: add functions to get/set all selectionsMarc André Tanner1-5/+34
2017-06-15view: disallow setting of invalid selectionsMarc André Tanner1-5/+9
2017-06-15view: fix view_selections_setMarc André Tanner1-8/+2
The anchor needs to be set after the cursor was positioned, otherwise the cursor placement will immediately destroy the selection for in the non-anchored case.
2017-06-15view: do not automatically anchor selections when setting rangeMarc André Tanner1-1/+0
2017-06-15view: introduce view_selections_normalizeMarc André Tanner1-0/+22
Dispose all invalid and merge all overlapping selections.
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner1-296/+293
2017-06-15view: rename view_cursors_columnMarc André Tanner1-1/+1
2017-06-15view: rename view_cursorsMarc André Tanner1-1/+1
2017-06-15view: rename view_selection_anchoredMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_column{,count,next}Marc André Tanner1-2/+2
2017-06-15view: rename view_cursors_numberMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_countMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_nextMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_prevMarc André Tanner1-1/+1
2017-06-15view: view_cursors_selection_restoreMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_saveMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_startMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_swapMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_clearMarc André Tanner1-3/+3
2017-06-15view: rename view_selections_clearMarc André Tanner1-2/+2
2017-06-15view: rename view_cursors_selection_getMarc André Tanner1-3/+3
2017-06-15view: rename view_cursors_primary_{get,set}Marc André Tanner1-3/+3
2017-06-15view: rename view_cursors_clearMarc André Tanner1-1/+1
2017-06-15view: rename view_cursor_disposedMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_disposeMarc André Tanner1-4/+4
2017-06-15view: rename view_cursors_newMarc André Tanner1-3/+3
2017-06-15view: remove view_cursors_multipleMarc André Tanner1-4/+0
2017-06-15view: clean up and add documentationMarc André Tanner1-2/+10
2017-06-15vis: promote selections to first class primitivesMarc André Tanner1-145/+51
This unifies cursors and selections. The cursor are now represendted as singleton selections.
2017-06-10More theme improvementsPhilipp Emanuel Weidmann1-1/+1
2017-06-04Add option to hide EOF markerPhilipp Emanuel Weidmann1-2/+10
2017-04-19vis: restructure register handlingMarc André Tanner1-6/+0
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-09vis: remove handling of \r\n line endingsMarc André Tanner1-9/+0
Use something like dos2unix(1) and unix2dos(1), if you need to edit such files.
2017-03-22view: rename view_dirty to view_invalidateMarc André Tanner1-1/+1
2017-03-19view: use correct default cell styleMarc André Tanner1-4/+3
2017-03-16view: mark view as dirty even when resizing to same sizeMarc André Tanner1-1/+3
This makes sure that a successive view_update call returns true and as a result the status bar will be correctly redrawn.
2017-03-14Restructure display codeMarc André Tanner1-106/+41
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-02-28view: fix display when inserting text at start of fileMarc André Tanner1-2/+9
Before cebb24b36ac45cc7c6912481cacd29ef9d5c68b9 a mark at the start of the file was treated specially to always return position zero. Since this was no longer the case the following would insert text before the visible area: <PageDown><PageUp><PageUp>ifoo
2017-02-27view: reposition cursor after restoring selectionMarc André Tanner1-0/+1
This should fix selection changes after shift operators in visual mode. The problem was that the NOP motion which is executed when switching back into visual-line mode destroys the selection if the cursor is not already placed on a selection boundary. Fix #501
2017-02-23view: make sure viewport remains valid when scrolling upMarc André Tanner1-1/+1
In a file with windows style \r\n line endings scrolling up would wrap around to the end of the file.
2017-02-12view: improve handling of long sequences of combining charactersMarc André Tanner1-1/+3
They will still not be displayed correctly, but at least they should no longer cause memory errors.