зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 16:05:50 +03:00
fix errors reported by lints
Этот коммит содержится в:
@@ -249,7 +249,7 @@ impl CursorMove {
|
|||||||
let row = row.checked_sub(1)?;
|
let row = row.checked_sub(1)?;
|
||||||
Some((row, fit_col(col, &lines[row])))
|
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)),
|
Head => Some((row, 0)),
|
||||||
End => Some((row, lines[row].chars().count())),
|
End => Some((row, lines[row].chars().count())),
|
||||||
Top => Some((0, fit_col(col, &lines[0]))),
|
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 top_col = next_scroll_top(top_col, cursor.1 as u16, width);
|
||||||
|
|
||||||
let text = self.text(top_row as usize, height as usize);
|
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() {
|
if let Some(b) = self.0.block() {
|
||||||
inner = inner.block(b.clone());
|
inner = inner.block(b.clone());
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user