From 7c34a3400b530b4159d96123db92af42901a4fb8 Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Sat, 22 Mar 2014 19:53:01 +0100 Subject: [PATCH] Escape \ when asking for snippets. Fixes #176. --- pythonx/UltiSnips/snippet_manager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pythonx/UltiSnips/snippet_manager.py b/pythonx/UltiSnips/snippet_manager.py index a71a40e..9217c35 100644 --- a/pythonx/UltiSnips/snippet_manager.py +++ b/pythonx/UltiSnips/snippet_manager.py @@ -16,6 +16,7 @@ from UltiSnips.position import Position from UltiSnips.snippet.definition import UltiSnipsSnippetDefinition from UltiSnips.snippet.source import UltiSnipsFileSource, SnipMateFileSource, \ find_all_snippet_files, find_snippet_files, AddedSnippetsSource +from UltiSnips.text import escape from UltiSnips.vim_state import VimState, VisualContentPreserver def _ask_user(a, formatted): @@ -40,7 +41,7 @@ def _ask_snippets(snippets): """ Given a list of snippets, ask the user which one they want to use, and return it. """ - display = [as_unicode("%i: %s") % (i+1, s.description) for + display = [as_unicode("%i: %s") % (i+1, escape(s.description, '\\')) for i, s in enumerate(snippets)] return _ask_user(snippets, display)