aboutsummaryrefslogtreecommitdiff
path: root/view.h
AgeCommit message (Collapse)AuthorFilesLines
2024-03-25ui: refactor style handlingRandy Palamar1-2/+3
The old style handling had a lot edge cases where one of the colours or the attribute wouldn't get applied correctly. This commit adds a new style_set() method to the Ui which should be called instead of manually touching a cell's style. This also means that the Cell struct can be made opaque since all the handling is now done inside the ui-terminal files. With this it is now viable to combine the light and dark 16 colour themes into a single base-16 theme. This theme works very well with the Linux virtual console and will now be the default theme regardless of if the terminal supports 256 colours or not. This should address the common complaints about vis not respecting the users default terminal colours. fixes #1151: Theming is sometimes partially applied or ignored see #1103: terminal no longer has transparency/opacity see #1040: Transparent background and setting options by default
2023-08-27Make tabwidth option window-localAlexey Yerin1-0/+2
2023-08-24Lua API: access and set all available optionsRandy Palamar1-0/+2
The first point of this commit is to allow all options to be read from lua. This has a number of uses for plugin writers. They are grouped into a couple of tables depending on what they control: `vis.options`: table with global configuration `win.options`: table with window specific configuration The second point is to allow you to set all these options as if they were simply lua variables. Technically this is already possible by using `vis:command("set ...")` but personally I think this interface is cleaner. Note that this already possible for some things like the current mode (eg. vis.mode = vis.modes.VISUAL). Examples: `vis.options.ai = true` `win.options.brk = " !?."` `win.options = { showeof = true, showtabs = true } There are a number of related issues and pull requests: closes #803: Lua API: let plugins read the values of options closes #812: Window layout property supersedes/closes #717: Add ability to access tabwidth from Lua supersedes/closes #1066: expose UI layout and allow it to be set from lua API
2023-07-28view.c: add word wrappingAndrey Proskurin1-0/+2
this is contolled by the wrapcolumn/wc and breakat/brk options related #142: Word wrap and line breaks related #932: Vis for Prose? related #1092: Disabling line wrapping
2022-11-29fix miscellaneous spelling mistakesNick Hanley1-1/+1
2020-12-10fix typos in commentsMoesasji1-5/+5
2020-08-01doc: fix a couple of API doc warningsMarc André Tanner1-8/+8
In restructured text double backquotes are used for inline literals.
2020-01-30view: Fix a @param name in a commentTwoFinger1-1/+1
2017-07-14vis-lua: make selection first class primitives in Lua APIMarc André Tanner1-1/+1
2017-07-05vis: make sure all selections have same anchored stateMarc André Tanner1-2/+3
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é Tanner1-10/+0
This window local register holds the last active selections.
2017-06-27Merge branch 'show-eof' of https://github.com/p-e-w/visMarc André Tanner1-0/+2
Conflicts: view.c view.h
2017-06-15view: add functions to save/restore arbitrary rangesMarc André Tanner1-0/+3
2017-06-15view: add functions to get/set all selectionsMarc André Tanner1-0/+13
2017-06-15view: disallow setting of invalid selectionsMarc André Tanner1-1/+1
2017-06-15view: introduce view_selections_normalizeMarc André Tanner1-0/+2
Dispose all invalid and merge all overlapping selections.
2017-06-15vis: rename uses of Cursor to SelectionMarc André Tanner1-37/+36
2017-06-15view: rename view_cursors_columnMarc André Tanner1-1/+1
2017-06-15view: rename view_cursorsMarc André Tanner1-1/+1
2017-06-15view: rename view_selection_anchoredMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_column{,count,next}Marc André Tanner1-2/+2
2017-06-15view: rename view_cursors_numberMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_countMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_nextMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_prevMarc André Tanner1-1/+1
2017-06-15view: view_cursors_selection_restoreMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_saveMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_startMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_swapMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_clearMarc André Tanner1-1/+1
2017-06-15view: rename view_selections_clearMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_selection_getMarc André Tanner1-2/+2
2017-06-15view: rename view_cursors_primary_{get,set}Marc André Tanner1-2/+2
2017-06-15view: rename view_cursors_clearMarc André Tanner1-1/+1
2017-06-15view: rename view_cursor_disposedMarc André Tanner1-1/+1
2017-06-15view: rename view_cursors_disposeMarc André Tanner1-2/+2
2017-06-15view: rename view_cursors_newMarc André Tanner1-2/+2
2017-06-15view: remove view_cursors_multipleMarc André Tanner1-2/+0
2017-06-15view: clean up and add documentationMarc André Tanner1-118/+292
2017-06-15vis: promote selections to first class primitivesMarc André Tanner1-16/+6
This unifies cursors and selections. The cursor are now represendted as singleton selections.
2017-06-04Add option to hide EOF markerPhilipp Emanuel Weidmann1-0/+2
2017-04-20vis: start cleaning up register related codeMarc André Tanner1-1/+0
Now that register.h is no longer used by view.h we can move the struct and function declarations to vis-core.h.
2017-04-19vis: restructure register handlingMarc André Tanner1-2/+0
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-03-22view: rename view_dirty to view_invalidateMarc André Tanner1-1/+1
2017-03-14Restructure display codeMarc André Tanner1-17/+12
Use pull instead of push based model for display code. Previously view.c was calling into the ui frontend code, with the new scheme this switches around: the necessary data is fetched by the ui as necessary. The UI independent display code is moved out of view.c/ui-curses.c into vis.c. The cell styles are now directly embedded into the Cell struct. New UI styles are introduced for: - status bar (focused / non-focused) - info message - window separator - EOF symbol You will have to update your color themes. The terminal output code is further abstracted into a generic ui-terminal.c part which keeps track of the whole in-memory cell matrix and #includes ui-terminal-curses.c for the actual terminal output. This architecture currently assumes that there are no overlapping windows. It will also allow non-curses based terminal user interfaces.
2017-01-31view: add back link from selection to corresponding cursorMarc André Tanner1-1/+1
Can be NULL if no cursor is associated with the given selection (this is currently never the case). Avoids a loop through all cursors when clearing selections.
2017-01-13view: add infrastructure for delayed cursor destructionMarc André Tanner1-0/+7
At least one cursor (referred to as primary or main cursor) has always to exist. In the sam command language implementation we might want to dispose a cursor even if it is the primary one before later commands will create different ones (e.g. `:x/pattern/ { i/>>>/ a/<<</ }`). This commit introduces view_cursors_dispose_force. If called on the last remaining cursor, its selection is cleared and it is marked for destruction as soon as a new cursor is created. view_cursor_disposed returns the cursor marked for deletion (if any) and clears the descruction flag.
2016-10-03vis: improve cursor positioning after scrollingMarc André Tanner1-0/+4
Make cursor placement after scrolling (half) pages up/down less arbitrary. Close #390, fix #391
2016-05-22vis: refactor status line handlingMarc André Tanner1-1/+1
Make window status bar content configurable via Lua.
2016-05-22vis: consider :set horizon setting when syntax highlightingMarc André Tanner1-2/+0