To: vim-dev@vim.org Subject: Patch 5.7.005 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.7.005 Problem: Multibyte: Inserting a wrapped line corrupts kterm screen. Pasting TEXT/COMPOUND_TEXT into Vim does not work. On Motif no XIM status line is displayed even though it is available. Solution: Don't use xterm trick for wrapping lines for multibyte mode. Correct a missing "break", added TEXT/COMPOUND_TEXT selection request. Add XIMStatusArea fallback code. (Katsuhito Nagano) Files: src/gui_gtk_x11.c, src/multbyte.c, src/screen.c, src/ui.c *** ../vim-5.7.4/src/gui_gtk_x11.c Sat Aug 5 14:26:52 2000 --- src/gui_gtk_x11.c Sat Aug 5 14:22:57 2000 *************** *** 1444,1452 **** #define VIM_ATOM_NAME "_VIM_TEXT" static const GtkTargetEntry primary_targets[] = { {VIM_ATOM_NAME, 0, SELECTION_CLIPBOARD}, ! {"STRING", 0, SELECTION_STRING}, {"TEXT", 0, SELECTION_TEXT}, ! {"COMPOUND_TEXT", 0, SELECTION_COMPOUND_TEXT} }; /* --- 1444,1452 ---- #define VIM_ATOM_NAME "_VIM_TEXT" static const GtkTargetEntry primary_targets[] = { {VIM_ATOM_NAME, 0, SELECTION_CLIPBOARD}, ! {"COMPOUND_TEXT", 0, SELECTION_COMPOUND_TEXT}, {"TEXT", 0, SELECTION_TEXT}, ! {"STRING", 0, SELECTION_STRING} }; /* *************** *** 3130,3135 **** --- 3130,3155 ---- gtk_main(); /* wait for selection_received_event */ if (received_selection == RS_FAIL) + { + /* Now try to get it out of the usual string selection. */ + received_selection = RS_NONE; + (void)gtk_selection_convert(gui.drawarea, GDK_SELECTION_PRIMARY, + gdk_atom_intern("COMPOUND_TEXT", FALSE), + (guint32)GDK_CURRENT_TIME); + while (received_selection == RS_NONE) + gtk_main(); /* wait for selection_received_event */ + } + if (received_selection == RS_FAIL) + { + /* Now try to get it out of the usual string selection. */ + received_selection = RS_NONE; + (void)gtk_selection_convert(gui.drawarea, GDK_SELECTION_PRIMARY, + gdk_atom_intern("TEXT", FALSE), + (guint32)GDK_CURRENT_TIME); + while (received_selection == RS_NONE) + gtk_main(); /* wait for selection_received_event */ + } + if (received_selection == RS_FAIL) { /* Now try to get it out of the usual string selection. */ received_selection = RS_NONE; *** ../vim-5.7.4/src/multbyte.c Wed Jun 7 12:29:37 2000 --- src/multbyte.c Sat Aug 5 14:22:57 2000 *************** *** 520,526 **** } #if defined(USE_GUI_X11) || defined(PROTO) ! # if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 # define USE_X11R6_XIM # endif --- 520,526 ---- } #if defined(USE_GUI_X11) || defined(PROTO) ! # if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(sun) # define USE_X11R6_XIM # endif *************** *** 724,737 **** found = True; break; } ! if ((xim_styles->supported_styles[i] & this_input_style) ! == (this_input_style & ~XIMStatusArea)) { ! this_input_style &= ~XIMStatusArea; ! found = True; ! break; } - } s = ns; } --- 724,741 ---- found = True; break; } ! } ! if (!found) ! for (i = 0; (unsigned short)i < xim_styles->count_styles; i++) { ! if ((xim_styles->supported_styles[i] & this_input_style) ! == (this_input_style & ~XIMStatusArea)) ! { ! this_input_style &= ~XIMStatusArea; ! found = True; ! break; ! } } s = ns; } *** ../vim-5.7.4/src/screen.c Wed Jun 7 14:43:59 2000 --- src/screen.c Sat Aug 5 14:22:57 2000 *************** *** 1746,1751 **** --- 1746,1754 ---- #ifdef USE_GUI && !gui.in_use #endif + #ifdef MULTI_BYTE + && !is_dbcs + #endif ) { if (screen_cur_col != Columns) *** ../vim-5.7.4/src/ui.c Sat Jun 3 11:37:13 2000 --- src/ui.c Sat Aug 5 14:22:57 2000 *************** *** 1523,1531 **** { switch (i) { ! case 0: type = clipboard.xatom; ! case 1: type = clipboard.xa_compound_text; ! case 2: type = clipboard.xa_text; default: type = XA_STRING; } XtGetSelectionValue(myShell, XA_PRIMARY, type, --- 1523,1531 ---- { switch (i) { ! case 0: type = clipboard.xatom; break; ! case 1: type = clipboard.xa_compound_text; break; ! case 2: type = clipboard.xa_text; break; default: type = XA_STRING; } XtGetSelectionValue(myShell, XA_PRIMARY, type, *** ../vim-5.7.4/src/version.c Sat Aug 5 14:27:00 2000 --- src/version.c Sat Aug 5 14:36:42 2000 *************** *** 439,440 **** --- 439,442 ---- { /* Add new patch number below this line */ + /**/ + 5, /**/ -- hundred-and-one symptoms of being an internet addict: 125. You begin to wonder how often it REALLY is necessary to get up and shower or bathe. /// Bram Moolenaar Bram@moolenaar.net http://www.moolenaar.net \\\ \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///