From 23b0bef648e8e802dc93a7d2eb39e71ece5bc962 2008-09-13 07:28:29 From: Ville M. Vainio Date: 2008-09-13 07:28:29 Subject: [PATCH] cd completer considers bookmarks if no other matches are available --- diff --git a/IPython/Extensions/ipy_completers.py b/IPython/Extensions/ipy_completers.py index d6a0aa6..48816d0 100644 --- a/IPython/Extensions/ipy_completers.py +++ b/IPython/Extensions/ipy_completers.py @@ -335,6 +335,12 @@ def cd_completer(self, event): if not found: if os.path.isdir(relpath): return [relpath] + + bks = self.db.get('bookmarks',{}).keys() + bkmatches = [s for s in bks if s.startswith(event.symbol)] + if bkmatches: + return bkmatches + raise IPython.ipapi.TryNext