parent
abafebd389
commit
3947460779
|
@ -131,7 +131,11 @@ class ToggleTabs(Method):
|
||||||
class Pwd(Method):
|
class Pwd(Method):
|
||||||
'''Print the buffer's current working directory'''
|
'''Print the buffer's current working directory'''
|
||||||
def _execute(self, w, **vargs):
|
def _execute(self, w, **vargs):
|
||||||
cwd = os.path.dirname(w.buffer.path) + '/'
|
home = os.getenv('HOME')
|
||||||
if cwd.startswith(os.getenv('HOME')):
|
if hasattr(w.buffer, 'path'):
|
||||||
cwd = cwd.replace(os.getenv('HOME'), '~')
|
cwd = os.path.dirname(w.buffer.path) + '/'
|
||||||
w.set_error("Directory %s" % cwd)
|
if cwd.startswith(home):
|
||||||
|
cwd = cwd.replace(home, '~')
|
||||||
|
w.set_error("Directory %s" % cwd)
|
||||||
|
else:
|
||||||
|
w.set_error("Directory %s/" % os.getcwd())
|
||||||
|
|
Loading…
Reference in New Issue