Add API vim_replace_termcodes

- Add API function to call replace_termcodes
This commit is contained in:
Rui Abreu Ferreira
2014-07-08 15:16:30 +01:00
committed by Thiago de Arruda
parent 1dea4044e7
commit 2875ad865b

View File

@@ -84,6 +84,24 @@ void vim_feedkeys(String keys, String mode)
typebuf_was_filled = true;
}
/// Replace any terminal codes with the internal representation
///
/// @see replace_termcodes
/// @see cpoptions
String vim_replace_termcodes(String str, Boolean from_part, Boolean do_lt,
Boolean special)
{
if (str.size == 0) {
// Empty string
return str;
}
char *ptr = NULL;
replace_termcodes((char_u *)str.data, (char_u **)&ptr,
from_part, do_lt, special);
return cstr_as_string(ptr);
}
/// Evaluates the expression str using the vim internal expression
/// evaluator (see |expression|).
/// Dictionaries and lists are recursively expanded.