summaryrefslogtreecommitdiff
path: root/view.c
AgeCommit message (Collapse)Author
2018-05-16vis: make sure zb redraws line at the bottom if possibleMarc André Tanner
Previously it would do nothing if the cursor was already on the last display line. Fix #697
2018-03-12view: use strncat instead of an inline loop to concatenate cell dataMarc André Tanner
2018-03-12view: fix buffer overflow when dealing with combining charactersMarc André Tanner
The `cell.len` attribute refers to the number of bytes of the underlying text which are represented by this cell. The actual NUL terminated data being displayed can have a completely unrelated length. For example a NUL byte has a `cell.len` of 1, but is displayed as `cell.data = "^@"`. Because we currently have a fixed cell capacity of 16 bytes (including the terminating NUL byte) long sequences of combining characters won't be displayed correctly. See also #679
2018-03-11view: properly advance over incomplete unicode sequenceMarc André Tanner
When fetching more text we have to skip the bytes processed by the previous cell, otherwise we end up in an infinite loop.
2018-03-11Reset parsing state after mbrtowc(3) failureMarc André Tanner
The standard says "if an encoding error occurs ... the conversion state is unspecified".
2017-07-14vis-lua: make selection first class primitives in Lua APIMarc André Tanner
2017-07-08view: keep but clear primary selection if instructed to replace allMarc André Tanner
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é Tanner
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é Tanner
This window local register holds the last active selections.
2017-06-27vis: properly set initial window ui optionsMarc André Tanner
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é Tanner
Conflicts: view.c view.h
2017-06-27Merge branch 'theme-tweaks-2' of https://github.com/p-e-w/visMarc André Tanner
Conflicts: view.c
2017-06-15view: make sure primary selection is visibleMarc André Tanner
2017-06-15view: add functions to save/restore arbitrary rangesMarc André Tanner
2017-06-15view: add functions to get/set all selectionsMarc André Tanner
2017-06-15view: disallow setting of invalid selectionsMarc André Tanner
2017-06-15view: fix view_selections_setMarc André Tanner
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é Tanner
2017-06-15view: introduce view_selections_normalizeMarc André Tanner
Dispose all invalid and merge all overlapping selections.
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner
2017-06-15view: rename view_cursors_columnMarc André Tanner
2017-06-15view: rename view_cursorsMarc André Tanner
2017-06-15view: rename view_selection_anchoredMarc André Tanner
2017-06-15view: rename view_cursors_column{,count,next}Marc André Tanner
2017-06-15view: rename view_cursors_numberMarc André Tanner
2017-06-15view: rename view_cursors_countMarc André Tanner
2017-06-15view: rename view_cursors_nextMarc André Tanner
2017-06-15view: rename view_cursors_prevMarc André Tanner
2017-06-15view: view_cursors_selection_restoreMarc André Tanner
2017-06-15view: rename view_cursors_selection_saveMarc André Tanner
2017-06-15view: rename view_cursors_selection_startMarc André Tanner
2017-06-15view: rename view_cursors_selection_swapMarc André Tanner
2017-06-15view: rename view_cursors_selection_clearMarc André Tanner
2017-06-15view: rename view_selections_clearMarc André Tanner
2017-06-15view: rename view_cursors_selection_getMarc André Tanner
2017-06-15view: rename view_cursors_primary_{get,set}Marc André Tanner
2017-06-15view: rename view_cursors_clearMarc André Tanner
2017-06-15view: rename view_cursor_disposedMarc André Tanner
2017-06-15view: rename view_cursors_disposeMarc André Tanner
2017-06-15view: rename view_cursors_newMarc André Tanner
2017-06-15view: remove view_cursors_multipleMarc André Tanner
2017-06-15view: clean up and add documentationMarc André Tanner
2017-06-15vis: promote selections to first class primitivesMarc André Tanner
This unifies cursors and selections. The cursor are now represendted as singleton selections.
2017-06-10More theme improvementsPhilipp Emanuel Weidmann
2017-06-04Add option to hide EOF markerPhilipp Emanuel Weidmann
2017-04-19vis: restructure register handlingMarc André Tanner
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é Tanner
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é Tanner
2017-03-19view: use correct default cell styleMarc André Tanner
2017-03-16view: mark view as dirty even when resizing to same sizeMarc André Tanner
This makes sure that a successive view_update call returns true and as a result the status bar will be correctly redrawn.