Created
November 29, 2019 16:49
-
-
Save bstaletic/2ff17d054041b0da8816501112835e7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/python/ycm/signature_help.py b/python/ycm/signature_help.py | |
index 90b1d225..0e23575d 100644 | |
--- a/python/ycm/signature_help.py | |
+++ b/python/ycm/signature_help.py | |
@@ -20,6 +20,8 @@ import json | |
from ycm import vimsupport | |
from ycm.vimsupport import GetIntValue | |
+SIGNATURE_SUPPORTED = None | |
+ | |
class SignatureHelpState( object ): | |
ACTIVE = 'ACTIVE' | |
@@ -78,8 +80,11 @@ def _MakeSignatureHelpBuffer( signature_info ): | |
def ShouldUseSignatureHelp(): | |
- return ( vimsupport.VimHasFunctions( 'screenpos', 'pum_getpos' ) and | |
- vimsupport.VimSupportsPopupWindows() ) | |
+ global SIGNATURE_SUPPORTED | |
+ if SIGNATURE_SUPPORTED is None: | |
+ SIGNATURE_SUPPORTED = vimsupport.VimHasFunctions( | |
+ 'screenpos', 'pum_getpos' ) and vimsupport.VimSupportsPopupWindows() | |
+ return SIGNATURE_SUPPORTED | |
def UpdateSignatureHelp( state, signature_info ): # noqa | |
diff --git a/python/ycm/vimsupport.py b/python/ycm/vimsupport.py | |
index d129680e..a7aeefc5 100644 | |
--- a/python/ycm/vimsupport.py | |
+++ b/python/ycm/vimsupport.py | |
@@ -28,6 +28,7 @@ from ycmd.utils import ( ByteOffsetToCodepointOffset, | |
ToBytes, | |
ToUnicode ) | |
+POPUP_SUPPORTED = None | |
BUFFER_COMMAND_MAP = { 'same-buffer' : 'edit', | |
'split' : 'split', | |
# These commands are obsolete. :vertical or :tab should | |
@@ -1251,14 +1252,17 @@ def AutoCloseOnCurrentBuffer( name ): | |
def VimSupportsPopupWindows(): | |
- return VimHasFunctions( 'popup_create', | |
- 'popup_move', | |
- 'popup_hide', | |
- 'popup_settext', | |
- 'popup_show', | |
- 'popup_close', | |
- 'prop_add', | |
- 'prop_type_add' ) | |
+ global POPUP_SUPPORTED | |
+ if POPUP_SUPPORTED is None: | |
+ POPUP_SUPPORTED = VimHasFunctions( 'popup_create', | |
+ 'popup_move', | |
+ 'popup_hide', | |
+ 'popup_settext', | |
+ 'popup_show', | |
+ 'popup_close', | |
+ 'prop_add', | |
+ 'prop_type_add' ) | |
+ return POPUP_SUPPORTED | |
def VimHasFunctions( *functions ): |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment