diff --git a/examples/editor.rs b/examples/editor.rs index 406fc7b..b8cdcd8 100644 --- a/examples/editor.rs +++ b/examples/editor.rs @@ -35,9 +35,10 @@ impl<'a> Buffer<'a> { if md.is_file() { let mut textarea: TextArea = io::BufReader::new(fs::File::open(&path)?) .lines() - .collect::>()?; - let hard_tab = textarea.lines().iter().any(|l| l.starts_with('\t')); - textarea.set_hard_tab(hard_tab); + .collect::>()?; + if textarea.lines().iter().any(|l| l.starts_with('\t')) { + textarea.set_hard_tab_indent(true); + } textarea } else { return error!("{:?} is not a file", path); diff --git a/src/textarea.rs b/src/textarea.rs index d79dd08..3a7c10a 100644 --- a/src/textarea.rs +++ b/src/textarea.rs @@ -41,7 +41,7 @@ pub struct TextArea<'a> { style: Style, cursor: (usize, usize), // 0-base tab_len: u8, - hard_tab: bool, + hard_tab_indent: bool, history: History, cursor_line_style: Style, line_number_style: Option