diff --git a/plugin/core/popups.py b/plugin/core/popups.py index 2ea2c55cb..2c623124e 100644 --- a/plugin/core/popups.py +++ b/plugin/core/popups.py @@ -14,10 +14,3 @@ font-family: system; } ''' - - -def preserve_whitespace(contents: str) -> str: - """Preserve indentation in (non-markdown) ascii docstrings (e.g. pyls)""" - contents = contents.replace('\t', '\u00A0' * 4) - contents = contents.replace(' ', '\u00A0' * 2) - return contents diff --git a/plugin/hover.py b/plugin/hover.py index 77d5d7bb2..5991e509a 100644 --- a/plugin/hover.py +++ b/plugin/hover.py @@ -8,7 +8,7 @@ from .core.protocol import Request from .core.documents import get_document_position from .core.logging import debug -from .core.popups import preserve_whitespace, popup_css, popup_class +from .core.popups import popup_css, popup_class SUBLIME_WORD_MASK = 515 NO_HOVER_SCOPES = 'comment, constant, keyword, storage, string' @@ -95,7 +95,7 @@ def show_hover(self, point, contents): if language: formatted.append("```{}\n{}\n```\n".format(language, value)) else: - formatted.append(preserve_whitespace(value)) + formatted.append(value) mdpopups.show_popup( self.view, diff --git a/plugin/signature_help.py b/plugin/signature_help.py index 98d61628f..d00b3cae5 100644 --- a/plugin/signature_help.py +++ b/plugin/signature_help.py @@ -14,7 +14,7 @@ from .core.configurations import is_supported_syntax, config_for_scope from .core.protocol import Request from .core.logging import debug -from .core.popups import preserve_whitespace, popup_css, popup_class +from .core.popups import popup_css, popup_class class SignatureHelpListener(sublime_plugin.ViewEventListener): @@ -147,4 +147,4 @@ def _build_popup_content(self) -> str: sigDocs = signature.get('documentation', None) if sigDocs: formatted.append(sigDocs) - return preserve_whitespace("\n".join(formatted)) + return "\n".join(formatted)