mirror of
https://github.com/powerline/powerline.git
synced 2025-04-08 19:25:04 +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
|
||||
# ArgSpec instance.
|
||||
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
|
||||
(arg == 'segment_info' and
|
||||
getattr(obj, 'powerline_requires_segment_info', None)) 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):
|
||||
continue
|
||||
if argspec.defaults and len(argspec.defaults) >= -i:
|
||||
default = argspec.defaults[i]
|
||||
if argspec.defaults and len(argspec.defaults) >= i:
|
||||
default = argspec.defaults[-i]
|
||||
defaults.append(default)
|
||||
args.append(arg)
|
||||
else:
|
||||
|
@ -274,6 +274,7 @@ def col_current(pl, segment_info):
|
||||
return str(segment_info['window'].cursor[1] + 1)
|
||||
|
||||
|
||||
# TODO Add &textwidth-based gradient
|
||||
@window_cached
|
||||
def virtcol_current(pl):
|
||||
'''Return current visual column with concealed characters ingored
|
||||
|
Loading…
x
Reference in New Issue
Block a user