aboutsummaryrefslogtreecommitdiff
path: root/view.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-22vis: refactor status line handlingMarc André Tanner1-2/+2
Make window status bar content configurable via Lua.
2016-05-22vis: consider :set horizon setting when syntax highlightingMarc André Tanner1-11/+0
2016-05-22vis: move syntax highlighting to pure Lua codeMarc André Tanner1-183/+5
2016-05-22view: add functions to style a file rangeMarc André Tanner1-0/+35
2016-05-22ui: s/UiStyles/UiStyle/gMarc André Tanner1-1/+1
2016-05-05view: try to recover from invalid cursor positionsMarc André Tanner1-1/+4
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é Tanner1-6/+0
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é Tanner1-12/+4
2016-04-29view: try to improve cursor placementMarc André Tanner1-18/+21
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é Tanner1-2/+4
Close #216
2016-04-27view: change view_cursors_place to take 1 based column numberMarc André Tanner1-1/+1
This should fix inconsistency in the Lua API.
2016-04-19vis: add :set horizon optionDavid B. Lamkins1-4/+13
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é Tanner1-0/+7
2016-04-15view: add view_cursors_col functionMarc André Tanner1-0/+5
2016-04-15view: add view_cursors_line functionMarc André Tanner1-0/+5
2016-04-13view: add view_cursors_new_force functionMarc André Tanner1-3/+11
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é Tanner1-8/+21
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é Tanner1-1/+3
Do not crash if for some reason view->{start,end} have outdated values.
2016-04-03view: add return value to view_cursors_disposeMarc André Tanner1-7/+8
indicating whether cursor could be removed
2016-03-30view: constify functions to manipulate selectionsMarc André Tanner1-2/+2
2016-03-30view: change internal representation of selectionsMarc André Tanner1-23/+27
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é Tanner1-1/+1
2016-03-28view: prevent creation of duplicated cursorsMarc André Tanner1-2/+8
Fail if there is already a cursor located at the requested position.
2016-03-28view: add infrastructure to iterate through cursor columnsMarc André Tanner1-0/+54
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é Tanner1-9/+53
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é Tanner1-3/+4
2016-03-23Remove identically replicated copyright comments from source filesMarc André Tanner1-15/+0
2016-03-12ui/view: general code cleanupMarc André Tanner1-7/+7
2016-03-12view: cleanup default ui style handlingMarc André Tanner1-28/+25
2016-03-12view: also load lua theme for windows without syntax highlightingMarc André Tanner1-7/+7
This for example affects the default background color and cursor related settings.
2016-03-10view: add query function for multiple cursorsMarc André Tanner1-0/+4
2016-03-10ui: make primary cursor blinkMarc André Tanner1-0/+4
2016-03-10view: clean up API functions related to primary cursor handlingMarc André Tanner1-2/+12
The currently visible display port is always adjusted in a way that the primary cursor is visible.
2016-03-08Workaround for #199xomachine1-2/+2
2016-02-22initized variablesChristian Hesse1-2/+2
2016-02-20colorcolumn enhancementRichard Burke1-3/+19
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é Tanner1-0/+4
That is from now on use vis:method instead of vis.method
2016-02-17Display NUL bytes correctlyRichard Burke1-1/+1
2016-02-16Display ASCII-127 (DEL) character as ^?Richard Burke1-4/+5
2016-02-12Mark some tables as constMarc André Tanner1-1/+1
This allows them to be placed into the read only ELF section.
2016-02-12Improve large file supportMarc André Tanner1-1/+9
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é Tanner1-1/+1
2016-01-16view: remove special cursor handling at end of visible areaMarc André Tanner1-2/+0
Close #148
2016-01-13view: introduce view_selection_getMarc André Tanner1-0/+4
It returns the range covered by the selection of the primary cursor.
2015-12-31view: fix regressionMarc André Tanner1-1/+3
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é Tanner1-1/+1
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é Tanner1-1/+1
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é Tanner1-1/+1
This for example now correctly displays tab characters at the very start of the visible area.
2015-12-26vis: refactor Lua integrationMarc André Tanner1-157/+174
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é Tanner1-6/+1
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.