Use ANSI C escapes rather than python string literals

This commit is contained in:
Kovid Goyal
2022-11-25 19:10:15 +05:30
parent ac60715ee2
commit 402c8b6803
4 changed files with 8 additions and 7 deletions

View File

@@ -67,7 +67,7 @@ def shlex_parse(func: str, rest: str) -> FuncArgsType:
def parse_send_text_bytes(text: str) -> bytes:
return python_string(text).encode('utf-8')
return defines.expand_ansi_c_escapes(text).encode('utf-8')
@func_with_args('send_text')
@@ -204,7 +204,7 @@ def paste_from_buffer(func: str, rest: str) -> FuncArgsType:
def paste_parse(func: str, rest: str) -> FuncArgsType:
text = ''
try:
text = python_string(rest)
text = defines.expand_ansi_c_escapes(rest)
except Exception:
log_error('Ignoring invalid paste string: ' + rest)
return func, [text]