@@ -90,7 +90,7 @@ def append(self, new: Statement) -> None:
9090
9191 :param new: command line to convert to HistoryItem and add to the end of the History list
9292 """
93- history_item = HistoryItem (new , len (self )+ 1 )
93+ history_item = HistoryItem (new , len (self ) + 1 )
9494 list .append (self , history_item )
9595
9696 def get (self , index : Union [int , str ]) -> HistoryItem :
@@ -210,7 +210,9 @@ def str_search(self, search: str) -> List[HistoryItem]:
210210 def isin (history_item ):
211211 """filter function for string search of history"""
212212 sloppy = utils .norm_fold (search )
213- return sloppy in utils .norm_fold (history_item .statement .raw ) or sloppy in utils .norm_fold (history_item .statement .expanded_command_line )
213+ inraw = sloppy in utils .norm_fold (history_item .statement .raw )
214+ inexpanded = sloppy in utils .norm_fold (history_item .statement .expanded_command_line )
215+ return inraw or inexpanded
214216 return [item for item in self if isin (item )]
215217
216218 def regex_search (self , regex : str ) -> List [HistoryItem ]:
@@ -229,7 +231,7 @@ def isin(hi):
229231 return finder .search (hi .statement .raw ) or finder .search (hi .statement .expanded_command_line )
230232 return [itm for itm in self if isin (itm )]
231233
232- def truncate (self , max_length :int ) -> None :
234+ def truncate (self , max_length : int ) -> None :
233235 """Truncate the length of the history, dropping the oldest items if necessary
234236
235237 :param max_length: the maximum length of the history, if negative, all history
0 commit comments