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