mirror of
https://github.com/bobwen-dev/hunter
synced 2025-04-12 00:55:41 +02:00
count lines in TextView from 1
This commit is contained in:
parent
34ee65600f
commit
44baece00f
@ -204,11 +204,9 @@ impl Widget for TextView {
|
|||||||
fn render_footer(&self) -> HResult<String> {
|
fn render_footer(&self) -> HResult<String> {
|
||||||
let (xsize, ysize) = self.core.coordinates.size_u();
|
let (xsize, ysize) = self.core.coordinates.size_u();
|
||||||
let (_, ypos) = self.core.coordinates.position_u();
|
let (_, ypos) = self.core.coordinates.position_u();
|
||||||
let lines = self.lines
|
let lines = self.lines.len();
|
||||||
.len()
|
let current_line_top = self.offset + 1;
|
||||||
.saturating_sub(1);
|
let current_line_bot = std::cmp::min(current_line_top + (ysize + 1),
|
||||||
let current_line_top = self.offset;
|
|
||||||
let current_line_bot = std::cmp::min(current_line_top + ysize + 1,
|
|
||||||
lines);
|
lines);
|
||||||
let line_hint = format!("{} - {} / {}",
|
let line_hint = format!("{} - {} / {}",
|
||||||
current_line_top,
|
current_line_top,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user