aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2014-10-18 13:57:58 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2014-10-18 13:57:58 -0300
commitfb34028c1e2274d668eb7d7912ada2b163898520 (patch)
tree5f2a1dd7395461be1bc6df7aa259fa8dd63008d3 /src/nvim/mbyte.c
parent56ef9e86688e79dc6a6bffe73c505eaaddf3be2d (diff)
parent42112e04a999c0f289939fce3142ef2c2517110a (diff)
downloadrneovim-fb34028c1e2274d668eb7d7912ada2b163898520.tar.gz
rneovim-fb34028c1e2274d668eb7d7912ada2b163898520.tar.bz2
rneovim-fb34028c1e2274d668eb7d7912ada2b163898520.zip
Merge PR #1300 'Refactor input buffer'
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index 7ba4409180..cb33c2e666 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -3803,50 +3803,6 @@ int convert_setup_ext(vimconv_T *vcp, char_u *from, bool from_unicode_is_utf8,
return OK;
}
-#if defined(FEAT_GUI) || defined(WIN3264) || defined(PROTO)
-/*
- * Do conversion on typed input characters in-place.
- * The input and output are not NUL terminated!
- * Returns the length after conversion.
- */
-int convert_input(char_u *ptr, int len, int maxlen)
-{
- return convert_input_safe(ptr, len, maxlen, NULL, NULL);
-}
-#endif
-
-/*
- * Like convert_input(), but when there is an incomplete byte sequence at the
- * end return that as an allocated string in "restp" and set "*restlenp" to
- * the length. If "restp" is NULL it is not used.
- */
-int convert_input_safe(char_u *ptr, int len, int maxlen, char_u **restp,
- int *restlenp)
-{
- char_u *d;
- int dlen = len;
- int unconvertlen = 0;
-
- d = string_convert_ext(&input_conv, ptr, &dlen,
- restp == NULL ? NULL : &unconvertlen);
- if (d != NULL) {
- if (dlen <= maxlen) {
- if (unconvertlen > 0) {
- /* Move the unconverted characters to allocated memory. */
- *restp = xmalloc(unconvertlen);
- memmove(*restp, ptr + len - unconvertlen, unconvertlen);
- *restlenp = unconvertlen;
- }
- memmove(ptr, d, dlen);
- } else
- /* result is too long, keep the unconverted text (the caller must
- * have done something wrong!) */
- dlen = len;
- free(d);
- }
- return dlen;
-}
-
/*
* Convert text "ptr[*lenp]" according to "vcp".
* Returns the result in allocated memory and sets "*lenp".