diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-03-04 22:52:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-03-04 22:52:34 +0100 |
commit | 179f1b9a7ddf3624daf6380c3dad740e0a1ba361 (patch) | |
tree | 3629363a7337081e627d6838913207ab0281cfd4 /src/ui.c | |
parent | 328da0dcb7be34b594725eef6dc98d3ea6516d69 (diff) | |
download | vim-git-179f1b9a7ddf3624daf6380c3dad740e0a1ba361.tar.gz |
patch 7.4.1488v7.4.1488
Problem: Not using key when result from hangul_string_convert() is NULL.
Solution: Fall back to not converted string.
Diffstat (limited to 'src/ui.c')
-rw-r--r-- | src/ui.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1686,24 +1686,24 @@ add_to_input_buf_csi(char_u *str, int len) push_raw_key(char_u *s, int len) { char_u *tmpbuf; + char_u *inp = s; + /* use the conversion result if possible */ tmpbuf = hangul_string_convert(s, &len); if (tmpbuf != NULL) - { - s = tmpbuf; + inp = tmpbuf; - for (; len--; s++) + for (; len--; inp++) + { + inbuf[inbufcount++] = *inp; + if (*inp == CSI) { - inbuf[inbufcount++] = *s; - if (*s == CSI) - { - /* Turn CSI into K_CSI. */ - inbuf[inbufcount++] = KS_EXTRA; - inbuf[inbufcount++] = (int)KE_CSI; - } + /* Turn CSI into K_CSI. */ + inbuf[inbufcount++] = KS_EXTRA; + inbuf[inbufcount++] = (int)KE_CSI; } - vim_free(tmpbuf); } + vim_free(tmpbuf); } #endif |