diff --git a/visidata/sheets.py b/visidata/sheets.py index daa9fe351..de886bc22 100644 --- a/visidata/sheets.py +++ b/visidata/sheets.py @@ -303,8 +303,9 @@ def loader(self): self.rows = [] try: with vd.Progress(gerund='loading', total=0): + max_rows = self.options.max_rows for i, r in enumerate(self.iterload()): - if self.precious and i > self.options.max_rows: + if self.precious and i == max_rows: break self.addRow(r) except FileNotFoundError: @@ -1051,8 +1052,9 @@ def loader(self): self.rows = [] # add the rest of the rows + max_rows = self.options.max_rows for i, r in enumerate(vd.Progress(itsource, gerund='loading', total=0)): - if self.precious and i > self.options.max_rows: + if self.precious and i == max_rows: break self.addRow(r)