Skip to content

Commit

Permalink
remove some old stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
robamu committed Nov 24, 2023
1 parent 5333b1f commit c333f85
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/prompt_toolkit/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,8 @@ class FileHistory(History):
maximum amount of initially loaded commands.
"""

def __init__(self, filename: str, max_loaded_history: None | int = None) -> None:
def __init__(self, filename: str) -> None:
self.filename = filename
self.max_loaded_history = max_loaded_history
super().__init__()

def load_history_strings(self) -> Iterable[str]:
Expand All @@ -289,8 +288,6 @@ def add() -> None:

add()

if self.max_loaded_history is not None:
return list(reversed(strings))[: len(strings) - self.max_loaded_history]
# Reverse the order, because newest items have to go first.
return reversed(strings)

Expand Down

0 comments on commit c333f85

Please sign in to comment.