diff src/gui.c @ 7208:2c00f6b312bf v7.4.913

commit https://github.com/vim/vim/commit/72f4cc4a987d123c0ed909c85b9a05f65cef7202 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Nov 10 14:35:18 2015 +0100 patch 7.4.913 Problem: No utf-8 support for the hangul input feature. Solution: Add utf-8 support. (Namsh)
author Christian Brabandt <cb@256bit.org>
date Tue, 10 Nov 2015 14:45:04 +0100
parents 286fd54c7ae3
children 15eefe1b0dad
line wrap: on
line diff
--- a/src/gui.c
+++ b/src/gui.c
@@ -1223,8 +1223,19 @@ gui_update_cursor(force, clear_selection
 	    gui.highlight_mask = (cattr | attr);
 #ifdef FEAT_HANGULIN
 	    if (composing_hangul)
-		(void)gui_outstr_nowrap(composing_hangul_buffer, 2,
-			GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR, cfg, cbg, 0);
+	    {
+		char_u *comp_buf;
+		int comp_len;
+
+		comp_buf = hangul_composing_buffer_get(&comp_len);
+		if (comp_buf)
+		{
+		    (void)gui_outstr_nowrap(comp_buf, comp_len,
+					    GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR,
+					    cfg, cbg, 0);
+		    vim_free(comp_buf);
+		}
+	    }
 	    else
 #endif
 		(void)gui_screenchar(LineOffset[gui.row] + gui.col,
@@ -2572,9 +2583,19 @@ gui_undraw_cursor()
 #ifdef FEAT_HANGULIN
 	if (composing_hangul
 		    && gui.col == gui.cursor_col && gui.row == gui.cursor_row)
-	    (void)gui_outstr_nowrap(composing_hangul_buffer, 2,
-		    GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR,
-		    gui.norm_pixel, gui.back_pixel, 0);
+	{
+	    char_u *comp_buf;
+	    int comp_len;
+
+	    comp_buf = hangul_composing_buffer_get(&comp_len);
+	    if (comp_buf)
+	    {
+		(void)gui_outstr_nowrap(comp_buf, comp_len,
+					GUI_MON_IS_CURSOR | GUI_MON_NOCLEAR,
+					gui.norm_pixel, gui.back_pixel, 0);
+		vim_free(comp_buf);
+	    }
+	}
 	else
 	{
 #endif