diff --git a/pythonx/UltiSnips/_vim.py b/pythonx/UltiSnips/_vim.py old mode 100644 new mode 100755 index 1b0f752..6cd45e6 --- a/pythonx/UltiSnips/_vim.py +++ b/pythonx/UltiSnips/_vim.py @@ -124,6 +124,14 @@ def eval(text): return rv +def bindeval(text): + """Wraps vim.bindeval.""" + rv = vim.bindeval(as_vimencoding(text)) + if not isinstance(rv, (dict, list)): + return as_unicode(rv) + return rv + + def feedkeys(keys, mode='n'): """Wrapper around vim's feedkeys function. @@ -242,7 +250,7 @@ def _unmap_select_mode_mapping(): '| redir END') # Check if any mappings where found - all_maps = list(filter(len, eval(r"_tmp_smaps").splitlines())) + all_maps = list(filter(len, bindeval(r"_tmp_smaps").splitlines())) if len(all_maps) == 1 and all_maps[0][0] not in ' sv': # "No maps found". String could be localized. Hopefully # it doesn't start with any of these letters in any