From 65bca8b56a8282cf767a661f8d7c894046df9c2c Mon Sep 17 00:00:00 2001 From: svermeulen Date: Mon, 12 Aug 2013 16:11:19 -0300 Subject: [PATCH 1/2] Added option to control whether YCM should auto-stop the omnisharp server upon leaving Vim or leave it running. --- plugin/youcompleteme.vim | 3 +++ python/ycm/completers/cs/cs_completer.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/youcompleteme.vim b/plugin/youcompleteme.vim index 5cbfa5f7..d3c2ee3e 100644 --- a/plugin/youcompleteme.vim +++ b/plugin/youcompleteme.vim @@ -154,6 +154,9 @@ let g:ycm_cache_omnifunc = let g:ycm_auto_start_csharp_server = \ get( g:, 'ycm_auto_start_csharp_server', 1 ) +let g:ycm_auto_stop_csharp_server = + \ get( g:, 'ycm_auto_stop_csharp_server', 1 ) + let g:ycm_csharp_server_port = \ get( g:, 'ycm_csharp_server_port', 2000 ) diff --git a/python/ycm/completers/cs/cs_completer.py b/python/ycm/completers/cs/cs_completer.py index f6ef8a1a..71a159c0 100755 --- a/python/ycm/completers/cs/cs_completer.py +++ b/python/ycm/completers/cs/cs_completer.py @@ -50,7 +50,7 @@ class CsharpCompleter( ThreadedCompleter ): def OnVimLeave( self ): - if self._ServerIsRunning(): + if vimsupport.GetBoolValue( 'g:ycm_auto_stop_csharp_server' ) and self._ServerIsRunning(): self._StopServer() From f58a3e126d4c8ba64f93ee5a89e992a04cd4e31b Mon Sep 17 00:00:00 2001 From: svermeulen Date: Mon, 12 Aug 2013 21:57:43 -0300 Subject: [PATCH 2/2] Added new flag (g:ycm_auto_stop_csharp_server) to docs. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 70d474fc..f423b336 100644 --- a/README.md +++ b/README.md @@ -849,6 +849,15 @@ Default: `1` let g:ycm_auto_start_csharp_server = 1 +### The `g:ycm_auto_stop_csharp_server` option + +When set to `1`, the OmniSharp server will be automatically stopped upon +closing vim. + +Default: `1` + + let g:ycm_auto_stop_csharp_server = 1 + ### The `g:ycm_add_preview_to_completeopt` option When this option is set to `1`, YCM will add the `preview` string to Vim's