1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-05 07:15:49 +03:00

rename set_hard_tab/hard_tab to set_hard_tab_indent/hard_tab_indent

Этот коммит содержится в:
rhysd
2022-06-22 22:50:49 +09:00
родитель 08bcc50e11
Коммит 9f54a6758e
2 изменённых файлов: 17 добавлений и 16 удалений

Просмотреть файл

@@ -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::<Result<_, _>>()?;
let hard_tab = textarea.lines().iter().any(|l| l.starts_with('\t'));
textarea.set_hard_tab(hard_tab);
.collect::<io::Result<_>>()?;
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);