39 lines
1019 B
Go
39 lines
1019 B
Go
// Copyright (c) 2026 Storm Dragon
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package review
|
|
|
|
import (
|
|
"git.stormux.org/storm/fenrir/internal/i18n"
|
|
"git.stormux.org/storm/fenrir/internal/presentation"
|
|
)
|
|
|
|
func (r *Review) vertical_character(direction int) string {
|
|
nextRow := r.y + direction
|
|
if nextRow < 0 {
|
|
return r.screen_boundary(false)
|
|
}
|
|
if nextRow >= r.screen.Rows {
|
|
return r.screen_boundary(true)
|
|
}
|
|
r.y = nextRow
|
|
// Snapshots retain terminal padding, so a short or blank row need not
|
|
// clamp the column. Table review also retains the selected cell: an
|
|
// absolute column outside it must not read a neighbouring cell instead.
|
|
if r.tableMode {
|
|
cells := r.current_table_cells()
|
|
if r.tableColumn >= len(cells) {
|
|
return i18n.T("no table data")
|
|
}
|
|
cell := cells[r.tableColumn]
|
|
if cell.start == cell.end {
|
|
r.result.Cue = presentation.Blank
|
|
return i18n.T("blank")
|
|
}
|
|
if r.x < cell.start || r.x >= cell.end {
|
|
return i18n.T("no table data")
|
|
}
|
|
}
|
|
return r.currentCharacter()
|
|
}
|