Skip to content

Commit

Permalink
Merge pull request #48 from kyoto7250/fix_issue47
Browse files Browse the repository at this point in the history
Prevent adding the same line and correct the starting position of offset
  • Loading branch information
kyoto7250 authored Jun 17, 2024
2 parents 05a178b + 7be027c commit f1918b7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ impl App {
}

if let Some(index) = self.record_table.table.selected_row.selected() {
if index.saturating_add(1) % RECORDS_LIMIT_PER_PAGE as usize == 0 {
if index.saturating_add(1) % RECORDS_LIMIT_PER_PAGE as usize == 0
&& index >= self.record_table.table.rows.len() - 1
{
if let Some((database, table)) =
self.databases.tree().selected_table()
{
Expand All @@ -310,7 +312,7 @@ impl App {
.get_records(
&database,
&table,
index as u16,
index.saturating_add(1) as u16,
if self.record_table.filter.input_str().is_empty() {
None
} else {
Expand Down

0 comments on commit f1918b7

Please sign in to comment.