File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -154,13 +154,14 @@ def isin(hi):
154154 :param hi: HistoryItem
155155 :return: bool - True if search matches
156156 """
157- return finder .search (hi )
157+ return finder .search (hi ) or finder . search ( hi . expanded )
158158 else :
159159 def isin (hi ):
160160 """Listcomp filter function for doing a case-insensitive string search of History.
161161
162162 :param hi: HistoryItem
163163 :return: bool - True if search matches
164164 """
165- return utils .norm_fold (getme ) in utils .norm_fold (hi )
165+ srch = utils .norm_fold (getme )
166+ return srch in utils .norm_fold (hi ) or srch in utils .norm_fold (hi .expanded )
166167 return [itm for itm in self if isin (itm )]
Original file line number Diff line number Diff line change @@ -123,6 +123,31 @@ def test_history_with_string_argument(base_app):
123123""" )
124124 assert out == expected
125125
126+ def test_history_expanded_with_string_argument (base_app ):
127+ run_cmd (base_app , 'alias create sc shortcuts' )
128+ run_cmd (base_app , 'help' )
129+ run_cmd (base_app , 'help history' )
130+ run_cmd (base_app , 'sc' )
131+ out = run_cmd (base_app , 'history -v shortcuts' )
132+ expected = normalize ("""
133+ 1 alias create sc shortcuts
134+ 4 sc
135+ 4x shortcuts
136+ """ )
137+ assert out == expected
138+
139+ def test_history_expanded_with_regex_argument (base_app ):
140+ run_cmd (base_app , 'alias create sc shortcuts' )
141+ run_cmd (base_app , 'help' )
142+ run_cmd (base_app , 'help history' )
143+ run_cmd (base_app , 'sc' )
144+ out = run_cmd (base_app , 'history -v /sh.*cuts/' )
145+ expected = normalize ("""
146+ 1 alias create sc shortcuts
147+ 4 sc
148+ 4x shortcuts
149+ """ )
150+ assert out == expected
126151
127152def test_history_with_integer_argument (base_app ):
128153 run_cmd (base_app , 'help' )
You can’t perform that action at this time.
0 commit comments