aboutsummaryrefslogtreecommitdiff
path: root/src/grid
AgeCommit message (Collapse)Author
2018-04-02Fix grid scroll testsJoe Wilm
2018-04-02Make tests compile againJoe Wilm
Some tests are still not passing, though. A migration script was added to migrate serialized grids from pre-scrollback to the current format. The script is included with this commit for completeness, posterity, and as an example to be used in the future. A few tests in grid/tests.rs were removed due to becoming irrelevant.
2018-03-20Fix regression with scrolling regionsJoe Wilm
Resolves #1154
2018-03-15Replace scrolling methods with enumChristian Duerr
The different scrolling methods added a bunch of boilerplate where the call was just forwarded to the next struct, this has been removed by making the scroll amount into a struct. Now everything is called through one method and the parameter decides how far the viewport should be scrolled.
2018-03-15Add scrollback hotkeysChristian Duerr
This offers a few additional hotkeys that can be used in combination with scrollback. None of these are used by default yet. This implements the following bindings: - ScrollPageUp: Scroll exactly one screen height up - ScrollPageDown: Scroll exactly one screen height down - ScrollToTop: Scroll as far up as possible - ScrollToBottom: Scroll as far down as possible This fixes #1151.
2018-03-12Fix crash when selection leaves viewportChristian Duerr
There was an issue where alacritty tries to convert the lines in a selection to the on-screen lines even when the selection is not on the screen. This results in a crash. To prevent this from happening the selection now is not shown if it is off the screen. There currently still is a bug that when the selection is at the top of the screen but still half visible, it will not show the top line as selected but start in the second line. This bug should be resolved with https://github.com/jwilm/alacritty/pull/1171. This fixes #1148.
2018-03-07Support selections with scrolling bufferJoe Wilm
Selections now *mostly* work. They move as the buffer scrolls, copying works as it should, and it looks like the different selection modes behave properly as well. The new Selection implementation uses buffer coordinates instead of screen coordinates. This leads to doing a transform from mouse input to update the selection, and back to screen coordinates when displaying the selection. Scrolling the selection is fast because the grid is already operating in buffer coordinates. There are several bugs to address: * A _partially_ visible selection will lead to a crash since the drawing routine converts selection coordinates to screen coordinates. The solution will be to clip the coordinates at draw time. * A selection scrolling off the buffer in either direction leads to indexing out-of-bounds. The solution again is to clip, but this needs to be done within Selection::rotate by passing a max limit. It may also need a return type to indicate that the selection is no longer visible and should be discarded. * A selection scrolling out of a logical scrolling region is not clipped. A temporary and robust workaround is to simply discard the selection in the case of scrolling in a region. wip selections fix issue with line selection selection mostly working need to support selection not being on the screen at draw time Fix selection_to_string Uncomment tests
2018-03-07Move selection into GridJoe Wilm
Supporting selections with scrollback has two major components: 1. Grid needs access to Selection so that it may update the scroll position as the terminal text changes. 2. Selection needs to be implemented in terms of buffer offsets -- NOT lines -- and be updated when Storage is rotated. This commit implements the first part.
2018-03-07Fix scrolling backwards in tmuxJoe Wilm
2018-03-07Make number of scrollback lines configurableJoe Wilm
2018-03-07Scroll to bottom on character receivedJoe Wilm
2018-03-07wip fix scroll_downJoe Wilm
2018-03-07Fir cursor not scrollingJoe Wilm
2018-03-07Add scrolling limit and update on grow linesJoe Wilm
2018-03-07checkpoint: very basic scrolling worksJoe Wilm
Things that do not work - Limiting how far back in the buffer it's possible to scroll - Selections (need to transform to buffer offsets)
2018-03-07wip scrollbackJoe Wilm
2018-03-07Remove some unused implsJoe Wilm
2018-03-07Minor improvementsJoe Wilm
2018-03-07WIP optimize scroll in regionJoe Wilm
This intends to optimize the case where the top of the scrolling region is the top of the screen. In theory, scrolling in this case can be optimized to shifting the start/end of the visible region, and then rearranging any lines that were not supposed to be scrolled (at the bottom of the region). However, this didn't produce quite the speedup I expected.
2018-03-07Use memcpy for resetting row contentsJoe Wilm
In addition to a marginal performance improvement, this simplifies some logic in the Term implementation since now the Grid fully handles row recycling.
2018-03-07Remove some unused methods and implsJoe Wilm
2018-03-07Eliminate ClearRegion traitJoe Wilm
2018-03-07Move grid Row and tests into submodulesJoe Wilm
This is part of some cleanup for the grid module as a whole.