Browse Source

Use execute() rather than redir to avoid clearing the splash screen on startup

Ben Jackson 1 year ago
parent
commit
f8af00f84c
1 changed files with 1 additions and 6 deletions
  1. 1 6
      python/ycm/vimsupport.py

+ 1 - 6
python/ycm/vimsupport.py

@@ -256,12 +256,7 @@ def VisibleRangeOfBufferOverlaps( bufnr, expanded_range ):
 
 
 def CaptureVimCommand( command ):
-  vim.command( 'redir => b:ycm_command' )
-  vim.command( f'silent! { command }' )
-  vim.command( 'redir END' )
-  output = ToUnicode( vim.eval( 'b:ycm_command' ) )
-  vim.command( 'unlet b:ycm_command' )
-  return output
+  return vim.eval( f"execute( '{EscapeForVim(command)}', 'silent!' )" )
 
 
 def GetSignsInBuffer( buffer_number ):