diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-04-26 23:12:42 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-04-26 23:12:42 -0400 |
commit | ea483231c57d2acf6f4e17db82d33124526931f9 (patch) | |
tree | b26950291fbe3813b57db732cad9e152f6a6e1bc /src/nvim/api/vim.c | |
parent | e861af85f89e119193a9e219a4cb766757e28e5a (diff) | |
parent | 191fb638f415a0a1a05eb83a87d87fc9902d7ffe (diff) | |
download | rneovim-ea483231c57d2acf6f4e17db82d33124526931f9.tar.gz rneovim-ea483231c57d2acf6f4e17db82d33124526931f9.tar.bz2 rneovim-ea483231c57d2acf6f4e17db82d33124526931f9.zip |
Merge pull request #4593 from ZyX-I/length-functions
Make some function accept strings with length in place of just strings
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 243806b3f1..46ac3c9022 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -116,8 +116,14 @@ String vim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, } char *ptr = NULL; - replace_termcodes((char_u *)str.data, (char_u **)&ptr, - from_part, do_lt, special); + // Set 'cpoptions' the way we want it. + // FLAG_CPO_BSLASH set - backslashes are *not* treated specially + // FLAG_CPO_KEYCODE set - keycodes are *not* reverse-engineered + // FLAG_CPO_SPECI unset - <Key> sequences *are* interpreted + // The third from end parameter of replace_termcodes() is true so that the + // <lt> sequence is recognised - needed for a real backslash. + replace_termcodes((char_u *)str.data, str.size, (char_u **)&ptr, + from_part, do_lt, special, CPO_TO_CPO_FLAGS); return cstr_as_string(ptr); } |