mirror of
https://github.com/powerline/powerline.git
synced 2025-07-28 08:14:41 +02:00
Do not use second argument to itertools.count
This commit is contained in:
parent
5e93d20fb8
commit
4449489e59
@ -20,16 +20,16 @@ def getconfigargspec(obj):
|
|||||||
# Note: on <python-2.6 it may return simple tuple, not
|
# Note: on <python-2.6 it may return simple tuple, not
|
||||||
# ArgSpec instance.
|
# ArgSpec instance.
|
||||||
argspec = getargspec(getattr(obj, method))
|
argspec = getargspec(getattr(obj, method))
|
||||||
for i, arg in zip(count(-1, -1), reversed(argspec.args)):
|
for i, arg in zip(count(1), reversed(argspec.args)):
|
||||||
if (arg == 'self' or
|
if (arg == 'self' or
|
||||||
(arg == 'segment_info' and
|
(arg == 'segment_info' and
|
||||||
getattr(obj, 'powerline_requires_segment_info', None)) or
|
getattr(obj, 'powerline_requires_segment_info', None)) or
|
||||||
(arg == 'pl') or
|
(arg == 'pl') or
|
||||||
(method.startswith('render') and (1 if argspec.args[0] == 'self' else 0) - i == len(argspec.args)) or
|
(method.startswith('render') and (1 if argspec.args[0] == 'self' else 0) + i == len(argspec.args)) or
|
||||||
arg in args):
|
arg in args):
|
||||||
continue
|
continue
|
||||||
if argspec.defaults and len(argspec.defaults) >= -i:
|
if argspec.defaults and len(argspec.defaults) >= i:
|
||||||
default = argspec.defaults[i]
|
default = argspec.defaults[-i]
|
||||||
defaults.append(default)
|
defaults.append(default)
|
||||||
args.append(arg)
|
args.append(arg)
|
||||||
else:
|
else:
|
||||||
|
@ -274,6 +274,7 @@ def col_current(pl, segment_info):
|
|||||||
return str(segment_info['window'].cursor[1] + 1)
|
return str(segment_info['window'].cursor[1] + 1)
|
||||||
|
|
||||||
|
|
||||||
|
# TODO Add &textwidth-based gradient
|
||||||
@window_cached
|
@window_cached
|
||||||
def virtcol_current(pl):
|
def virtcol_current(pl):
|
||||||
'''Return current visual column with concealed characters ingored
|
'''Return current visual column with concealed characters ingored
|
||||||
|
Loading…
x
Reference in New Issue
Block a user