Show More
@@ -318,6 +318,9 def cd_completer(self, event): | |||
|
318 | 318 | return ents |
|
319 | 319 | return [] |
|
320 | 320 | |
|
321 | if event.symbol.startswith('--'): | |
|
322 | return ["--" + os.path.basename(d) for d in ip.user_ns['_dh']] | |
|
323 | ||
|
321 | 324 | if relpath.startswith('~'): |
|
322 | 325 | relpath = os.path.expanduser(relpath).replace('\\','/') |
|
323 | 326 | found = [] |
@@ -2693,7 +2693,7 Defaulting color scheme to 'NoColor'""" | |||
|
2693 | 2693 | |
|
2694 | 2694 | cd -<n>: changes to the n-th directory in the directory history. |
|
2695 | 2695 | |
|
2696 | cd -foo: change to directory that matches 'foo' in history | |
|
2696 | cd --foo: change to directory that matches 'foo' in history | |
|
2697 | 2697 | |
|
2698 | 2698 | cd -b <bookmark_name>: jump to a bookmark set by %bookmark |
|
2699 | 2699 | (note: cd <bookmark_name> is enough if there is no |
@@ -2714,7 +2714,6 Defaulting color scheme to 'NoColor'""" | |||
|
2714 | 2714 | |
|
2715 | 2715 | oldcwd = os.getcwd() |
|
2716 | 2716 | numcd = re.match(r'(-)(\d+)$',parameter_s) |
|
2717 | wordcd = re.match(r'(-)(\w+)$',parameter_s) | |
|
2718 | 2717 | # jump in directory history by number |
|
2719 | 2718 | if numcd: |
|
2720 | 2719 | nn = int(numcd.group(2)) |
@@ -2725,18 +2724,18 Defaulting color scheme to 'NoColor'""" | |||
|
2725 | 2724 | return |
|
2726 | 2725 | else: |
|
2727 | 2726 | opts = {} |
|
2728 | elif wordcd: | |
|
2727 | elif parameter_s.startswith('--'): | |
|
2729 | 2728 | ps = None |
|
2730 | 2729 | fallback = None |
|
2731 |
pat = |
|
|
2730 | pat = parameter_s[2:] | |
|
2732 | 2731 | dh = self.shell.user_ns['_dh'] |
|
2733 | 2732 | # first search only by basename (last component) |
|
2734 | 2733 | for ent in reversed(dh): |
|
2735 | if pat in os.path.basename(ent): | |
|
2734 | if pat in os.path.basename(ent) and os.path.isdir(ent): | |
|
2736 | 2735 | ps = ent |
|
2737 | 2736 | break |
|
2738 | 2737 | |
|
2739 | if fallback is None and pat in ent: | |
|
2738 | if fallback is None and pat in ent and os.path.isdir(ent): | |
|
2740 | 2739 | fallback = ent |
|
2741 | 2740 | |
|
2742 | 2741 | # if we have no last part match, pick the first full path match |
@@ -53,6 +53,9 New features | |||
|
53 | 53 | the main usage of the script is for starting things on localhost. Eventually |
|
54 | 54 | when ipcluster is able to start things on other hosts, we will put security |
|
55 | 55 | back. |
|
56 | * 'cd --foo' searches directory history for string foo, and jumps to that dir. | |
|
57 | Last part of dir name is checked first. If no matches for that are found, | |
|
58 | look at the whole path. | |
|
56 | 59 | |
|
57 | 60 | Bug fixes |
|
58 | 61 | --------- |
@@ -64,6 +67,8 Bug fixes | |||
|
64 | 67 | * A few subpackages has missing `__init__.py` files. |
|
65 | 68 | * The documentation is only created is Sphinx is found. Previously, the `setup.py` |
|
66 | 69 | script would fail if it was missing. |
|
70 | * Greedy 'cd' completion has been disabled again (it was enabled in 0.8.4) | |
|
71 | ||
|
67 | 72 | |
|
68 | 73 | Backwards incompatible changes |
|
69 | 74 | ------------------------------ |
General Comments 0
You need to be logged in to leave comments.
Login now