1
0
зеркало из https://github.com/glebtv/tui-textarea.git synced 2026-09-03 14:26:17 +03:00
Этот коммит содержится в:
achristmascarl
2024-07-30 16:11:36 -04:00
родитель 757ea187af
Коммит eae80347d9

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

@@ -289,14 +289,15 @@ impl CursorMove {
WordEnd => {
if let Some(col) = find_word_end_next(&lines[row], col) {
Some((row, col))
} else if let Some(col) = (row + 1 < lines.len())
.then(|| find_word_end_next(&lines[row + 1], 0))
.unwrap_or_default()
{
Some((row + 1, col))
} else if row + 1 < lines.len() {
if let Some(col) = find_word_end_next(&lines[row + 1], 0) {
Some((row + 1, col))
} else {
Some((row + 1, lines[row + 1].chars().count()))
}
Some((row + 1, lines[row + 1].chars().count().saturating_sub(1)))
} else {
Some((row, lines[row].chars().count()))
Some((row, lines[row].chars().count().saturating_sub(1)))
}
}
WordForward => {