diff --git a/IPython/core/magics/history.py b/IPython/core/magics/history.py index 6703f26..9762e6e 100644 --- a/IPython/core/magics/history.py +++ b/IPython/core/magics/history.py @@ -184,14 +184,11 @@ class HistoryMagics(Magics): n = 10 if limit is None else limit hist = history_manager.get_tail(n, raw=raw, output=get_output) else: - if args.range: # Get history by ranges - if args.pattern: - range_pattern = "*" + " ".join(args.pattern) + "*" - print_nums = True - hist = history_manager.get_range_by_str(" ".join(args.range), - raw, get_output) - else: # Just get history for the current session - hist = history_manager.get_range(raw=raw, output=get_output) + if args.pattern: + range_pattern = "*" + " ".join(args.pattern) + "*" + print_nums = True + hist = history_manager.get_range_by_str(" ".join(args.range), + raw, get_output) # We could be displaying the entire history, so let's not try to pull # it into a list in memory. Anything that needs more space will just