aboutsummaryrefslogtreecommitdiff
path: root/view.c
AgeCommit message (Collapse)AuthorFilesLines
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.
2015-11-28view: preserve column position when moving across linesMarc André Tanner1-8/+18
2015-11-28view: remove special treatment of tabs in cell matrixMarc André Tanner1-9/+3
2015-11-27vis: improve cursor alignment command <C-a>Marc André Tanner1-0/+11
2015-11-23view: fix cell placement of combining charactersMarc André Tanner1-7/+17
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.
2015-11-14view: increase range to consider for syntax highlightingDavid B. Lamkins1-1/+1
Increase the number of bytes to consider for syntax highligthing before the visisble area. This should improve the handling of long block comments. Closes #110
2015-11-09view: improve window redrawing for shared files/split windowsMarc André Tanner1-1/+1
When a file was being displayed in multiple windows changes in one could confuse the other.
2015-11-09view: correctly redraw window contentMarc André Tanner1-1/+4
If a change occured on the very first shown character, it was not properly reflected in the view.
2015-11-08Fix warnings found by static analyzerMarc André Tanner1-2/+1
2015-11-08Update year numbers in Copyright clauseMarc André Tanner1-1/+1
2015-11-08Remove trailing white space from source filesMarc André Tanner1-8/+8
2015-11-08Delete now obsolete syntax.hMarc André Tanner1-1/+14
2015-11-08view: do not highlight matching symbols if selection is activeMarc André Tanner1-1/+1
2015-11-08vis: introduce vis namespace for lua objectsMarc André Tanner1-9/+7
For now the vis table has only one member "lexers".
2015-11-08vis: implement :set colorcolumnMarc André Tanner1-0/+22
2015-11-08vis: factor out syntax highlighting codeMarc André Tanner1-47/+58
The view_draw function renders the text into the cells array and resyncs the cursor position. The syntax highlighting is applied in view_update, which also instructs the ui to update.
2015-11-08vis: implement :set cursorlineMarc André Tanner1-0/+3