parent
1bc1b24170
commit
d0a22e4909
|
@ -34,6 +34,10 @@ def current_working_dir(window):
|
|||
cwd += '/'
|
||||
return cwd
|
||||
|
||||
def path_dirname(window):
|
||||
if hasattr(window.buffer, 'path'):
|
||||
return os.path.dirname(window.buffer.path) + '/'
|
||||
|
||||
# default callback builders
|
||||
def build_constant(c):
|
||||
return lambda w: c
|
||||
|
|
|
@ -197,7 +197,8 @@ class RegexReplace(Method):
|
|||
# navigating between buffers
|
||||
class OpenFile(Method):
|
||||
'''Open file in a new buffer, or go to file's open buffer'''
|
||||
args = [Argument('filename', datatype="path", prompt="Open File: ")]
|
||||
args = [Argument('filename', datatype="path", prompt="Open File: ",
|
||||
default=default.path_dirname, load_default=True)]
|
||||
def _execute(self, w, **vargs):
|
||||
b = w.application.open_path(vargs['filename'])
|
||||
SwitchBuffer().execute(w, buffername=b.name())
|
||||
|
|
Loading…
Reference in New Issue