diff options
| author | Rui Abreu Ferreira <raf-ep@gmx.com> | 2014-07-08 15:16:30 +0100 |
|---|---|---|
| committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-08-07 12:03:27 -0300 |
| commit | 2875ad865b5c48103642a65728d984ceee75ed65 (patch) | |
| tree | 06c30e6459f2b874a98a0147c41cad4804d59fd6 /src/nvim/api/vim.c | |
| parent | 1dea4044e7582611072f5b7c93989e37ebb6ded6 (diff) | |
| download | rneovim-2875ad865b5c48103642a65728d984ceee75ed65.tar.gz rneovim-2875ad865b5c48103642a65728d984ceee75ed65.tar.bz2 rneovim-2875ad865b5c48103642a65728d984ceee75ed65.zip | |
Add API vim_replace_termcodes
- Add API function to call replace_termcodes
Diffstat (limited to 'src/nvim/api/vim.c')
| -rw-r--r-- | src/nvim/api/vim.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index a325459887..a2c50b4c81 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -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. |
