33import tempfile
44import re
55
6- import ropemode . decorators
7- import ropemode . environment
8- import ropemode . interface
6+ from pylibs . ropemode import decorators
7+ from pylibs . ropemode import environment
8+ from pylibs . ropemode import interface
99
1010import vim
1111
1212
13- class VimUtils (ropemode . environment .Environment ):
13+ class VimUtils (environment .Environment ):
1414
1515 def __init__ (self , * args , ** kwargs ):
1616 super (VimUtils , self ).__init__ (* args , ** kwargs )
@@ -62,10 +62,10 @@ def _update_proposals(self, values):
6262
6363 if not self .get ('extended_complete' ):
6464 return u',' .join (u"'%s'" % self ._completion_text (proposal )
65- for proposal in values )
65+ for proposal in values )
6666
6767 return u',' .join (self ._extended_completion (proposal )
68- for proposal in values )
68+ for proposal in values )
6969
7070 def _command (self , command , encode = False ):
7171 if encode :
@@ -79,7 +79,7 @@ def ask_completion(self, prompt, values, starting=None):
7979 if starting :
8080 col -= len (starting )
8181 self ._command (u'call complete(%s, [%s])' % (col , proposals ),
82- encode = True )
82+ encode = True )
8383 return None
8484
8585 return self .ask_values (prompt , values , starting = starting ,
@@ -118,8 +118,8 @@ def _decode_line(self, line):
118118 return line .decode (self ._get_encoding ())
119119
120120 def _position_to_offset (self , lineno , colno ):
121- result = min (colno , len (self .buffer [lineno - 1 ]) + 1 )
122- for line in self .buffer [:lineno - 1 ]:
121+ result = min (colno , len (self .buffer [lineno - 1 ]) + 1 )
122+ for line in self .buffer [:lineno - 1 ]:
123123 line = self ._decode_line (line )
124124 result += len (line ) + 1
125125 return result
@@ -303,15 +303,17 @@ def _completion_data(self, proposal):
303303 return proposal
304304
305305 _docstring_re = re .compile ('^[\s\t \n ]*([^\n ]*)' )
306+
306307 def _extended_completion (self , proposal ):
307308 # we are using extended complete and return dicts instead of strings.
308309 # `ci` means "completion item". see `:help complete-items`
309310 word , _ , menu = map (lambda x : x .strip (), proposal .name .partition (':' ))
310311 ci = dict (
311- word = word ,
312- info = '' ,
313- kind = '' .join (s if s not in 'aeyuo' else '' for s in proposal .type )[:3 ],
314- menu = menu or '' )
312+ word = word ,
313+ info = '' ,
314+ kind = '' .join (
315+ s if s not in 'aeyuo' else '' for s in proposal .type )[:3 ],
316+ menu = menu or '' )
315317
316318 if proposal .scope == 'parameter_keyword' :
317319 default = proposal .get_default ()
@@ -388,18 +390,18 @@ def __call__(self, arg_lead, cmd_line, cursor_pos):
388390 # don't know if self.values can be empty but better safe then sorry
389391 if self .values :
390392 if not isinstance (self .values [0 ], basestring ):
391- result = [proposal .name for proposal in self .values \
393+ result = [proposal .name for proposal in self .values
392394 if proposal .name .startswith (arg_lead )]
393395 else :
394- result = [proposal for proposal in self .values \
396+ result = [proposal for proposal in self .values
395397 if proposal .startswith (arg_lead )]
396398 vim .command ('let s:completions = %s' % result )
397399
398400
399- ropemode . decorators .logger .message = echo
400- ropemode . decorators .logger .only_short = True
401+ decorators .logger .message = echo
402+ decorators .logger .only_short = True
401403
402404_completer = _ValueCompleter ()
403405
404406_env = VimUtils ()
405- _interface = ropemode . interface .RopeMode (env = _env )
407+ _interface = interface .RopeMode (env = _env )
0 commit comments