Minor refactoring & style cleanup
This commit is contained in:
parent
48281d1379
commit
2b23245422
@ -600,6 +600,7 @@ function! s:CompleterCommand(...)
|
||||
py completer.OnUserCommand( vim.eval( 'l:arguments' ) )
|
||||
endfunction
|
||||
|
||||
|
||||
function! youcompleteme#OpenGoToList()
|
||||
set lazyredraw
|
||||
cclose
|
||||
@ -609,14 +610,17 @@ function! youcompleteme#OpenGoToList()
|
||||
redraw!
|
||||
endfunction
|
||||
|
||||
|
||||
command! -nargs=* -complete=custom,youcompleteme#SubCommandsComplete
|
||||
\ YcmCompleter call s:CompleterCommand(<f-args>)
|
||||
|
||||
|
||||
function! youcompleteme#SubCommandsComplete( arglead, cmdline, cursorpos )
|
||||
return join( pyeval( 'ycm_state.GetFiletypeCompleter().DefinedSubcommands()' ),
|
||||
\ "\n")
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:ForceCompile()
|
||||
if !pyeval( 'ycm_state.NativeFiletypeCompletionUsable()' )
|
||||
echom "Native filetype completion not supported for current file, "
|
||||
|
@ -180,13 +180,15 @@ class Completer( object ):
|
||||
return []
|
||||
|
||||
|
||||
def UserCommandsHelpMessage( self ):
|
||||
if self.DefinedSubcommands():
|
||||
vimsupport.EchoText( "Supported commands are:\n" +
|
||||
'\n'.join( self.DefinedSubcommands() )+
|
||||
"\nSee the docs for information on what they do." )
|
||||
def EchoUserCommandsHelpMessage( self ):
|
||||
subcommands = self.DefinedSubcommands()
|
||||
if subcommands:
|
||||
vimsupport.EchoText( 'Supported commands are:\n' +
|
||||
'\n'.join( subcommands ) +
|
||||
'\nSee the docs for information on what they do.' )
|
||||
else:
|
||||
vimsupport.EchoText( "No supported subcommands" )
|
||||
vimsupport.EchoText( 'No supported subcommands' )
|
||||
|
||||
|
||||
def FilterAndSortCandidates( self, candidates, query ):
|
||||
if not candidates:
|
||||
|
@ -132,7 +132,8 @@ class ClangCompleter( Completer ):
|
||||
|
||||
def OnUserCommand( self, arguments ):
|
||||
if not arguments:
|
||||
return self.UserCommandsHelpMessage()
|
||||
self.EchoUserCommandsHelpMessage()
|
||||
return
|
||||
|
||||
command = arguments[ 0 ]
|
||||
if command == 'GoToDefinition':
|
||||
|
@ -81,7 +81,8 @@ class JediCompleter( ThreadedCompleter ):
|
||||
|
||||
def OnUserCommand( self, arguments ):
|
||||
if not arguments:
|
||||
return self.UserCommandsHelpMessage()
|
||||
self.EchoUserCommandsHelpMessage()
|
||||
return
|
||||
|
||||
command = arguments[ 0 ]
|
||||
if command == 'GoToDefinition':
|
||||
|
Loading…
Reference in New Issue
Block a user