aboutsummaryrefslogtreecommitdiff
path: root/src/selection.rs
AgeCommit message (Collapse)Author
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-07Remove redundant selection::Region typeJoe Wilm
The type selection::Region was defined identially to std::ops::Range. Using something other than range just served to confuse.
2018-03-04Remove all instances of unwrap() from configChristian Duerr
Unwrapping inside the config file parsing can lead to some issues that prevent us from falling back to a default configuration file. One instance of that issue was mentioned in #1135. Now all instances of `unwrap()` have been removed and replaced with proper error handling. This will make the config more robust and prevents live reload from silently breaking while alacritty is running. This also fixes a few currently existing clippy issues. Clippy added an additonal lint which complains about `MyStruct { field: field }`. These issues have been fixed, except for some false-positives and issues in external macros which will probably be fixed with future updates (rust-lang-nursery/bitflags#149)
2018-01-06Add clippy check to travisChristian Duerr
This commit adds clippy as a required step of the build process. To make this possible, all existing clippy issues have been resolved.
2017-12-03clippy: do and don't pass some things by reference as suggested ↵Matthias Krüger
(needless_pass_by_value, needless_borrow).
2017-10-30fix some typos in commentsMartin Lindhe
2017-06-19Update tests for new Selection APIJoe Wilm
2017-06-19Fix unnecessary redraws with active selectionJoe Wilm
Could be cleaned up a bit if there was a wrapper for Option<Selection> that contained this flag. Also fixes a few compiler warnings.
2017-06-19Implement semantic and line selection draggingJoe Wilm
Unlike the regular selection that is by cell, these selection modes highlight either semantic groupings or entire lines while the mouse is dragged.
2017-01-06Clippy fixes!Manish Goregaokar
2017-01-06Remove need for inclusive rangesManish Goregaokar
2016-12-29Fix some bugs with selectionsJoe Wilm
Moving the window on macOS would cause a panic in certain circumstances.
2016-12-29Unify Cursor, Location and name it PointJoe Wilm
2016-12-26Implement copying selection for macOSJoe Wilm
Still need automatic loading into selection copy buffer for linux.
2016-12-22Implement visual component of mouse selectionsJoe Wilm
This adds the ability to click and drag with the mouse and have the effect of visually selecting text. The ability to copy the selection into a clipboard buffer is not yet implemented.