summaryrefslogtreecommitdiff
path: root/view.c
AgeCommit message (Collapse)Author
2016-05-22ui: s/UiStyles/UiStyle/gMarc André Tanner
2016-05-05view: try to recover from invalid cursor positionsMarc André Tanner
A cursor is a mark, if the text containing the mark is removed the cursor is lost. In this case we try to fall back to the previously known cursor position/mark. This should improve undo operations for filter commands.
2016-05-04view: simplify line up/down motionsMarc André Tanner
As a consequence the general cursor placement code takes effect and always places the cursor in the middle of the window when moving out of the viewable range. Whether this behavior is desirable remains to be seen.
2016-05-04vis: clean up cursor column displayMarc André Tanner
2016-04-29view: try to improve cursor placementMarc André Tanner
This changes which viewport is being displayed after the primary cursor moves out of the currently viewable area. Close #164, #274, #278
2016-04-29view: improve view sliding downMarc André Tanner
Close #216
2016-04-27view: change view_cursors_place to take 1 based column numberMarc André Tanner
This should fix inconsistency in the Lua API.
2016-04-19vis: add :set horizon optionDavid B. Lamkins
Can be used to specify the number of bytes before the visible area to consider for syntax highlighting. Defaults to 32K for now, whereas before it was 16K.
2016-04-15view: add view_cursors_place(cursor, line, col) functionMarc André Tanner
2016-04-15view: add view_cursors_col functionMarc André Tanner
2016-04-15view: add view_cursors_line functionMarc André Tanner
2016-04-13view: add view_cursors_new_force functionMarc André Tanner
To create a cursor even if there already exists one at the same position. Should only be used if all but one of the cursors will later be removed.
2016-04-08vis: indicate primary cursor number in status barMarc André Tanner
If there exist multiple cursors, [n/m] is added to the status bar. Meaning the n-th cursor out of the existing m cursors is currently the primary one.
2016-04-03view: make syntax coloring more robustMarc André Tanner
Do not crash if for some reason view->{start,end} have outdated values.
2016-04-03view: add return value to view_cursors_disposeMarc André Tanner
indicating whether cursor could be removed
2016-03-30view: constify functions to manipulate selectionsMarc André Tanner
2016-03-30view: change internal representation of selectionsMarc André Tanner
We place the end mark inside the selection as opposted to on the character immediately following it. This is better when selections are touching each other. Previously for two seletions [a][b] the end mark for selection a would be at the same location as the start mark of selection b. Thus when for example the content of selection b is deleted it would also destroy selection a, because the end mark would no longer be valid.
2016-03-28vis: cleanup usage of vis_cursors_countMarc André Tanner
2016-03-28view: prevent creation of duplicated cursorsMarc André Tanner
Fail if there is already a cursor located at the requested position.
2016-03-28view: add infrastructure to iterate through cursor columnsMarc André Tanner
The number of columns i.e. maximal number of cursors located on the same line can be obtained by view_cursors_column_count. Column addressing is zero based, valid indexes are [0, max-1]. Assuming there is a cursor on every letter: a b c d e f g h i max column would be 3, and the following would iterate over the cursors forming the second column [c, e, h]: for (Cursor *c = view_cursors_column(view, 1); c; c = view_cursors_column_next(c, 1)) ...
2016-03-28view: maintain ordering relation among cursorsMarc André Tanner
This is currently only enforced upon creation i.e. we assume that after creation a cursor can not change its relative ordering with respect to its neighbors. The existing code assumes that when iterating through cursors with: for (Cursor *c = view_cursors(view); c; c = view_cursors_next(c)) ... new cursors created with view_cursors_new do not show up. This assumption is preserved under the following conditions: * it only holds for the most recent view_cursors call As a consequence when doing nested iterations new cursors will be yielded once the inner view_cursors call was performed. * view_cursors_primary_get is not called
2016-03-28view: change cursor creation API to take an initial positionMarc André Tanner
2016-03-23Remove identically replicated copyright comments from source filesMarc André Tanner
2016-03-12ui/view: general code cleanupMarc André Tanner
2016-03-12view: cleanup default ui style handlingMarc André Tanner
2016-03-12view: also load lua theme for windows without syntax highlightingMarc André Tanner
This for example affects the default background color and cursor related settings.
2016-03-10view: add query function for multiple cursorsMarc André Tanner
2016-03-10ui: make primary cursor blinkMarc André Tanner
2016-03-10view: clean up API functions related to primary cursor handlingMarc André Tanner
The currently visible display port is always adjusted in a way that the primary cursor is visible.
2016-03-08Workaround for #199xomachine
2016-02-22initized variablesChristian Hesse
2016-02-20colorcolumn enhancementRichard Burke
Allow colorcolumn to be greater than the view width. Lines that wrap now have the colorcolumn highlighted.
2016-02-18vis-lua: promote vis to a real objectMarc André Tanner
That is from now on use vis:method instead of vis.method
2016-02-17Display NUL bytes correctlyRichard Burke
2016-02-16Display ASCII-127 (DEL) character as ^?Richard Burke
2016-02-12Mark some tables as constMarc André Tanner
This allows them to be placed into the read only ELF section.
2016-02-12Improve large file supportMarc André Tanner
Disable absolute line numbers for large files (currently anything bigger than 32MiB). This speeds up moving around with for example nn% since no new lines need to be calculated. Of course movements like :nn will be unaffected. The optimizations can be disabled by explicitly enabling absolute line numbers as in :set number
2016-01-27text-motion: change text_bracket_match APIMarc André Tanner
2016-01-16view: remove special cursor handling at end of visible areaMarc André Tanner
Close #148
2016-01-13view: introduce view_selection_getMarc André Tanner
It returns the range covered by the selection of the primary cursor.
2015-12-31view: fix regressionMarc André Tanner
This reverts 2f4b69cc67e8863e5789817ed5097158e6163621. There are likely still some problems left when editing the end of a file at end of the visual area.
2015-12-29view: improve cursor handling at end of fileMarc André Tanner
Holding down <Backspace> at the end of the file should not keep the cursor on the middle line of the window.
2015-12-29view: fix new line handling at the end of visible areaMarc André Tanner
The last new line is added to the cell matrix but failure is reported to indicate that there is no space left for further characters.
2015-12-29view: fix view [start,end] range calculationMarc André Tanner
This for example now correctly displays tab characters at the very start of the visible area.
2015-12-26vis: refactor Lua integrationMarc André Tanner
Lua support can now be disabled at compile time using: $ make CONFIG_LUA=0 This commit also adds an initial Lua API and provides a few default hooks. We now also require Lua >= 5.2 due to the uservalue constructs. In principle the same functionality could be implemented using function environments from Lua 5.1.
2015-11-28view: remove ViewEvent infrastructureMarc André Tanner
The only used event handler was used to update the '< and '> marks which is now taken care of by the leave handler of the visual modes.
2015-11-28view: preserve column position when moving across linesMarc André Tanner
2015-11-28view: remove special treatment of tabs in cell matrixMarc André Tanner
2015-11-27vis: improve cursor alignment command <C-a>Marc André Tanner
2015-11-23view: fix cell placement of combining charactersMarc André Tanner
They now belong to the cell holding the corresponding regular (i.e. non-combining) character. This also means that at least in theory a cell could hold arbitrary amounts of data, in practice it is limited to 16 bytes.