Use YCM python style
This commit is contained in:
parent
a56bee7b0a
commit
8052484cc7
14 changed files with 82 additions and 49 deletions
|
|
@ -112,7 +112,7 @@ class DebugSession( object ):
|
|||
else:
|
||||
configuration_name = utils.SelectFromList(
|
||||
'Which launch configuration?',
|
||||
sorted( list( configurations.keys() ) ) )
|
||||
sorted( configurations.keys() ) )
|
||||
|
||||
if not configuration_name or configuration_name not in configurations:
|
||||
return
|
||||
|
|
@ -259,13 +259,13 @@ class DebugSession( object ):
|
|||
def IfConnected( fct ):
|
||||
"""Decorator, call fct if self._connected else echo warning"""
|
||||
@functools.wraps( fct )
|
||||
def wrapper(self, *args, **kwargs):
|
||||
def wrapper( self, *args, **kwargs ):
|
||||
if not self._connection:
|
||||
utils.UserMessage(
|
||||
'Vimspector not connected, start a debug session first',
|
||||
persist=True, error=True )
|
||||
return
|
||||
return fct(self, *args, **kwargs)
|
||||
return fct( self, *args, **kwargs )
|
||||
return wrapper
|
||||
|
||||
def OnChannelData( self, data ):
|
||||
|
|
|
|||
|
|
@ -210,4 +210,4 @@ class OutputView( object ):
|
|||
'*' if tab_buffer.flag else '' ) )
|
||||
|
||||
def GetCategories( self ):
|
||||
return [ category for category in self._buffers.keys() ]
|
||||
return list( self._buffers.keys() )
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ def Escape( msg ):
|
|||
return msg.replace( "'", "''" )
|
||||
|
||||
|
||||
def UserMessage( msg, persist=False, error=False):
|
||||
def UserMessage( msg, persist=False, error=False ):
|
||||
if persist:
|
||||
_logger.warning( 'User Msg: ' + msg )
|
||||
else:
|
||||
|
|
@ -242,11 +242,11 @@ def UserMessage( msg, persist=False, error=False):
|
|||
vim.command( 'redraw' )
|
||||
try:
|
||||
if error:
|
||||
vim.command("echohl WarningMsg")
|
||||
vim.command( "echohl WarningMsg" )
|
||||
for line in msg.split( '\n' ):
|
||||
vim.command( "{0} '{1}'".format( cmd, Escape( line ) ) )
|
||||
finally:
|
||||
vim.command('echohl None') if error else None
|
||||
vim.command( 'echohl None' ) if error else None
|
||||
vim.command( 'redraw' )
|
||||
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ def SetBufferContents( buf, lines, modified=False ):
|
|||
if not isinstance( lines, list ):
|
||||
lines = lines.splitlines()
|
||||
|
||||
buf[:] = lines
|
||||
buf[ : ] = lines
|
||||
finally:
|
||||
buf.options[ 'modified' ] = modified
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ def ExpandReferencesInObject( obj, mapping, user_choices ):
|
|||
return obj
|
||||
|
||||
|
||||
def ExpandReferencesInString( orig_s, mapping, user_choices):
|
||||
def ExpandReferencesInString( orig_s, mapping, user_choices ):
|
||||
s = os.path.expanduser( orig_s )
|
||||
s = os.path.expandvars( s )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue