1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 06:16:17 +03:00
Этот коммит содержится в:
rhysd
2022-09-28 21:07:20 +09:00
родитель 3387f93319
Коммит ffd8b1c5f7
2 изменённых файлов: 4 добавлений и 2 удалений

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

@@ -249,7 +249,7 @@ impl CursorMove {
let row = row.checked_sub(1)?;
Some((row, fit_col(col, &lines[row])))
}
Down => (Some((row + 1, fit_col(col, lines.get(row + 1)?)))),
Down => Some((row + 1, fit_col(col, lines.get(row + 1)?))),
Head => Some((row, 0)),
End => Some((row, lines[row].chars().count())),
Top => Some((0, fit_col(col, &lines[0]))),

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

@@ -116,7 +116,9 @@ impl<'a> Widget for Renderer<'a> {
let top_col = next_scroll_top(top_col, cursor.1 as u16, width);
let text = self.text(top_row as usize, height as usize);
let mut inner = Paragraph::new(text).style(self.0.style()).alignment(self.0.alignment());
let mut inner = Paragraph::new(text)
.style(self.0.style())
.alignment(self.0.alignment());
if let Some(b) = self.0.block() {
inner = inner.block(b.clone());
}