parent
6fccb54b16
commit
3d33459c2d
43
default.py
43
default.py
|
@ -2,42 +2,39 @@ import os
|
|||
import util
|
||||
|
||||
# default callbacks
|
||||
def none(window):
|
||||
def none(w):
|
||||
return None
|
||||
|
||||
def last_buffer(window):
|
||||
bl = window.application.bufferlist
|
||||
def last_buffer(w):
|
||||
bl = w.application.bufferlist
|
||||
if bl.hidden_buffers:
|
||||
return bl.hidden_buffers[0].name()
|
||||
else:
|
||||
return ''
|
||||
|
||||
def current_buffer(window):
|
||||
return window.buffer.name()
|
||||
def current_buffer(w):
|
||||
return w.buffer.name()
|
||||
|
||||
def last_replace_before(window):
|
||||
return None #XYZ
|
||||
if window.application.last_replace_before:
|
||||
return window.application.last_replace_before
|
||||
else:
|
||||
return None
|
||||
def last_replace_before(w):
|
||||
a = w.application
|
||||
if a.config.get('use_last_replace') and a.last_replace_before:
|
||||
return a.last_replace_before
|
||||
return None
|
||||
def last_replace_after(w):
|
||||
a = w.application
|
||||
if a.config.get('use_last_replace') and a.last_replace_after:
|
||||
return w.application.last_replace_after
|
||||
return None
|
||||
|
||||
def last_replace_after(window):
|
||||
return None #XYZ
|
||||
if window.application.last_replace_after:
|
||||
return window.application.last_replace_after
|
||||
else:
|
||||
return None
|
||||
|
||||
def current_working_dir(window):
|
||||
def current_working_dir(w):
|
||||
return util.normal_path(os.getcwd())
|
||||
|
||||
def path_dirname(window):
|
||||
if hasattr(window.buffer, 'path'):
|
||||
path = os.path.dirname(window.buffer.path)
|
||||
def path_dirname(w):
|
||||
if hasattr(w.buffer, 'path'):
|
||||
path = os.path.dirname(w.buffer.path)
|
||||
return util.normal_path(path) + '/'
|
||||
else:
|
||||
return current_working_dir(window)
|
||||
return current_working_dir(w)
|
||||
|
||||
# default callback builders
|
||||
def build_constant(c):
|
||||
|
|
Loading…
Reference in New Issue