From 7b9a1c71640f16c9f821c5cf09c215275ec8f0b3 2012-09-12 13:00:09 From: Takafumi Arakaki Date: 2012-09-12 13:00:09 Subject: [PATCH] Limit option -l for %history can be used with -g now --- diff --git a/IPython/core/magics/history.py b/IPython/core/magics/history.py index 23f5a8f..e9c3306 100644 --- a/IPython/core/magics/history.py +++ b/IPython/core/magics/history.py @@ -170,7 +170,8 @@ class HistoryMagics(Magics): pattern = "*" + " ".join(args.pattern) + "*" else: pattern = "*" - hist = history_manager.search(pattern, raw=raw, output=get_output) + hist = history_manager.search(pattern, raw=raw, output=get_output, + n=args.limit) print_nums = True elif getattr(args, 'limit_specified', False): n = 10 if args.limit is None else args.limit