summaryrefslogtreecommitdiff
path: root/view.c
AgeCommit message (Collapse)Author
2016-12-05view: make cursor placement more robustMarc André Tanner
Reject invalid cursor positions.
2016-11-06view: make viewport adjustment more robustMarc André Tanner
Make sure that the view_cursors_scroll_to function does not enter an infinite loop.
2016-10-27view: use more lightweight default white space replacement symbolsMarc André Tanner
While the replacement symbols are still not run-time configurable, the new defaults should hopefully please more people. Close #401
2016-10-03vis: improve cursor positioning after scrollingMarc André Tanner
Make cursor placement after scrolling (half) pages up/down less arbitrary. Close #390, fix #391
2016-09-29view: change cursor line up/down off screen movementsMarc André Tanner
Previously the cursor would be placed in the middle of the screen thus causing a distracting jump. Instead try to scroll the view port by only 1 line when the cursor is moved out of the visible area. The current implementation might be quite a bit slower than before, use page-wise scrolling to skip large regions. At some point we should optimize motions like 1000j. Close #301
2016-08-07view: fix screen line based motions when cursor is not visibleMarc André Tanner
If a cursor is not currently visible it has no associated screen line. Fallback to the corresponding logical line based variant. For example `gj` is interpreted as `j`. Fixes #354
2016-05-28vis: try to reduce number of redrawsMarc André Tanner
This is a not yet successful attempt to reduce terminal flickering when resizing windows as is for example the case when entering command mode. UI related debug output can be enabled with: $ make CFLAGS=-DDEBUG_UI=1 $ ./vis > log
2016-05-22vis: refactor status line handlingMarc André Tanner
Make window status bar content configurable via Lua.
2016-05-22vis: consider :set horizon setting when syntax highlightingMarc André Tanner
2016-05-22vis: move syntax highlighting to pure Lua codeMarc André Tanner
2016-05-22view: add functions to style a file rangeMarc André Tanner
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