diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-10-06 11:28:12 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-10-06 11:32:35 +0300 |
commit | 6f816d29c56ffcdb8937464ac3e460c63135979a (patch) | |
tree | 6b376b986af65930b53e8c1fe070a0c411293bdd /ui/src/terminal/cells.rs | |
parent | b25f10f92a299309a8319c22c3ca0c7da8b6689f (diff) |
conf: add ascii_drawing option
If set to true, box drawing is done with ascii characters.
Diffstat (limited to 'ui/src/terminal/cells.rs')
-rw-r--r-- | ui/src/terminal/cells.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/src/terminal/cells.rs b/ui/src/terminal/cells.rs index 0db2f079..ef7773bf 100644 --- a/ui/src/terminal/cells.rs +++ b/ui/src/terminal/cells.rs @@ -25,6 +25,7 @@ */ use super::position::*; +use crate::state::Context; use text_processing::wcwidth; use std::convert::From; @@ -105,6 +106,7 @@ pub struct CellBuffer { cols: usize, rows: usize, buf: Vec<Cell>, + pub ascii_drawing: bool, } impl fmt::Debug for CellBuffer { @@ -137,9 +139,23 @@ impl CellBuffer { cols, rows, buf: vec![cell; cols * rows], + ascii_drawing: false, } } + pub fn new_with_context(cols: usize, rows: usize, cell: Cell, context: &Context) -> CellBuffer { + CellBuffer { + cols, + rows, + buf: vec![cell; cols * rows], + ascii_drawing: context.settings.terminal.ascii_drawing, + } + } + + pub fn set_ascii_drawing(&mut self, new_val: bool) { + self.ascii_drawing = new_val; + } + /// Resizes `CellBuffer` to the given number of rows and columns, using the given `Cell` as /// a blank. pub fn resize(&mut self, newcols: usize, newrows: usize, blank: Cell) { |