fixed perl bug and improved path tab-complete

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-12-05 03:33:57 +00:00
parent 3e23f41203
commit 6fccb54b16
3 changed files with 4 additions and 2 deletions

View File

@ -56,6 +56,7 @@ class FileCompleter(Completer):
candidates = [util.expand_tilde(user) for user in users if user.startswith(s)]
else:
candidates = glob.glob(s + '*')
candidates = [util.normal_path(p) for p in candidates]
# ignore some suffixes by default, unless the only possible completions
# ALL have ignored-suffixes, in which case just return them all.

View File

@ -34,7 +34,8 @@ def current_working_dir(window):
def path_dirname(window):
if hasattr(window.buffer, 'path'):
return util.normal_path(window.buffer.path) + '/'
path = os.path.dirname(window.buffer.path)
return util.normal_path(path) + '/'
else:
return current_working_dir(window)

View File

@ -1,7 +1,7 @@
import os, pwd, regex
def normal_path(path):
path = os.path.realpath(window.buffer.path)
path = os.path.realpath(path)
home = os.getenv('HOME')
if path.startswith(home):
path = path.replace(home, '~', 1)