Document a couple of methods

Also fixes formatting on the Term::new method signature.
This commit is contained in:
Joe Wilm committed 2016-12-11 20:23:41 -08:00
1 parent 30bee80a69
commit 74dcba59d8
1 file changed
+10 -3
+10 -3
View File
@@ -342,9 +342,7 @@ impl SizeInfo {
}
impl Term {
pub fn new(
size: SizeInfo
) -> Term {
pub fn new(size: SizeInfo) -> Term {
let template = Cell::new(
' ',
cell::Color::Ansi(Color::Foreground),
@@ -399,10 +397,19 @@ impl Term {
Some((line, col))
}
/// Access to the raw grid data structure
///
/// This is a bit of a hack; when the window is closed, the event processor
/// serializes the grid state to a file.
pub fn grid(&self) -> &Grid<Cell> {
&self.grid
}
/// Iterate over the *renderable* cells in the terminal
///
/// A renderable cell is any cell which has content other than the default
/// background color. Cells with an alternate background color are
/// considered renderable as are cells with any text content.
pub fn renderable_cells<'a>(&'a mut self) -> RenderableCellsIter<'a> {
RenderableCellsIter::new(&mut self.grid, &self.cursor, self.mode)
}