From dc9a599bb494e30d77f01f3fba5ffe8f23299703 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 13:59:21 +0200 Subject: [PATCH 01/86] updated for version 7.3.261 Problem: G++ error message errornously recognized as error. Solution: Ignore "In file included from" line also when it ends in a colon. (Fernando Castillo) --- src/option.h | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/option.h b/src/option.h index c47b143c0f..434f9f378b 100644 --- a/src/option.h +++ b/src/option.h @@ -33,7 +33,7 @@ # ifdef EBCDIC #define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" # else -#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-Gfrom %f:%l:%c,%-Gfrom %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" +#define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-Gfrom %f:%l:%c,%-Gfrom %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m" # endif # endif # endif diff --git a/src/version.c b/src/version.c index a254af0e63..70be57a8a5 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 261, /**/ 260, /**/ From ef6d40a9c4587eaf026c41141489b89b03b8aca1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 13:59:21 +0200 Subject: [PATCH 02/86] Added tag v7-3-261 for changeset 410d42e3d4da --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 371cf98753..beed7d1eff 100644 --- a/.hgtags +++ b/.hgtags @@ -1595,3 +1595,4 @@ c296c225736e4489706c62c95752a0c4788be1d3 v7-3-256 bdc3335bd72eea207b28fcf8af90a73c855c8847 v7-3-258 59130cd78dfc73bd04f22d201b8f7c0772d98e79 v7-3-259 cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260 +410d42e3d4da09284394456186143d595e9b2efc v7-3-261 From a0aba21f7ad227929a7d7a50f9895980a1495f82 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 14:09:09 +0200 Subject: [PATCH 03/86] updated for version 7.3.262 Problem: Photon code style doesn't match Vim style. Solution: Clean up some of it. (Elias Diem) --- src/gui_photon.c | 206 +++++++++++++++++++++++------------------------ src/version.c | 2 + 2 files changed, 105 insertions(+), 103 deletions(-) diff --git a/src/gui_photon.c b/src/gui_photon.c index d9017989ab..4e51cab1b4 100644 --- a/src/gui_photon.c +++ b/src/gui_photon.c @@ -32,9 +32,9 @@ #endif #define ARRAY_LENGTH(a) (sizeof(a) / sizeof(a[0])) -#define RGB(r,g,b) PgRGB(r,g,b) +#define RGB(r, g, b) PgRGB(r, g, b) -#define EVENT_BUFFER_SIZE sizeof( PhEvent_t ) + 1000 +#define EVENT_BUFFER_SIZE sizeof(PhEvent_t) + 1000 /* Some defines for gui_mch_mousehide() */ #define MOUSE_HIDE TRUE @@ -206,53 +206,53 @@ static PtCallbackF_t gui_ph_handle_menu_resize; static PtCallbackF_t gui_ph_handle_menu_unrealized; #ifdef USE_PANEL_GROUP -static void gui_ph_get_panelgroup_margins( short*, short*, short*, short* ); +static void gui_ph_get_panelgroup_margins(short*, short*, short*, short*); #endif #ifdef FEAT_TOOLBAR -static PhImage_t *gui_ph_toolbar_find_icon( vimmenu_T *menu ); +static PhImage_t *gui_ph_toolbar_find_icon(vimmenu_T *menu); #endif -static void gui_ph_draw_start( void ); -static void gui_ph_draw_end( void ); +static void gui_ph_draw_start(void); +static void gui_ph_draw_end(void); /* Set the text for the balloon */ -static PtWidget_t * gui_ph_show_tooltip( PtWidget_t *window, +static PtWidget_t * gui_ph_show_tooltip(PtWidget_t *window, PtWidget_t *widget, int position, char *text, char *font, PgColor_t fill_color, - PgColor_t text_color ); + PgColor_t text_color); /****************************************************************************/ -static PtWidget_t * gui_ph_show_tooltip( PtWidget_t *window, +static PtWidget_t * gui_ph_show_tooltip(PtWidget_t *window, PtWidget_t *widget, int position, char *text, char *font, PgColor_t fill_color, - PgColor_t text_color ) + PgColor_t text_color) { PtArg_t arg; vimmenu_T *menu; char_u *tooltip; - PtSetArg( &arg, Pt_ARG_POINTER, &menu, 0 ); - PtGetResources( widget, 1, &arg ); + PtSetArg(&arg, Pt_ARG_POINTER, &menu, 0); + PtGetResources(widget, 1, &arg); /* Override the text and position */ tooltip = text; - if( menu != NULL ) + if (menu != NULL) { int index = MENU_INDEX_TIP; - if( menu->strings[ index ] != NULL ) + if (menu->strings[ index ] != NULL) tooltip = menu->strings[ index ]; } - return( PtInflateBalloon( + return PtInflateBalloon( window, widget, /* Don't put the balloon at the bottom, @@ -261,25 +261,25 @@ static PtWidget_t * gui_ph_show_tooltip( PtWidget_t *window, tooltip, font, fill_color, - text_color ) ); + text_color); } static void -gui_ph_resize_container( void ) +gui_ph_resize_container(void) { PhArea_t area; - PtWidgetArea( gui.vimWindow, &area ); - PtWidgetPos ( gui.vimContainer, &area.pos ); + PtWidgetArea(gui.vimWindow, &area); + PtWidgetPos (gui.vimContainer, &area.pos); - PtSetResource( gui.vimContainer, Pt_ARG_AREA, &area, 0 ); + PtSetResource(gui.vimContainer, Pt_ARG_AREA, &area, 0); } static int gui_ph_handle_menu_resize( PtWidget_t *widget, void *other, - PtCallbackInfo_t *info ) + PtCallbackInfo_t *info) { PtContainerCallback_t *sizes = info->cbdata; PtWidget_t *container; @@ -291,7 +291,7 @@ gui_ph_handle_menu_resize( /* Because vim treats the toolbar and menubar separately, * and here they're lumped together into a PtToolbarGroup, * we only need either menu_height or toolbar_height set at once */ - if( gui.menu_is_active ) + if (gui.menu_is_active) { gui.menu_height = height; gui.toolbar_height = 0; @@ -310,16 +310,16 @@ gui_ph_handle_menu_resize( container = gui.vimContainer; #endif - PtSetResource( container, Pt_ARG_POS, &below_menu, 0 ); + PtSetResource(container, Pt_ARG_POS, &below_menu, 0); gui_ph_resize_container(); #ifdef USE_PANEL_GROUP gui_ph_get_panelgroup_margins( &pg_margin_top, &pg_margin_bottom, - &pg_margin_left, &pg_margin_right ); + &pg_margin_left, &pg_margin_right); #endif - return( Pt_CONTINUE ); + return Pt_CONTINUE; } /* @@ -330,23 +330,23 @@ gui_ph_handle_menu_resize( gui_ph_handle_timer_cursor( PtWidget_t *widget, void *data, - PtCallbackInfo_t *info ) + PtCallbackInfo_t *info) { - if( blink_state == BLINK_ON ) + if (blink_state == BLINK_ON) { gui_undraw_cursor(); blink_state = BLINK_OFF; - PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL, - blink_offtime, 0 ); + PtSetResource(gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL, + blink_offtime, 0); } else { gui_update_cursor(TRUE, FALSE); blink_state = BLINK_ON; - PtSetResource( gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL, - blink_ontime, 0 ); + PtSetResource(gui_ph_timer_cursor, Pt_ARG_TIMER_INITIAL, + blink_ontime, 0); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static int @@ -354,7 +354,7 @@ gui_ph_handle_timer_timeout(PtWidget_t *widget, void *data, PtCallbackInfo_t *in { is_timeout = TRUE; - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static int @@ -402,7 +402,7 @@ gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info break; } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static int @@ -426,13 +426,13 @@ gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info case Pt_SCROLL_SET: /* FIXME: return straight away here? */ - return( Pt_CONTINUE ); + return Pt_CONTINUE; break; } gui_drag_scrollbar(sb, value, dragging); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static int @@ -453,7 +453,7 @@ gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */ if( key->key_flags & Pk_KF_Compose ) { - return( Pt_CONTINUE ); + return Pt_CONTINUE; } if( (key->key_flags & Pk_KF_Cap_Valid) && @@ -473,7 +473,7 @@ gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) gui_is_menu_shortcut( key->key_cap ) ) ) ) { /* Fallthrough and let photon look for the hotkey */ - return( Pt_CONTINUE ); + return Pt_CONTINUE; } #endif @@ -544,7 +544,7 @@ gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) add_to_input_buf( string, len ); } - return( Pt_CONSUME ); + return Pt_CONSUME; } len = 0; #endif @@ -579,7 +579,7 @@ gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) } else { - return( Pt_CONTINUE ); + return Pt_CONTINUE; } } else @@ -622,11 +622,11 @@ gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) if( len > 0 ) { add_to_input_buf( string, len ); - return( Pt_CONSUME ); + return Pt_CONSUME; } } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static int @@ -652,7 +652,7 @@ gui_ph_handle_mouse( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) if( info->event->type == Ph_EV_PTR_MOTION_NOBUTTON ) { gui_mouse_moved( mouse_x, mouse_y ); - return( Pt_CONTINUE ); + return Pt_CONTINUE; } if( pointer->key_mods & Pk_KM_Shift ) @@ -702,7 +702,7 @@ gui_ph_handle_mouse( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) gui_send_mouse_event( button , mouse_x, mouse_y, repeated_click, modifiers ); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } /* Handle a focus change of the PtRaw widget */ @@ -721,7 +721,7 @@ gui_ph_handle_focus( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) PtAddEventHandler( gui.vimTextArea, Ph_EV_PTR_MOTION_NOBUTTON, gui_ph_handle_mouse, NULL ); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static void @@ -793,7 +793,7 @@ gui_ph_handle_pulldown_menu( PtRealizeWidget( menu->submenu_id ); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } /* This is used for pulldown/popup menus and also toolbar buttons */ @@ -805,7 +805,7 @@ gui_ph_handle_menu( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) vimmenu_T *menu = (vimmenu_T *) data; gui_menu_cb( menu ); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } /* Stop focus from disappearing into the menubar... */ @@ -816,7 +816,7 @@ gui_ph_handle_menu_unrealized( PtCallbackInfo_t *info ) { PtGiveFocus( gui.vimTextArea, NULL ); - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static int @@ -826,7 +826,7 @@ gui_ph_handle_window_open( PtCallbackInfo_t *info ) { gui_set_shellsize( FALSE, TRUE, RESIZE_BOTH ); - return( Pt_CONTINUE ); + return Pt_CONTINUE; } /****************************************************************************/ @@ -878,7 +878,7 @@ gui_ph_find_buffer_item( char_u *name ) ( STRCMP( items->dname, name ) != 0 ) ) items = items->next; } - return( items ); + return items; } static void @@ -927,7 +927,7 @@ gui_ph_handle_pg_change( gui_menu_cb( menu ); } } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static void @@ -974,10 +974,10 @@ gui_ph_is_buffer_item( vimmenu_T *menu, vimmenu_T *parent ) mark++; if( *mark == ')' ) - return( TRUE); + return TRUE; } } - return( FALSE ); + return FALSE; } static void @@ -1057,7 +1057,7 @@ gui_ph_handle_buffer_remove( gui_ph_pg_remove_buffer( menu->dname ); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } #endif @@ -1071,7 +1071,7 @@ gui_ph_pane_resize( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) PtContainerHold( gui.vimContainer ); } - return( Pt_CONTINUE ); + return Pt_CONTINUE; } /****************************************************************************/ @@ -1126,7 +1126,7 @@ gui_mch_init(void) gui.event_buffer = (PhEvent_t *) alloc( EVENT_BUFFER_SIZE ); if( gui.event_buffer == NULL ) - return( FAIL ); + return FAIL; /* Get a translation so we can convert from ISO Latin-1 to UTF */ charset_translate = PxTranslateSet( NULL, "latin1" ); @@ -1141,7 +1141,7 @@ gui_mch_init(void) PtSetArg( &args[ n++ ], Pt_ARG_DIM, &window_size, 0 ); gui.vimWindow = PtCreateWidget( PtWindow, NULL, n, args ); if( gui.vimWindow == NULL ) - return( FAIL ); + return FAIL; PtAddCallback( gui.vimWindow, Pt_CB_WINDOW, gui_ph_handle_window_cb, NULL ); PtAddCallback( gui.vimWindow, Pt_CB_WINDOW_OPENING, @@ -1158,7 +1158,7 @@ gui_mch_init(void) gui.vimPanelGroup = PtCreateWidget( PtPanelGroup, gui.vimWindow, n, args ); if( gui.vimPanelGroup == NULL ) - return( FAIL ); + return FAIL; PtAddCallback( gui.vimPanelGroup, Pt_CB_PG_PANEL_SWITCHING, gui_ph_handle_pg_change, NULL ); @@ -1172,7 +1172,7 @@ gui_mch_init(void) gui.vimContainer = PtCreateWidget( PtPane, gui.vimWindow, n, args ); if( gui.vimContainer == NULL ) - return( FAIL ); + return FAIL; PtAddCallback( gui.vimContainer, Pt_CB_RESIZE, gui_ph_pane_resize, NULL ); #endif @@ -1195,7 +1195,7 @@ gui_mch_init(void) gui.vimTextArea = PtCreateWidget( PtRaw, Pt_DFLT_PARENT, n, args ); if( gui.vimTextArea == NULL) - return( FAIL ); + return FAIL; /* TODO: use PtAddEventHandlers instead? */ /* Not using Ph_EV_BUT_REPEAT because vim wouldn't use it anyway */ @@ -1220,11 +1220,11 @@ gui_mch_init(void) */ gui_ph_timer_cursor = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL ); if( gui_ph_timer_cursor == NULL ) - return( FAIL ); + return FAIL; gui_ph_timer_timeout = PtCreateWidget( PtTimer, gui.vimWindow, 0, NULL ); if( gui_ph_timer_timeout == NULL ) - return( FAIL ); + return FAIL; PtAddCallback( gui_ph_timer_cursor, Pt_CB_TIMER_ACTIVATE, gui_ph_handle_timer_cursor, NULL); @@ -1239,7 +1239,7 @@ gui_mch_init(void) gui.vimToolBarGroup = PtCreateWidget( PtToolbarGroup, gui.vimWindow, n, args ); if( gui.vimToolBarGroup == NULL ) - return( FAIL ); + return FAIL; PtAddCallback( gui.vimToolBarGroup, Pt_CB_RESIZE, gui_ph_handle_menu_resize, NULL ); @@ -1254,7 +1254,7 @@ gui_mch_init(void) } gui.vimMenuBar = PtCreateWidget( PtMenuBar, gui.vimToolBarGroup, n, args ); if( gui.vimMenuBar == NULL ) - return( FAIL ); + return FAIL; # ifdef FEAT_TOOLBAR n = 0; @@ -1273,7 +1273,7 @@ gui_mch_init(void) gui.vimToolBar = PtCreateWidget( PtToolbar, gui.vimToolBarGroup, n, args ); if( gui.vimToolBar == NULL ) - return( FAIL ); + return FAIL; /* * Size for the toolbar is fetched in gui_mch_show_toolbar, after @@ -1284,13 +1284,13 @@ gui_mch_init(void) #endif - return( OK ); + return OK; } int gui_mch_init_check(void) { - return( (is_photon_available == TRUE) ? OK : FAIL ); + return (is_photon_available == TRUE) ? OK : FAIL; } int @@ -1310,7 +1310,7 @@ gui_mch_open(void) if (gui_win_x != -1 && gui_win_y != -1) gui_mch_set_winpos(gui_win_x, gui_win_y); - return( (PtRealizeWidget( gui.vimWindow ) == 0) ? OK : FAIL ); + return (PtRealizeWidget( gui.vimWindow ) == 0) ? OK : FAIL; } void @@ -1336,7 +1336,7 @@ gui_mch_exit(int rc) exit_gui_mch_update( void *data ) { *(int *)data = FALSE; - return( Pt_END ); + return Pt_END; } void @@ -1365,10 +1365,10 @@ gui_mch_wait_for_chars(int wtime) if( input_available() ) { PtSetResource( gui_ph_timer_timeout, Pt_ARG_TIMER_INITIAL, 0, 0 ); - return( OK ); + return OK; } else if( is_timeout == TRUE ) - return( FAIL ); + return FAIL; } } @@ -1446,9 +1446,9 @@ gui_mch_browse( vim_free( default_path ); if( file.ret == Pt_FSDIALOG_BTN1 ) - return( vim_strsave( file.path ) ); + return vim_strsave(file.path); } - return( NULL ); + return NULL; } #endif @@ -1470,7 +1470,7 @@ gui_ph_dialog_close( int button, void *data ) PtModalUnblock( modal_ctrl, (void *) button ); - return( Pt_TRUE ); + return Pt_TRUE; } static int @@ -1478,7 +1478,7 @@ gui_ph_dialog_text_enter( PtWidget_t *widget, void *data, PtCallbackInfo_t *info { if( info->reason_subtype == Pt_EDIT_ACTIVATE ) gui_ph_dialog_close( 1, data ); - return( Pt_CONTINUE ); + return Pt_CONTINUE; } static int @@ -1490,9 +1490,9 @@ gui_ph_dialog_esc( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) if( ( key->key_flags & Pk_KF_Cap_Valid ) && ( key->key_cap == Pk_Escape ) ) { gui_ph_dialog_close( 0, data ); - return( Pt_CONSUME ); + return Pt_CONSUME; } - return( Pt_PROCESS ); + return Pt_PROCESS; } int @@ -1519,7 +1519,7 @@ gui_mch_dialog( button_count = len = i = 0; if( buttons == NULL || *buttons == NUL ) - return( -1 ); + return -1; /* There is one less separator than buttons, so bump up the button count */ button_count = 1; @@ -1637,7 +1637,7 @@ gui_mch_dialog( vim_free( button_array ); vim_free( buttons_copy ); - return( dialog_result ); + return dialog_result; } #endif /****************************************************************************/ @@ -1653,7 +1653,7 @@ gui_mch_get_winpos(int *x, int *y) *x = pos->x; *y = pos->y; - return( OK ); + return OK; } void @@ -1975,11 +1975,11 @@ gui_mch_new_colors(void) hex_digit(int c) { if (VIM_ISDIGIT(c)) - return( c - '0' ); + return c - '0'; c = TOLOWER_ASC(c); if (c >= 'a' && c <= 'f') - return( c - 'a' + 10 ); - return( -1000 ); + return c - 'a' + 10; + return -1000; } @@ -2065,13 +2065,13 @@ gui_mch_get_color(char_u *name) b = hex_digit( name[5] ) * 16 + hex_digit( name[6] ); if( r < 0 || g < 0 || b < 0 ) return INVALCOLOR; - return( RGB( r, g, b ) ); + return RGB(r, g, b); } for( i = 0; i < ARRAY_LENGTH( table ); i++ ) { if( STRICMP( name, table[i].name ) == 0 ) - return( table[i].colour ); + return table[i].colour; } /* @@ -2115,7 +2115,7 @@ gui_mch_get_color(char_u *name) if (STRICMP(color, name) == 0) { fclose(fd); - return( (guicolor_T) RGB(r,g,b) ); + return (guicolor_T)RGB(r, g, b); } } @@ -2451,8 +2451,8 @@ gui_mch_haskey(char_u *name) for (i = 0; special_keys[i].key_sym != 0; i++) if (name[0] == special_keys[i].vim_code0 && name[1] == special_keys[i].vim_code1) - return( OK ); - return( FAIL ); + return OK; + return FAIL; } /****************************************************************************/ @@ -2512,7 +2512,7 @@ gui_ph_toolbar_load_icon( char_u *iconfile ) temp_phi = &external_icon; } - return( temp_phi ); + return temp_phi; } /* @@ -2541,16 +2541,16 @@ gui_ph_toolbar_find_icon( vimmenu_T *menu ) icon = gui_ph_toolbar_load_icon( full_pathname ); if( icon != NULL ) - return( icon ); + return icon; } if( menu->iconidx >= 0 && ( menu->iconidx < ARRAY_LENGTH( gui_ph_toolbar_images ) ) ) { - return( gui_ph_toolbar_images[ menu->iconidx ] ); + return gui_ph_toolbar_images[menu->iconidx]; } - return( NULL ); + return NULL; } #endif @@ -2895,11 +2895,11 @@ gui_ph_get_font( * at least has the bits we're checking for */ if( font_size == info.size && style == (info.style & style) ) - return( (GuiFont) font_tag ); + return (GuiFont)font_tag; } vim_free( font_tag ); } - return( NULL ); + return NULL; } /* @@ -2957,9 +2957,9 @@ gui_ph_parse_font_name( } } } - return( TRUE ); + return TRUE; } - return( FALSE ); + return FALSE; } int @@ -2985,7 +2985,7 @@ gui_mch_init_font(char_u *vim_font_name, int fontset) "pcterm12", -1, PHFONT_FIXED, NULL ); if( font_tag == NULL ) - return( FAIL ); + return FAIL; gui_mch_free_font( gui.norm_font ); gui.norm_font = font_tag; @@ -2997,13 +2997,13 @@ gui_mch_init_font(char_u *vim_font_name, int fontset) { if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags, &font_size ) == FALSE ) - return( FAIL ); + return FAIL; font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 ); if( font_tag == NULL ) { vim_free( font_name ); - return( FAIL ); + return FAIL; } gui_mch_free_font( gui.norm_font ); @@ -3026,7 +3026,7 @@ gui_mch_init_font(char_u *vim_font_name, int fontset) gui.char_ascent = - extent.ul.y; vim_free( font_name ); - return( OK ); + return OK; } /* @@ -3042,7 +3042,7 @@ gui_mch_adjust_charheight(void) gui.char_height = - info.ascender + info.descender + p_linespace; gui.char_ascent = - info.ascender + p_linespace / 2; - return( OK ); + return OK; } GuiFont @@ -3060,13 +3060,13 @@ gui_mch_get_font(char_u *vim_font_name, int report_error) vim_free( font_name ); if( font_tag != NULL ) - return( (GuiFont) font_tag ); + return (GuiFont)font_tag; } if( report_error ) EMSG2(e_font, vim_font_name ); - return( FAIL ); + return FAIL; } #if defined(FEAT_EVAL) || defined(PROTO) diff --git a/src/version.c b/src/version.c index 70be57a8a5..5c8892ceb2 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 262, /**/ 261, /**/ From bb18281bd3b1be7421a634d9e7cfdda0f3e1158b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 14:09:09 +0200 Subject: [PATCH 04/86] Added tag v7-3-262 for changeset 847733973bfd --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index beed7d1eff..06237d8b3e 100644 --- a/.hgtags +++ b/.hgtags @@ -1596,3 +1596,4 @@ bdc3335bd72eea207b28fcf8af90a73c855c8847 v7-3-258 59130cd78dfc73bd04f22d201b8f7c0772d98e79 v7-3-259 cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260 410d42e3d4da09284394456186143d595e9b2efc v7-3-261 +847733973bfdd716bfafc364a4102e76f88e7fe8 v7-3-262 From 2999bcc96253d41b2335e24bc46e8680bd31fdf5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 14:15:46 +0200 Subject: [PATCH 05/86] updated for version 7.3.263 Problem: Perl and Tcl have a few code style problems. Solution: Clean it up. (Elias Diem) --- src/if_perl.xs | 10 +++++----- src/if_tcl.c | 6 +++--- src/version.c | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/if_perl.xs b/src/if_perl.xs index 545dc7b66f..f0afb3904d 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -755,7 +755,7 @@ ex_perl(eap) #ifdef HAVE_SANDBOX if (sandbox) { - safe = perl_get_sv( "VIM::safe", FALSE ); + safe = perl_get_sv("VIM::safe", FALSE); # ifndef MAKE_TEST /* avoid a warning for unreachable code */ if (safe == NULL || !SvTRUE(safe)) EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module")); @@ -1108,7 +1108,7 @@ Cursor(win, ...) VIWIN win PPCODE: - if(items == 1) + if (items == 1) { EXTEND(sp, 2); if (!win_valid(win)) @@ -1116,7 +1116,7 @@ Cursor(win, ...) PUSHs(sv_2mortal(newSViv(win->w_cursor.lnum))); PUSHs(sv_2mortal(newSViv(win->w_cursor.col))); } - else if(items == 3) + else if (items == 3) { int lnum, col; @@ -1249,9 +1249,9 @@ Delete(vimbuf, ...) { lnum = SvIV(ST(1)); count = 1 + SvIV(ST(2)) - lnum; - if(count == 0) + if (count == 0) count = 1; - if(count < 0) + if (count < 0) { lnum -= count; count = -count; diff --git a/src/if_tcl.c b/src/if_tcl.c index e5eee2926e..5537b6356e 100644 --- a/src/if_tcl.c +++ b/src/if_tcl.c @@ -1884,14 +1884,14 @@ tclexit(error) { int newerr = OK; - if (error == TCL_EXIT ) + if (error == TCL_EXIT) { int retval; char buf[50]; Tcl_Obj *robj; robj = Tcl_GetObjResult(tclinfo.interp); - if( Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK ) + if (Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK) { EMSG(_("E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org")); newerr = FAIL; @@ -1900,7 +1900,7 @@ tclexit(error) { sprintf(buf, _("E572: exit code %d"), retval); tclerrmsg(buf); - if (retval == 0 ) + if (retval == 0) { did_emsg = 0; newerr = OK; diff --git a/src/version.c b/src/version.c index 5c8892ceb2..fc51557365 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 263, /**/ 262, /**/ From 2dcdd2a1535e26bc64660f7a46ff96ab9faefe42 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 14:15:46 +0200 Subject: [PATCH 06/86] Added tag v7-3-263 for changeset a56259157c93 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 06237d8b3e..31212dc076 100644 --- a/.hgtags +++ b/.hgtags @@ -1597,3 +1597,4 @@ bdc3335bd72eea207b28fcf8af90a73c855c8847 v7-3-258 cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260 410d42e3d4da09284394456186143d595e9b2efc v7-3-261 847733973bfdd716bfafc364a4102e76f88e7fe8 v7-3-262 +a56259157c935b4e78e9f5f4dfb1436e3461eefb v7-3-263 From 67755f963f3afe5c362fa1a4cfc49948ae84e583 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 17:31:47 +0200 Subject: [PATCH 07/86] updated for version 7.3.264 Problem: When the current directory name contains wildcard characters, such as "foo[with]bar", the tags file can't be found. (Jeremy Erickson) Solution: When searching for matching files also match without expanding wildcards. This is a bit of a hack. --- src/misc1.c | 10 +++++++--- src/misc2.c | 10 ++++++---- src/version.c | 2 ++ src/vim.h | 1 + 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/misc1.c b/src/misc1.c index a573b3b999..a3a20597be 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -9119,7 +9119,9 @@ dos_expandpath( * all entries found with "matchname". */ if ((p[0] != '.' || starts_with_dot) && (matchname == NULL - || vim_regexec(®match, p, (colnr_T)0))) + || vim_regexec(®match, p, (colnr_T)0) + || ((flags & EW_NOTWILD) + && fnamencmp(path + (s - buf), p, e - s) == 0))) { #ifdef WIN3264 STRCPY(s, p); @@ -9323,7 +9325,7 @@ unix_expandpath(gap, path, wildoff, flags, didstar) e = p; *e = NUL; - /* now we have one wildcard component between "s" and "e" */ + /* Now we have one wildcard component between "s" and "e". */ /* Remove backslashes between "wildoff" and the start of the wildcard * component. */ for (p = buf + wildoff; p < s; ++p) @@ -9390,7 +9392,9 @@ unix_expandpath(gap, path, wildoff, flags, didstar) if (dp == NULL) break; if ((dp->d_name[0] != '.' || starts_with_dot) - && vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0)) + && (vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0) + || ((flags & EW_NOTWILD) + && fnamencmp(path + (s - buf), dp->d_name, e - s) == 0))) { STRCPY(s, dp->d_name); len = STRLEN(buf); diff --git a/src/misc2.c b/src/misc2.c index dfb1fc487f..f91a64aced 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -4653,9 +4653,8 @@ vim_findfile_stopdir(buf) { if (r_ptr[0] == '\\' && r_ptr[1] == ';') { - /* overwrite the escape char, - * use STRLEN(r_ptr) to move the trailing '\0' - */ + /* Overwrite the escape char, + * use STRLEN(r_ptr) to move the trailing '\0'. */ STRMOVE(r_ptr, r_ptr + 1); r_ptr++; } @@ -4914,10 +4913,13 @@ vim_findfile(search_ctx_arg) stackp->ffs_filearray_size = 0; } else + /* Add EW_NOTWILD because the expanded path may contain + * wildcard characters that are to be taken literally. + * This is a bit of a hack. */ expand_wildcards((dirptrs[1] == NULL) ? 1 : 2, dirptrs, &stackp->ffs_filearray_size, &stackp->ffs_filearray, - EW_DIR|EW_ADDSLASH|EW_SILENT); + EW_DIR|EW_ADDSLASH|EW_SILENT|EW_NOTWILD); stackp->ffs_filearray_cur = 0; stackp->ffs_stage = 0; diff --git a/src/version.c b/src/version.c index fc51557365..dbd76b3548 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 264, /**/ 263, /**/ diff --git a/src/vim.h b/src/vim.h index a1a9708191..127387aa0d 100644 --- a/src/vim.h +++ b/src/vim.h @@ -816,6 +816,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); #define EW_PATH 0x80 /* search in 'path' too */ #define EW_ICASE 0x100 /* ignore case */ #define EW_NOERROR 0x200 /* no error for bad regexp */ +#define EW_NOTWILD 0x400 /* add match with literal name if exists */ /* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND * is used when executing commands and EW_SILENT for interactive expanding. */ From e3c8fb2cc558e890275e2d1b15bfb063f8f0c48e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 17:31:47 +0200 Subject: [PATCH 08/86] Added tag v7-3-264 for changeset aa40bddeea9a --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 31212dc076..90e4eef769 100644 --- a/.hgtags +++ b/.hgtags @@ -1598,3 +1598,4 @@ cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260 410d42e3d4da09284394456186143d595e9b2efc v7-3-261 847733973bfdd716bfafc364a4102e76f88e7fe8 v7-3-262 a56259157c935b4e78e9f5f4dfb1436e3461eefb v7-3-263 +aa40bddeea9a44c6c6b4ffa32c1ef373df437a16 v7-3-264 From 4fbfd3b72d24510cd2b65af79dfbf46b1638afd8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 17:58:46 +0200 Subject: [PATCH 09/86] updated for version 7.3.265 Problem: When storing a pattern in search history there is no proper check for the separator character. Solution: Pass the separator character to in_history(). (Muraoka Taro) --- src/ex_getln.c | 17 ++++++++++++----- src/version.c | 2 ++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/ex_getln.c b/src/ex_getln.c index 913d9830ed..ed0082c132 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -67,7 +67,7 @@ static int hislen = 0; /* actual length of history tables */ static int hist_char2type __ARGS((int c)); -static int in_history __ARGS((int, char_u *, int)); +static int in_history __ARGS((int, char_u *, int, int)); # ifdef FEAT_EVAL static int calc_hist_idx __ARGS((int histype, int num)); # endif @@ -5289,13 +5289,15 @@ init_history() * If 'move_to_front' is TRUE, matching entry is moved to end of history. */ static int -in_history(type, str, move_to_front) +in_history(type, str, move_to_front, sep) int type; char_u *str; int move_to_front; /* Move the entry to the front if it exists */ + int sep; { int i; int last_i = -1; + char_u *p; if (hisidx[type] < 0) return FALSE; @@ -5304,7 +5306,12 @@ in_history(type, str, move_to_front) { if (history[type][i].hisstr == NULL) return FALSE; - if (STRCMP(str, history[type][i].hisstr) == 0) + + /* For search history, check that the separator character matches as + * well. */ + p = history[type][i].hisstr; + if (STRCMP(str, p) == 0 + && (type != HIST_SEARCH || sep == p[STRLEN(p) + 1])) { if (!move_to_front) return TRUE; @@ -5398,7 +5405,7 @@ add_to_history(histype, new_entry, in_map, sep) } last_maptick = -1; } - if (!in_history(histype, new_entry, TRUE)) + if (!in_history(histype, new_entry, TRUE, sep)) { if (++hisidx[histype] == hislen) hisidx[histype] = 0; @@ -5977,7 +5984,7 @@ read_viminfo_history(virp) if (val != NULL && *val != NUL) { if (!in_history(type, val + (type == HIST_SEARCH), - viminfo_add_at_front)) + viminfo_add_at_front, *val)) { /* Need to re-allocate to append the separator byte. */ len = STRLEN(val); diff --git a/src/version.c b/src/version.c index dbd76b3548..525484774e 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 265, /**/ 264, /**/ From d7868fe39603c7f75e2bca2a3a7f7a71ff96263a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 17:58:46 +0200 Subject: [PATCH 10/86] Added tag v7-3-265 for changeset eff686fb8de6 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 90e4eef769..fe64fded90 100644 --- a/.hgtags +++ b/.hgtags @@ -1599,3 +1599,4 @@ cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260 847733973bfdd716bfafc364a4102e76f88e7fe8 v7-3-262 a56259157c935b4e78e9f5f4dfb1436e3461eefb v7-3-263 aa40bddeea9a44c6c6b4ffa32c1ef373df437a16 v7-3-264 +eff686fb8de66a26367f5e6430d34729f1a0e336 v7-3-265 From f33d8610caf258d9a1a780cad1b540c08501836f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 18:25:44 +0200 Subject: [PATCH 11/86] updated for version 7.3.266 Problem: In Gvim with iBus typing space in Insert mode doesn't work. Solution: Clear xim_expected_char after checking it. --- src/mbyte.c | 4 ++++ src/version.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/mbyte.c b/src/mbyte.c index 88599264b0..44d89f7947 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -5170,6 +5170,10 @@ xim_queue_key_press_event(GdkEventKey *event, int down) /* We had a keypad key, and XIM tried to thieve it */ return FALSE; + /* This is supposed to fix a problem with iBus, that space + * characters don't work in input mode. */ + xim_expected_char = NUL; + /* Normal processing */ return imresult; } diff --git a/src/version.c b/src/version.c index 525484774e..f6471cf449 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 266, /**/ 265, /**/ From ff09e6169457984b1a50b3c5cbd8b7cb785ef12a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 27 Jul 2011 18:25:44 +0200 Subject: [PATCH 12/86] Added tag v7-3-266 for changeset 25be7c9dda54 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index fe64fded90..2fdea255ad 100644 --- a/.hgtags +++ b/.hgtags @@ -1600,3 +1600,4 @@ cb4682b959098e486977eb4b5969c9eb07d2798e v7-3-260 a56259157c935b4e78e9f5f4dfb1436e3461eefb v7-3-263 aa40bddeea9a44c6c6b4ffa32c1ef373df437a16 v7-3-264 eff686fb8de66a26367f5e6430d34729f1a0e336 v7-3-265 +25be7c9dda549e4cfa1eb57937dc2b38b3d1e997 v7-3-266 From a810a2915f9700cced20d206b16332bc01683c37 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2011 19:34:59 +0200 Subject: [PATCH 13/86] updated for version 7.3.267 Problem: Ruby on Mac OS X 10.7 may crash. Solution: Avoid alloc(0). (Bjorn Winckler) --- src/if_ruby.c | 18 +++++++++++++----- src/version.c | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/if_ruby.c b/src/if_ruby.c index a45269d6e6..5dc32858be 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -761,11 +761,19 @@ static VALUE vim_message(VALUE self UNUSED, VALUE str) char *buff, *p; str = rb_obj_as_string(str); - buff = ALLOCA_N(char, RSTRING_LEN(str)); - strcpy(buff, RSTRING_PTR(str)); - p = strchr(buff, '\n'); - if (p) *p = '\0'; - MSG(buff); + if (RSTRING_LEN(str) > 0) + { + /* Only do this when the string isn't empty, alloc(0) causes trouble. */ + buff = ALLOCA_N(char, RSTRING_LEN(str)); + strcpy(buff, RSTRING_PTR(str)); + p = strchr(buff, '\n'); + if (p) *p = '\0'; + MSG(buff); + } + else + { + MSG(""); + } return Qnil; } diff --git a/src/version.c b/src/version.c index f6471cf449..6bddff0cc0 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 267, /**/ 266, /**/ From c2d688359413038126f51d07419cbb1f3c26f471 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2011 19:34:59 +0200 Subject: [PATCH 14/86] Added tag v7-3-267 for changeset ad404f2a4bfa --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 2fdea255ad..3dd73142be 100644 --- a/.hgtags +++ b/.hgtags @@ -1601,3 +1601,4 @@ a56259157c935b4e78e9f5f4dfb1436e3461eefb v7-3-263 aa40bddeea9a44c6c6b4ffa32c1ef373df437a16 v7-3-264 eff686fb8de66a26367f5e6430d34729f1a0e336 v7-3-265 25be7c9dda549e4cfa1eb57937dc2b38b3d1e997 v7-3-266 +ad404f2a4bfa5374e97f29335f41b7ef34cd6bfa v7-3-267 From b35ffe84c6ec7b20d824de7f952125f707c5ab93 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2011 19:36:52 +0200 Subject: [PATCH 15/86] updated for version 7.3.268 Problem: Vim freezes when executing an external command with zsh. Solution: Use O_NOCTTY both in the master and slave. (Bjorn Winckler) --- src/os_unix.c | 18 ++++++++++++++---- src/version.c | 2 ++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/os_unix.c b/src/os_unix.c index a3c4fd690f..391af9cb13 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3889,11 +3889,21 @@ mch_call_shell(cmd, options) if (p_guipty && !(options & (SHELL_READ|SHELL_WRITE))) { pty_master_fd = OpenPTY(&tty_name); /* open pty */ - if (pty_master_fd >= 0 && ((pty_slave_fd = - open(tty_name, O_RDWR | O_EXTRA, 0)) < 0)) + if (pty_master_fd >= 0) { - close(pty_master_fd); - pty_master_fd = -1; + /* Leaving out O_NOCTTY may lead to waitpid() always returning + * 0 on Mac OS X 10.7 thereby causing freezes. Let's assume + * adding O_NOCTTY always works when defined. */ +#ifdef O_NOCTTY + pty_slave_fd = open(tty_name, O_RDWR | O_NOCTTY | O_EXTRA, 0); +#else + pty_slave_fd = open(tty_name, O_RDWR | O_EXTRA, 0); +#endif + if (pty_slave_fd < 0) + { + close(pty_master_fd); + pty_master_fd = -1; + } } } /* diff --git a/src/version.c b/src/version.c index 6bddff0cc0..8adefc0809 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 268, /**/ 267, /**/ From e1fae7284e12e15ba270de68281c276b28b4b7ff Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2011 19:36:52 +0200 Subject: [PATCH 16/86] Added tag v7-3-268 for changeset ee17ee712512 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 3dd73142be..93791fc72f 100644 --- a/.hgtags +++ b/.hgtags @@ -1602,3 +1602,4 @@ aa40bddeea9a44c6c6b4ffa32c1ef373df437a16 v7-3-264 eff686fb8de66a26367f5e6430d34729f1a0e336 v7-3-265 25be7c9dda549e4cfa1eb57937dc2b38b3d1e997 v7-3-266 ad404f2a4bfa5374e97f29335f41b7ef34cd6bfa v7-3-267 +ee17ee712512451a54046d6bcd3ddb9f70cb5cdf v7-3-268 From 1e1f876bc18f223d70a82f12bd39c070aa7f62f3 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2011 22:59:28 +0200 Subject: [PATCH 17/86] updated for version 7.3.269 Problem: 'shellcmdflag' only works with one flag. Solution: Split into multiple arguments. (Gary Johnson) --- src/os_unix.c | 34 +++++++++++++++++++++++++++++++++- src/version.c | 2 ++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/os_unix.c b/src/os_unix.c index 391af9cb13..7b41a90a4f 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3795,8 +3795,10 @@ mch_call_shell(cmd, options) int retval = -1; char **argv = NULL; int argc; + char_u *p_shcf_copy = NULL; int i; char_u *p; + char_u *s; int inquote; int pty_master_fd = -1; /* for pty's */ # ifdef FEAT_GUI @@ -3855,6 +3857,19 @@ mch_call_shell(cmd, options) } if (argv == NULL) { + /* + * Account for possible multiple args in p_shcf. + */ + p = p_shcf; + for (;;) + { + p = skiptowhite(p); + if (*p == NUL) + break; + ++argc; + p = skipwhite(p); + } + argv = (char **)alloc((unsigned)((argc + 4) * sizeof(char *))); if (argv == NULL) /* out of memory */ goto error; @@ -3864,7 +3879,23 @@ mch_call_shell(cmd, options) { if (extra_shell_arg != NULL) argv[argc++] = (char *)extra_shell_arg; - argv[argc++] = (char *)p_shcf; + + /* Break 'shellcmdflag' into white separated parts. This doesn't + * handle quoted strings, they are very unlikely to appear. */ + p_shcf_copy = alloc((unsigned)STRLEN(p_shcf) + 1); + if (p_shcf_copy == NULL) /* out of memory */ + goto error; + s = p_shcf_copy; + p = p_shcf; + while (*p != NUL) + { + argv[argc++] = (char *)s; + while (*p && *p != ' ' && *p != TAB) + *s++ = *p++; + *s++ = NUL; + p = skipwhite(p); + } + argv[argc++] = (char *)cmd; } argv[argc] = NULL; @@ -4677,6 +4708,7 @@ finished: } } vim_free(argv); + vim_free(p_shcf_copy); error: if (!did_settmode) diff --git a/src/version.c b/src/version.c index 8adefc0809..0d97adec54 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 269, /**/ 268, /**/ From 57747fd2bfbcfdb8640ad4f424e6522f1e55248e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 4 Aug 2011 22:59:28 +0200 Subject: [PATCH 18/86] Added tag v7-3-269 for changeset 7f4f5ca70dbd --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 93791fc72f..1f8e830e8b 100644 --- a/.hgtags +++ b/.hgtags @@ -1603,3 +1603,4 @@ eff686fb8de66a26367f5e6430d34729f1a0e336 v7-3-265 25be7c9dda549e4cfa1eb57937dc2b38b3d1e997 v7-3-266 ad404f2a4bfa5374e97f29335f41b7ef34cd6bfa v7-3-267 ee17ee712512451a54046d6bcd3ddb9f70cb5cdf v7-3-268 +7f4f5ca70dbde4e31c2de494b982bfb9bd71ed75 v7-3-269 From 8b4e70c31d6f02aee604e04073725225a988f1ba Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 12:11:01 +0200 Subject: [PATCH 19/86] updated for version 7.3.270 Problem: Illegal memory access. Solution: Swap conditions. (Dominique Pelle) --- src/ops.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ops.c b/src/ops.c index bdc53de33b..41193566db 100644 --- a/src/ops.c +++ b/src/ops.c @@ -6311,7 +6311,7 @@ line_count_info(line, wc, cc, limit, eol_size) *wc += words; /* Add eol_size if the end of line was reached before hitting limit. */ - if (line[i] == NUL && i < limit) + if (i < limit && line[i] == NUL) { i += eol_size; chars += eol_size; diff --git a/src/version.c b/src/version.c index 0d97adec54..86addc57ab 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 270, /**/ 269, /**/ From c58a35b454a8aa532747f1b3450f6e96cbe11a10 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 12:11:01 +0200 Subject: [PATCH 20/86] Added tag v7-3-270 for changeset b9182da84c7e --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 1f8e830e8b..5e52bc8441 100644 --- a/.hgtags +++ b/.hgtags @@ -1604,3 +1604,4 @@ eff686fb8de66a26367f5e6430d34729f1a0e336 v7-3-265 ad404f2a4bfa5374e97f29335f41b7ef34cd6bfa v7-3-267 ee17ee712512451a54046d6bcd3ddb9f70cb5cdf v7-3-268 7f4f5ca70dbde4e31c2de494b982bfb9bd71ed75 v7-3-269 +b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 From 6fb1ea8d7fed6a0bbdd5d9e46b11e58decbb3f0d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 12:19:04 +0200 Subject: [PATCH 21/86] updated for version 7.3.271 Problem: Code not following Vim coding style. Solution: Fix the style. (Elias Diem) --- src/gui_photon.c | 116 +++++++++++++++++++++++------------------------ src/version.c | 2 + 2 files changed, 60 insertions(+), 58 deletions(-) diff --git a/src/gui_photon.c b/src/gui_photon.c index 4e51cab1b4..9cb65ba0b7 100644 --- a/src/gui_photon.c +++ b/src/gui_photon.c @@ -358,21 +358,21 @@ gui_ph_handle_timer_timeout(PtWidget_t *widget, void *data, PtCallbackInfo_t *in } static int -gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) +gui_ph_handle_window_cb(PtWidget_t *widget, void *data, PtCallbackInfo_t *info) { PhWindowEvent_t *we = info->cbdata; ushort_t *width, *height; - switch( we->event_f ) { + switch (we->event_f) { case Ph_WM_CLOSE: gui_shell_closed(); break; case Ph_WM_FOCUS: /* Just in case it's hidden and needs to be shown */ - gui_mch_mousehide( MOUSE_SHOW ); + gui_mch_mousehide(MOUSE_SHOW); - if( we->event_state == Ph_WM_EVSTATE_FOCUS ) + if (we->event_state == Ph_WM_EVSTATE_FOCUS) { gui_focus_change(TRUE); gui_mch_start_blink(); @@ -385,17 +385,17 @@ gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info break; case Ph_WM_RESIZE: - PtGetResource( gui.vimWindow, Pt_ARG_WIDTH, &width, 0 ); - PtGetResource( gui.vimWindow, Pt_ARG_HEIGHT, &height, 0 ); + PtGetResource(gui.vimWindow, Pt_ARG_WIDTH, &width, 0); + PtGetResource(gui.vimWindow, Pt_ARG_HEIGHT, &height, 0); #ifdef USE_PANEL_GROUP width -= (pg_margin_left + pg_margin_right); height -= (pg_margin_top + pg_margin_bottom); #endif - gui_resize_shell( *width, *height ); - gui_set_shellsize( FALSE, FALSE, RESIZE_BOTH ); + gui_resize_shell(*width, *height); + gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH); is_ignore_draw = FALSE; - PtEndFlux( gui.vimContainer ); - PtContainerRelease( gui.vimContainer ); + PtEndFlux(gui.vimContainer); + PtContainerRelease(gui.vimContainer); break; default: @@ -406,7 +406,7 @@ gui_ph_handle_window_cb( PtWidget_t *widget, void *data, PtCallbackInfo_t *info } static int -gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) +gui_ph_handle_scrollbar(PtWidget_t *widget, void *data, PtCallbackInfo_t *info) { PtScrollbarCallback_t *scroll; scrollbar_T *sb; @@ -415,10 +415,10 @@ gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info scroll = info->cbdata; sb = (scrollbar_T *) data; - if( sb != NULL ) + if (sb != NULL) { value = scroll->position; - switch( scroll->action ) + switch (scroll->action) { case Pt_SCROLL_DRAGGED: dragging = TRUE; @@ -436,97 +436,97 @@ gui_ph_handle_scrollbar( PtWidget_t *widget, void *data, PtCallbackInfo_t *info } static int -gui_ph_handle_keyboard( PtWidget_t *widget, void *data, PtCallbackInfo_t *info ) +gui_ph_handle_keyboard(PtWidget_t *widget, void *data, PtCallbackInfo_t *info) { PhKeyEvent_t *key; unsigned char string[6]; int len, i; int ch, modifiers; - key = PhGetData( info->event ); + key = PhGetData(info->event); ch = modifiers = len = 0; - if( p_mh ) - gui_mch_mousehide( MOUSE_HIDE ); + if (p_mh) + gui_mch_mousehide(MOUSE_HIDE); /* We're a good lil photon program, aren't we? yes we are, yeess wee arrr */ - if( key->key_flags & Pk_KF_Compose ) + if (key->key_flags & Pk_KF_Compose) { return Pt_CONTINUE; } - if( (key->key_flags & Pk_KF_Cap_Valid) && - PkIsKeyDown( key->key_flags ) ) + if ((key->key_flags & Pk_KF_Cap_Valid) && + PkIsKeyDown(key->key_flags)) { #ifdef FEAT_MENU /* * Only show the menu if the Alt key is down, and the Shift & Ctrl * keys aren't down, as well as the other conditions */ - if( ( ( key->key_mods & Pk_KM_Alt ) && - !( key->key_mods & Pk_KM_Shift ) && - !( key->key_mods & Pk_KM_Ctrl ) ) && + if (((key->key_mods & Pk_KM_Alt) && + !(key->key_mods & Pk_KM_Shift) && + !(key->key_mods & Pk_KM_Ctrl)) && gui.menu_is_active && - ( *p_wak == 'y' || - ( *p_wak == 'm' && - gui_is_menu_shortcut( key->key_cap ) ) ) ) + (*p_wak == 'y' || + (*p_wak == 'm' && + gui_is_menu_shortcut(key->key_cap)))) { /* Fallthrough and let photon look for the hotkey */ return Pt_CONTINUE; } #endif - for( i = 0; special_keys[i].key_sym != 0; i++ ) + for(i = 0; special_keys[i].key_sym != 0; i++) { - if( special_keys[i].key_sym == key->key_cap ) + if (special_keys[i].key_sym == key->key_cap) { len = 0; - if( special_keys[i].vim_code1 == NUL ) + if (special_keys[i].vim_code1 == NUL) ch = special_keys[i].vim_code0; else { /* Detect if a keypad number key has been pressed * and change the key if Num Lock is on */ - if( key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9 - && ( key->key_mods & Pk_KM_Num_Lock ) ) + if (key->key_cap >= Pk_KP_Enter && key->key_cap <= Pk_KP_9 + && (key->key_mods & Pk_KM_Num_Lock)) { /* FIXME: For now, just map the key to a ascii value * (see ) */ ch = key->key_cap - 0xf080; } else - ch = TO_SPECIAL( special_keys[i].vim_code0, - special_keys[i].vim_code1 ); + ch = TO_SPECIAL(special_keys[i].vim_code0, + special_keys[i].vim_code1); } break; } } - if( key->key_mods & Pk_KM_Ctrl ) + if (key->key_mods & Pk_KM_Ctrl) modifiers |= MOD_MASK_CTRL; - if( key->key_mods & Pk_KM_Alt ) + if (key->key_mods & Pk_KM_Alt) modifiers |= MOD_MASK_ALT; - if( key->key_mods & Pk_KM_Shift ) + if (key->key_mods & Pk_KM_Shift) modifiers |= MOD_MASK_SHIFT; /* Is this not a special key? */ - if( special_keys[i].key_sym == 0 ) + if (special_keys[i].key_sym == 0) { - ch = PhTo8859_1( key ); - if( ch == -1 + ch = PhTo8859_1(key); + if (ch == -1 #ifdef FEAT_MBYTE - || ( enc_utf8 && ch > 127 ) + || (enc_utf8 && ch > 127) #endif ) { #ifdef FEAT_MBYTE - len = PhKeyToMb( string, key ); - if( len > 0 ) + len = PhKeyToMb(string, key); + if (len > 0) { static char buf[6]; int src_taken, dst_made; - if( enc_utf8 != TRUE ) + if (enc_utf8 != TRUE) { PxTranslateFromUTF( charset_translate, @@ -2931,13 +2931,13 @@ gui_ph_parse_font_name( name_len = (int_u) ( mark - vim_font ); *font_name = vim_strnsave( vim_font, name_len ); - if( *font_name != NULL ) + if (*font_name != NULL) { - if( mark != NULL ) + if (mark != NULL) { - while( *mark != NUL && *mark++ == ':') + while (*mark != NUL && *mark++ == ':') { - switch( tolower( *mark++ ) ) + switch (tolower(*mark++)) { case 'a': *font_flags |= PF_STYLE_ANTIALIAS; break; case 'b': *font_flags |= PF_STYLE_BOLD; break; @@ -2946,7 +2946,7 @@ gui_ph_parse_font_name( case 's': size = getdigits( &mark ); /* Restrict the size to some vague limits */ - if( size < 1 || size > 100 ) + if (size < 1 || size > 100) size = 8; *font_size = size; @@ -2973,18 +2973,18 @@ gui_mch_init_font(char_u *vim_font_name, int fontset) FontQueryInfo info; PhRect_t extent; - if( vim_font_name == NULL ) + if (vim_font_name == NULL) { /* Default font */ vim_font_name = "PC Terminal"; } - if( STRCMP( vim_font_name, "*" ) == 0 ) + if (STRCMP( vim_font_name, "*" ) == 0) { font_tag = PtFontSelection( gui.vimWindow, NULL, NULL, "pcterm12", -1, PHFONT_FIXED, NULL ); - if( font_tag == NULL ) + if (font_tag == NULL) return FAIL; gui_mch_free_font( gui.norm_font ); @@ -2995,12 +2995,12 @@ gui_mch_init_font(char_u *vim_font_name, int fontset) } else { - if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags, - &font_size ) == FALSE ) + if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags, + &font_size ) == FALSE) return FAIL; font_tag = gui_ph_get_font( font_name, font_flags, font_size, 0 ); - if( font_tag == NULL ) + if (font_tag == NULL) { vim_free( font_name ); return FAIL; @@ -3053,17 +3053,17 @@ gui_mch_get_font(char_u *vim_font_name, int report_error) int_u font_size = 12; int_u font_flags = 0; - if( gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags, - &font_size ) != FALSE ) + if (gui_ph_parse_font_name( vim_font_name, &font_name, &font_flags, + &font_size ) != FALSE) { font_tag = gui_ph_get_font( font_name, font_flags, font_size, -1 ); vim_free( font_name ); - if( font_tag != NULL ) + if (font_tag != NULL) return (GuiFont)font_tag; } - if( report_error ) + if (report_error) EMSG2(e_font, vim_font_name ); return FAIL; diff --git a/src/version.c b/src/version.c index 86addc57ab..4b4a35c422 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 271, /**/ 270, /**/ From 994b223919f9f47f1f28a7a1323b8f0489c19157 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 12:19:04 +0200 Subject: [PATCH 22/86] Added tag v7-3-271 for changeset 32a52f06f33b --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 5e52bc8441..447dc9a01c 100644 --- a/.hgtags +++ b/.hgtags @@ -1605,3 +1605,4 @@ ad404f2a4bfa5374e97f29335f41b7ef34cd6bfa v7-3-267 ee17ee712512451a54046d6bcd3ddb9f70cb5cdf v7-3-268 7f4f5ca70dbde4e31c2de494b982bfb9bd71ed75 v7-3-269 b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 +32a52f06f33b9e2d4817330099b410c1fcf64db2 v7-3-271 From b6f9d20ef4bd6210fb5b2e0f800fb651dbceb1de Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 12:38:08 +0200 Subject: [PATCH 23/86] updated for version 7.3.272 Problem: ":put =list" does not add an empty line for a trailing empty item. Solution: Add a trailing NL when turning a list into a string. --- src/eval.c | 4 ++++ src/version.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/eval.c b/src/eval.c index c29462480d..22779e3b16 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1357,7 +1357,11 @@ eval_to_string(arg, nextcmd, convert) { ga_init2(&ga, (int)sizeof(char), 80); if (tv.vval.v_list != NULL) + { list_join(&ga, tv.vval.v_list, (char_u *)"\n", TRUE, 0); + if (tv.vval.v_list->lv_len > 0) + ga_append(&ga, NL); + } ga_append(&ga, NUL); retval = (char_u *)ga.ga_data; } diff --git a/src/version.c b/src/version.c index 4b4a35c422..63c4c8f335 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 272, /**/ 271, /**/ From 69761f00d2167a5345f55757bcc461cec57e8512 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 12:38:08 +0200 Subject: [PATCH 24/86] Added tag v7-3-272 for changeset 02f5abca10ae --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 447dc9a01c..b41a05d669 100644 --- a/.hgtags +++ b/.hgtags @@ -1606,3 +1606,4 @@ ee17ee712512451a54046d6bcd3ddb9f70cb5cdf v7-3-268 7f4f5ca70dbde4e31c2de494b982bfb9bd71ed75 v7-3-269 b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 32a52f06f33b9e2d4817330099b410c1fcf64db2 v7-3-271 +02f5abca10aee570d5a9cf00928ffaa663daba66 v7-3-272 From 025402ead36d67eee1f6eb01fb57ddb7b2c23165 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 13:21:46 +0200 Subject: [PATCH 25/86] updated for version 7.3.273 Problem: A BOM in an error file is seen as text. (Aleksey Baibarin) Solution: Remove the BOM from the text before evaluating. (idea by Christian Brabandt) --- src/mbyte.c | 21 +++++++++++++++++++++ src/proto/mbyte.pro | 1 + src/quickfix.c | 4 ++++ src/testdir/test10.in | 5 ++++- src/version.c | 2 ++ 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/mbyte.c b/src/mbyte.c index 44d89f7947..da97b346f4 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -837,6 +837,27 @@ bomb_size() return n; } +/* + * Remove all BOM from "s" by moving remaining text. + */ + void +remove_bom(s) + char_u *s; +{ + if (enc_utf8) + { + char_u *p = s; + + while ((p = vim_strbyte(p, 0xef)) != NULL) + { + if (p[1] == 0xbb && p[2] == 0xbf) + STRMOVE(p, p + 3); + else + ++p; + } + } +} + /* * Get class of pointer: * 0 for blank or NUL diff --git a/src/proto/mbyte.pro b/src/proto/mbyte.pro index 88496ccf06..8c0788c7fa 100644 --- a/src/proto/mbyte.pro +++ b/src/proto/mbyte.pro @@ -2,6 +2,7 @@ int enc_canon_props __ARGS((char_u *name)); char_u *mb_init __ARGS((void)); int bomb_size __ARGS((void)); +void remove_bom __ARGS((char_u *s)); int mb_get_class __ARGS((char_u *p)); int dbcs_class __ARGS((unsigned lead, unsigned trail)); int latin_char2len __ARGS((int c)); diff --git a/src/quickfix.c b/src/quickfix.c index 999c66ed9b..17d85837cb 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -561,6 +561,10 @@ qf_init_ext(qi, efile, buf, tv, errorformat, newlist, lnumfirst, lnumlast, break; IObuff[CMDBUFFSIZE - 2] = NUL; /* for very long lines */ +#ifdef FEAT_MBYTE + remove_bom(IObuff); +#endif + if ((efmp = vim_strrchr(IObuff, '\n')) != NULL) *efmp = NUL; #ifdef USE_CRNL diff --git a/src/testdir/test10.in b/src/testdir/test10.in index 6d0c721ddd..0bd6455f18 100644 --- a/src/testdir/test10.in +++ b/src/testdir/test10.in @@ -2,6 +2,9 @@ Test for 'errorformat'. This will fail if the quickfix feature was disabled. STARTTEST :so small.vim +:" Also test a BOM is ignored. +:so mbyte.vim +:set encoding=utf-8 :/start of errorfile/,/end of errorfile/w! Xerrorfile :/start of testfile/,/end of testfile/w! Xtestfile :cf Xerrorfile @@ -20,7 +23,7 @@ ENDTEST start of errorfile "Xtestfile", line 4.12: 1506-045 (S) Undeclared identifier fd_set. -"Xtestfile", line 7 col 19; this is an error +"Xtestfile", line 7 col 19; this is an error gcc -c -DHAVE_CONFIsing-prototypes -I/usr/X11R6/include version.c Xtestfile:13: parse error before `asd' make: *** [vim] Error 1 diff --git a/src/version.c b/src/version.c index 63c4c8f335..60defc7e09 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 273, /**/ 272, /**/ From eae54ba84f43d738e29a71eb9dd9b06bdeaa3335 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 13:21:46 +0200 Subject: [PATCH 26/86] Added tag v7-3-273 for changeset 7d4e5e31d8c1 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index b41a05d669..c58b78e3e1 100644 --- a/.hgtags +++ b/.hgtags @@ -1607,3 +1607,4 @@ ee17ee712512451a54046d6bcd3ddb9f70cb5cdf v7-3-268 b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 32a52f06f33b9e2d4817330099b410c1fcf64db2 v7-3-271 02f5abca10aee570d5a9cf00928ffaa663daba66 v7-3-272 +7d4e5e31d8c10c767cdf774a2b13aedd2f95f096 v7-3-273 From 5ebe10cd56f35f3fe7afa688ba1e3d9d8dbc1428 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 14:32:39 +0200 Subject: [PATCH 27/86] updated for version 7.3.274 Problem: With concealed characters tabs do not have the right size. Solution: Use VCOL_HLC instead of vcol. (Eiichi Sato) --- src/screen.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/screen.c b/src/screen.c index 1726fac82a..40d48ee22f 100644 --- a/src/screen.c +++ b/src/screen.c @@ -4252,7 +4252,7 @@ win_line(wp, lnum, startrow, endrow, nochange) { /* tab amount depends on current column */ n_extra = (int)wp->w_buffer->b_p_ts - - vcol % (int)wp->w_buffer->b_p_ts - 1; + - VCOL_HLC % (int)wp->w_buffer->b_p_ts - 1; #ifdef FEAT_MBYTE mb_utf8 = FALSE; /* don't draw as UTF-8 */ #endif diff --git a/src/version.c b/src/version.c index 60defc7e09..8ae028c868 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 274, /**/ 273, /**/ From e1cd0dfcd017b429a6e322a3985949784e3d18b5 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 14:32:39 +0200 Subject: [PATCH 28/86] Added tag v7-3-274 for changeset 1bb6776fa8c4 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c58b78e3e1..e16979b103 100644 --- a/.hgtags +++ b/.hgtags @@ -1608,3 +1608,4 @@ b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 32a52f06f33b9e2d4817330099b410c1fcf64db2 v7-3-271 02f5abca10aee570d5a9cf00928ffaa663daba66 v7-3-272 7d4e5e31d8c10c767cdf774a2b13aedd2f95f096 v7-3-273 +1bb6776fa8c445e0b3f9dd2ed14fdf2a56f5873e v7-3-274 From af81f033f91ef67b4f370501ad4cdd393954b1b8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 15:56:27 +0200 Subject: [PATCH 29/86] =?UTF-8?q?updated=20for=20version=207.3.275=20Probl?= =?UTF-8?q?em:=20=20=20=20MS-Windows:=20When=20using=20a=20black=20backgro?= =?UTF-8?q?und=20some=20screen=20updates=20=09=20=20=20=20cause=20the=20wi?= =?UTF-8?q?ndow=20to=20flicker.=20Solution:=20=20=20Add=20WS=5FCLIPCHILDRE?= =?UTF-8?q?N=20to=20CreateWindow().=20=20(Ren=C3=A9=20Aguirre)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gui_w32.c | 6 ++++-- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui_w32.c b/src/gui_w32.c index e4d25704f7..0966afe401 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -1379,7 +1379,8 @@ gui_mch_init(void) s_hwnd = CreateWindowEx( WS_EX_MDICHILD, szVimWndClass, "Vim MSWindows GUI", - WS_OVERLAPPEDWINDOW | WS_CHILD | WS_CLIPSIBLINGS | 0xC000, + WS_OVERLAPPEDWINDOW | WS_CHILD + | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | 0xC000, gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x, gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y, 100, /* Any value will do */ @@ -1410,7 +1411,8 @@ gui_mch_init(void) * titlebar, it will be reparented below. */ s_hwnd = CreateWindow( szVimWndClass, "Vim MSWindows GUI", - win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP, + (win_socket_id == 0 ? WS_OVERLAPPEDWINDOW : WS_POPUP) + | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, gui_win_x == -1 ? CW_USEDEFAULT : gui_win_x, gui_win_y == -1 ? CW_USEDEFAULT : gui_win_y, 100, /* Any value will do */ diff --git a/src/version.c b/src/version.c index 8ae028c868..1d8b4109cb 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 275, /**/ 274, /**/ From 2fc242e6ccb5a5434cf5baba23e7d8460d712bdc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 15:56:27 +0200 Subject: [PATCH 30/86] Added tag v7-3-275 for changeset 125c7bf52271 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index e16979b103..49fbdb6c24 100644 --- a/.hgtags +++ b/.hgtags @@ -1609,3 +1609,4 @@ b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 02f5abca10aee570d5a9cf00928ffaa663daba66 v7-3-272 7d4e5e31d8c10c767cdf774a2b13aedd2f95f096 v7-3-273 1bb6776fa8c445e0b3f9dd2ed14fdf2a56f5873e v7-3-274 +125c7bf52271461dfbf46cc33317eadc67aaf742 v7-3-275 From a44e66647ea848330589272af35ec786811b92fc Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 16:31:23 +0200 Subject: [PATCH 31/86] updated for version 7.3.276 Problem: GvimExt sets $LANG in the wrong way. Solution: Save the environment and use it for gvim. (Yasuhiro Matsumoto) --- src/GvimExt/gvimext.cpp | 20 ++++++++++++++------ src/version.c | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/GvimExt/gvimext.cpp b/src/GvimExt/gvimext.cpp index 7c7ec99d3f..975453cafa 100644 --- a/src/GvimExt/gvimext.cpp +++ b/src/GvimExt/gvimext.cpp @@ -142,6 +142,7 @@ static char *null_libintl_bindtextdomain(const char *, const char *); static int dyn_libintl_init(char *dir); static void dyn_libintl_end(void); +static wchar_t *oldenv = NULL; static HINSTANCE hLibintlDLL = 0; static char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext; static char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain; @@ -339,8 +340,10 @@ DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /* lpReserved */) inc_cRefThisDLL() { #ifdef FEAT_GETTEXT - if (g_cRefThisDll == 0) + if (g_cRefThisDll == 0) { dyn_gettext_load(); + oldenv = GetEnvironmentStringsW(); + } #endif InterlockedIncrement((LPLONG)&g_cRefThisDll); } @@ -349,8 +352,13 @@ inc_cRefThisDLL() dec_cRefThisDLL() { #ifdef FEAT_GETTEXT - if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) + if (InterlockedDecrement((LPLONG)&g_cRefThisDll) == 0) { dyn_gettext_free(); + if (oldenv != NULL) { + FreeEnvironmentStringsW(oldenv); + oldenv = NULL; + } + } #else InterlockedDecrement((LPLONG)&g_cRefThisDll); #endif @@ -905,8 +913,8 @@ STDMETHODIMP CShellExt::InvokeGvim(HWND hParent, NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. - 0, // No creation flags. - NULL, // Use parent's environment block. + oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT, + oldenv, // Use unmodified environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi) // Pointer to PROCESS_INFORMATION structure. @@ -987,8 +995,8 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent, NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. - 0, // No creation flags. - NULL, // Use parent's environment block. + oldenv == NULL ? 0 : CREATE_UNICODE_ENVIRONMENT, + oldenv, // Use unmodified environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi) // Pointer to PROCESS_INFORMATION structure. diff --git a/src/version.c b/src/version.c index 1d8b4109cb..cdbde1248e 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 276, /**/ 275, /**/ From 9b6d1038ba89bc080a0a775dbf00e9b27f6c20ee Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 16:31:24 +0200 Subject: [PATCH 32/86] Added tag v7-3-276 for changeset 37a54a85413e --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 49fbdb6c24..aa60338586 100644 --- a/.hgtags +++ b/.hgtags @@ -1610,3 +1610,4 @@ b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 7d4e5e31d8c10c767cdf774a2b13aedd2f95f096 v7-3-273 1bb6776fa8c445e0b3f9dd2ed14fdf2a56f5873e v7-3-274 125c7bf52271461dfbf46cc33317eadc67aaf742 v7-3-275 +37a54a85413eae68932233e64a0ab88c99c9d811 v7-3-276 From 4f487cb1a03b9cdbcc0471ca697cb01a0707658c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 17:08:03 +0200 Subject: [PATCH 33/86] updated for version 7.3.277 Problem: MS-Windows: some characters do not show in dialogs. Solution: Use the wide methods when available. (Yanwei Jia) --- src/gui_w32.c | 19 +++++++++++++++++++ src/gui_w48.c | 20 ++++++++++---------- src/os_mswin.c | 10 +++++----- src/os_win32.c | 12 ++++++++++-- src/os_win32.h | 14 ++++++++++++++ src/version.c | 2 ++ 6 files changed, 60 insertions(+), 17 deletions(-) diff --git a/src/gui_w32.c b/src/gui_w32.c index 0966afe401..4a34cb4f2d 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -1270,6 +1270,25 @@ gui_mch_prepare(int *argc, char **argv) pGetMonitorInfo = (TGetMonitorInfo)GetProcAddress(user32_lib, "GetMonitorInfoA"); } + +#ifdef FEAT_MBYTE + /* If the OS is Windows NT, use wide functions; + * this enables common dialogs input unicode from IME. */ + if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT) + { + pDispatchMessage = DispatchMessageW; + pGetMessage = GetMessageW; + pIsDialogMessage = IsDialogMessageW; + pPeekMessage = PeekMessageW; + } + else + { + pDispatchMessage = DispatchMessageA; + pGetMessage = GetMessageA; + pIsDialogMessage = IsDialogMessageA; + pPeekMessage = PeekMessageA; + } +#endif } /* diff --git a/src/gui_w48.c b/src/gui_w48.c index 445104dae0..4667dc7aad 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -390,7 +390,7 @@ _OnBlinkTimer( KillTimer(NULL, idEvent); /* Eat spurious WM_TIMER messages */ - while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) + while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; if (blink_state == BLINK_ON) @@ -418,7 +418,7 @@ gui_mswin_rm_blink_timer(void) { KillTimer(NULL, blink_timer); /* Eat spurious WM_TIMER messages */ - while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) + while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; blink_timer = 0; } @@ -476,7 +476,7 @@ _OnTimer( s_timed_out = TRUE; /* Eat spurious WM_TIMER messages */ - while (PeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) + while (pPeekMessage(&msg, hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; if (idEvent == s_wait_timer) s_wait_timer = 0; @@ -1707,7 +1707,7 @@ process_message(void) static char_u k10[] = {K_SPECIAL, 'k', ';', 0}; #endif - GetMessage(&msg, NULL, 0, 0); + pGetMessage(&msg, NULL, 0, 0); #ifdef FEAT_OLE /* Look after OLE Automation commands */ @@ -1718,7 +1718,7 @@ process_message(void) { /* Message can't be ours, forward it. Fixes problem with Ultramon * 3.0.4 */ - DispatchMessage(&msg); + pDispatchMessage(&msg); } else { @@ -1749,14 +1749,14 @@ process_message(void) if (msg.message == WM_USER) { MyTranslateMessage(&msg); - DispatchMessage(&msg); + pDispatchMessage(&msg); return; } #endif #ifdef MSWIN_FIND_REPLACE /* Don't process messages used by the dialog */ - if (s_findrep_hwnd != NULL && IsDialogMessage(s_findrep_hwnd, &msg)) + if (s_findrep_hwnd != NULL && pIsDialogMessage(s_findrep_hwnd, &msg)) { HandleMouseHide(msg.message, msg.lParam); return; @@ -1928,7 +1928,7 @@ process_message(void) if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE, NULL, NULL) == NULL) #endif - DispatchMessage(&msg); + pDispatchMessage(&msg); } /* @@ -1943,7 +1943,7 @@ gui_mch_update(void) MSG msg; if (!s_busy_processing) - while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) + while (pPeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) && !vim_is_input_buf_full()) process_message(); } @@ -2019,7 +2019,7 @@ gui_mch_wait_for_chars(int wtime) KillTimer(NULL, s_wait_timer); /* Eat spurious WM_TIMER messages */ - while (PeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) + while (pPeekMessage(&msg, s_hwnd, WM_TIMER, WM_TIMER, PM_REMOVE)) ; s_wait_timer = 0; } diff --git a/src/os_mswin.c b/src/os_mswin.c index 1c1348a4e7..49b142895b 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -1856,12 +1856,12 @@ AbortProc(HDC hdcPrn, int iCode) { MSG msg; - while (!*bUserAbort && PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (!*bUserAbort && pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - if (!hDlgPrint || !IsDialogMessage(hDlgPrint, &msg)) + if (!hDlgPrint || !pIsDialogMessage(hDlgPrint, &msg)) { TranslateMessage(&msg); - DispatchMessage(&msg); + pDispatchMessage(&msg); } } return !*bUserAbort; @@ -3132,10 +3132,10 @@ serverProcessPendingMessages(void) { MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) + while (pPeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + pDispatchMessage(&msg); } } diff --git a/src/os_win32.c b/src/os_win32.c index 88ead6fd63..0d8bbf7d38 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -152,6 +152,14 @@ static PFNGCKLN s_pfnGetConsoleKeyboardLayoutName = NULL; # define wcsicmp(a, b) wcscmpi((a), (b)) #endif +/* Enable common dialogs input unicode from IME if posible. */ +#ifdef FEAT_MBYTE +LRESULT (WINAPI *pDispatchMessage)(LPMSG) = DispatchMessage; +BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT) = GetMessage; +BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG) = IsDialogMessage; +BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT) = PeekMessage; +#endif + #ifndef FEAT_GUI_W32 /* Win32 Console handles for input and output */ static HANDLE g_hConIn = INVALID_HANDLE_VALUE; @@ -3284,10 +3292,10 @@ mch_system_classic(char *cmd, int options) { MSG msg; - if (PeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) + if (pPeekMessage(&msg, (HWND)NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + pDispatchMessage(&msg); } if (WaitForSingleObject(pi.hProcess, delay) != WAIT_TIMEOUT) break; diff --git a/src/os_win32.h b/src/os_win32.h index 41a44bf0d7..5303d6ddcc 100644 --- a/src/os_win32.h +++ b/src/os_win32.h @@ -193,3 +193,17 @@ Trace(char *pszFormat, ...); #else # define vim_mkdir(x, y) mch_mkdir(x) #endif + +/* Enable common dialogs input unicode from IME if posible. */ +#ifdef FEAT_MBYTE + /* The variables are defined in os_win32.c. */ +extern LRESULT (WINAPI *pDispatchMessage)(LPMSG); +extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT); +extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG); +extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT); +#else +# define pDispatchMessage DispatchMessage +# define pGetMessage GetMessage +# define pIsDialogMessage IsDialogMessage +# define pPeekMessage PeekMessage +#endif diff --git a/src/version.c b/src/version.c index cdbde1248e..517310e2cd 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 277, /**/ 276, /**/ From b26f0fb957d7abc7e79c2d127af105778c14ac40 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 17:08:03 +0200 Subject: [PATCH 34/86] Added tag v7-3-277 for changeset e5b17a5f6516 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index aa60338586..8ac3b64cc0 100644 --- a/.hgtags +++ b/.hgtags @@ -1611,3 +1611,4 @@ b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 1bb6776fa8c445e0b3f9dd2ed14fdf2a56f5873e v7-3-274 125c7bf52271461dfbf46cc33317eadc67aaf742 v7-3-275 37a54a85413eae68932233e64a0ab88c99c9d811 v7-3-276 +e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 From 4cc118bb3d4d5ca8f36b049cf063bdf4ce9fb4d6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 17:25:51 +0200 Subject: [PATCH 35/86] updated for version 7.3.278 Problem: Passing the file name to open in VisVim doesn't work. Solution: Adjust the index and check for end of buffer. (Jiri Sedlak) --- src/VisVim/Commands.cpp | 5 ++--- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/VisVim/Commands.cpp b/src/VisVim/Commands.cpp index a346dea702..111b163c42 100644 --- a/src/VisVim/Commands.cpp +++ b/src/VisVim/Commands.cpp @@ -549,7 +549,7 @@ static BOOL VimOpenFile(BSTR& FileName, long LineNr) if (g_bNewTabs) { sprintf(VimCmd, ":tab drop "); - s = VimCmd + 11; + s = VimCmd + 10; } else { @@ -557,8 +557,7 @@ static BOOL VimOpenFile(BSTR& FileName, long LineNr) s = VimCmd + 6; } sprintf(FileNameTmp, "%S", (char *)FileName); - for (p = FileNameTmp; *p != '\0' && s < FileNameTmp + MAX_OLE_STR - 4; - ++p) + for (p = FileNameTmp; *p != '\0' && s < VimCmd + MAX_OLE_STR - 4; ++p) if (*p == '\\') *s++ = '/'; else diff --git a/src/version.c b/src/version.c index 517310e2cd..e009b8575e 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 278, /**/ 277, /**/ From aa016a5bfe8749c5858a842abb0976b0ea9b7a90 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 17:25:52 +0200 Subject: [PATCH 36/86] Added tag v7-3-278 for changeset 6622f28b7e87 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 8ac3b64cc0..b329a3b6d4 100644 --- a/.hgtags +++ b/.hgtags @@ -1612,3 +1612,4 @@ b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 125c7bf52271461dfbf46cc33317eadc67aaf742 v7-3-275 37a54a85413eae68932233e64a0ab88c99c9d811 v7-3-276 e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 +6622f28b7e87a93de6f1520945d1c5d2a1fc0dab v7-3-278 From ee5543b7dedaf88f25a772da8af8ee1681445b22 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 17:44:45 +0200 Subject: [PATCH 37/86] updated for version 7.3.279 Problem: With GTK, when gvim is full-screen and a tab is opened and using a specific monitor configuration the window is too big. Solution: Adjust the window size like on MS-Windows. (Yukihiro Nakadaira) --- src/gui.c | 2 +- src/gui_gtk_x11.c | 22 ++++++++++++++++------ src/proto/gui_gtk_x11.pro | 1 + src/version.c | 2 ++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/gui.c b/src/gui.c index d7024a82f5..a4e2bfe971 100644 --- a/src/gui.c +++ b/src/gui.c @@ -1407,7 +1407,7 @@ gui_set_shellsize(mustset, fit_to_display, direction) if (!gui.shell_created) return; -#ifdef MSWIN +#if defined(MSWIN) || defined(FEAT_GUI_GTK) /* If not setting to a user specified size and maximized, calculate the * number of characters that fit in the maximized window. */ if (!mustset && gui_mch_maximized()) diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 9d95f1a48b..e2f9fc5be0 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -3899,6 +3899,21 @@ gui_mch_unmaximize() gtk_window_unmaximize(GTK_WINDOW(gui.mainwin)); } +/* + * Called when the font changed while the window is maximized. Compute the + * new Rows and Columns. This is like resizing the window. + */ + void +gui_mch_newfont() +{ + int w, h; + + gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h); + w -= get_menu_tool_width(); + h -= get_menu_tool_height(); + gui_resize_shell(w, h); +} + /* * Set the windows size. */ @@ -4409,14 +4424,9 @@ gui_mch_init_font(char_u *font_name, int fontset UNUSED) if (gui_mch_maximized()) { - int w, h; - /* Update lines and columns in accordance with the new font, keep the * window maximized. */ - gtk_window_get_size(GTK_WINDOW(gui.mainwin), &w, &h); - w -= get_menu_tool_width(); - h -= get_menu_tool_height(); - gui_resize_shell(w, h); + gui_mch_newfont(); } else { diff --git a/src/proto/gui_gtk_x11.pro b/src/proto/gui_gtk_x11.pro index 2484082b79..e395a0cfe6 100644 --- a/src/proto/gui_gtk_x11.pro +++ b/src/proto/gui_gtk_x11.pro @@ -20,6 +20,7 @@ int gui_mch_get_winpos __ARGS((int *x, int *y)); void gui_mch_set_winpos __ARGS((int x, int y)); int gui_mch_maximized __ARGS((void)); void gui_mch_unmaximize __ARGS((void)); +void gui_mch_newfont __ARGS((void)); void gui_mch_set_shellsize __ARGS((int width, int height, int min_width, int min_height, int base_width, int base_height, int direction)); void gui_mch_get_screen_dimensions __ARGS((int *screen_w, int *screen_h)); void gui_mch_settitle __ARGS((char_u *title, char_u *icon)); diff --git a/src/version.c b/src/version.c index e009b8575e..8ef4fac0bb 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 279, /**/ 278, /**/ From a4fc0ce9eb255a5ffbb3b07d173cbeece9454c58 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 17:44:45 +0200 Subject: [PATCH 38/86] Added tag v7-3-279 for changeset 342b17608967 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index b329a3b6d4..fc205022c5 100644 --- a/.hgtags +++ b/.hgtags @@ -1613,3 +1613,4 @@ b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 37a54a85413eae68932233e64a0ab88c99c9d811 v7-3-276 e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 6622f28b7e87a93de6f1520945d1c5d2a1fc0dab v7-3-278 +342b176089678e86cde3e1afac4aaaa1e5153f99 v7-3-279 From 9f368a11b23fc7bee232fe7eea3b6fad8719c735 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 18:36:54 +0200 Subject: [PATCH 39/86] updated for version 7.3.280 Problem: ":lmake" does not update the quickfix window title. Solution: Update the title. (Lech Lorens) --- src/quickfix.c | 24 ++++++++++++++++++++++-- src/testdir/test10.in | 18 ++++++++++++++++-- src/testdir/test10.ok | 4 ++-- src/version.c | 2 ++ 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/quickfix.c b/src/quickfix.c index 17d85837cb..0502392c92 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -126,6 +126,7 @@ static int is_qf_win __ARGS((win_T *win, qf_info_T *qi)); static win_T *qf_find_win __ARGS((qf_info_T *qi)); static buf_T *qf_find_buf __ARGS((qf_info_T *qi)); static void qf_update_buffer __ARGS((qf_info_T *qi)); +static void qf_set_title __ARGS((qf_info_T *qi)); static void qf_fill_buffer __ARGS((qf_info_T *qi)); #endif static char_u *get_mef_name __ARGS((void)); @@ -2388,8 +2389,7 @@ ex_copen(eap) qf_fill_buffer(qi); if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) - set_internal_string_var((char_u *)"w:quickfix_title", - qi->qf_lists[qi->qf_curlist].qf_title); + qf_set_title(qi); curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index; curwin->w_cursor.col = 0; @@ -2526,6 +2526,8 @@ qf_update_buffer(qi) qf_info_T *qi; { buf_T *buf; + win_T *win; + win_T *curwin_save; aco_save_T aco; /* Check if a buffer for the quickfix list exists. Update it. */ @@ -2537,6 +2539,16 @@ qf_update_buffer(qi) qf_fill_buffer(qi); + if (qi->qf_lists[qi->qf_curlist].qf_title != NULL + && (win = qf_find_win(qi)) != NULL) + { + curwin_save = curwin; + curwin = win; + qf_set_title(qi); + curwin = curwin_save; + + } + /* restore curwin/curbuf and a few other things */ aucmd_restbuf(&aco); @@ -2544,6 +2556,14 @@ qf_update_buffer(qi) } } + static void +qf_set_title(qi) + qf_info_T *qi; +{ + set_internal_string_var((char_u *)"w:quickfix_title", + qi->qf_lists[qi->qf_curlist].qf_title); +} + /* * Fill current buffer with quickfix errors, replacing any previous contents. * curbuf must be the quickfix buffer! diff --git a/src/testdir/test10.in b/src/testdir/test10.in index 0bd6455f18..50ef86eb0c 100644 --- a/src/testdir/test10.in +++ b/src/testdir/test10.in @@ -5,9 +5,16 @@ STARTTEST :" Also test a BOM is ignored. :so mbyte.vim :set encoding=utf-8 -:/start of errorfile/,/end of errorfile/w! Xerrorfile +:7/start of errorfile/,/end of errorfile/w! Xerrorfile1 +:7/start of errorfile/,/end of errorfile/-1w! Xerrorfile2 :/start of testfile/,/end of testfile/w! Xtestfile -:cf Xerrorfile +:cf Xerrorfile2 +:clast +:copen +:let a=w:quickfix_title +:wincmd p +gR=a  +:cf Xerrorfile1 rA :cn rB @@ -17,6 +24,11 @@ rC rD :cn rE +:cn +:wincmd w +:let a=w:quickfix_title +:wincmd p +gR=a  :w! test.out " Write contents of this file :qa! ENDTEST @@ -33,6 +45,8 @@ in file "Xtestfile" linenr 16: there is an error "Xtestfile", linenr 19: yet another problem Does anyone know what is the problem and how to correction it? +"Xtestfile", line 21 col 9: What is the title of the quickfix window? +"Xtestfile", line 22 col 9: What is the title of the quickfix window? end of errorfile start of testfile diff --git a/src/testdir/test10.ok b/src/testdir/test10.ok index 2c86889c18..01d47e8f35 100644 --- a/src/testdir/test10.ok +++ b/src/testdir/test10.ok @@ -18,6 +18,6 @@ line 17 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 18 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Eine 19 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx line 20 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -line 21 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -line 22 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +line 21 :cf Xerrorfile1xxxxxxxxxxxxxxx +line 22 :cf Xerrorfile2xxxxxxxxxxxxxxx end of testfile diff --git a/src/version.c b/src/version.c index 8ef4fac0bb..133037690c 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 280, /**/ 279, /**/ From 50a0c80dd73c6e78fe56b1fe615953efc2fa0158 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 10 Aug 2011 18:36:54 +0200 Subject: [PATCH 40/86] Added tag v7-3-280 for changeset 58bba69b3371 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index fc205022c5..f4fa5220b4 100644 --- a/.hgtags +++ b/.hgtags @@ -1614,3 +1614,4 @@ b9182da84c7eeda221e5219ef4361cca201b3b41 v7-3-270 e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 6622f28b7e87a93de6f1520945d1c5d2a1fc0dab v7-3-278 342b176089678e86cde3e1afac4aaaa1e5153f99 v7-3-279 +58bba69b3371d9ff02b27fe24f044e229c8aa99a v7-3-280 From 252510d3df13c923a0d04e259e4488f615573373 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 15:23:23 +0200 Subject: [PATCH 41/86] updated for version 7.3.281 Problem: After using "expand('%:8')" the buffer name is changed. Solution: Make a copy of the file name before shortening it. --- src/eval.c | 24 ++++++++++++------------ src/version.c | 2 ++ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/eval.c b/src/eval.c index 22779e3b16..e9ab0359a8 100644 --- a/src/eval.c +++ b/src/eval.c @@ -23205,6 +23205,7 @@ modify_fname(src, usedlen, fnamep, bufp, fnamelen) int c; int has_fullname = 0; #ifdef WIN3264 + char_u *fname_start = *fnamep; int has_shortname = 0; #endif @@ -23379,24 +23380,25 @@ repeat: } #ifdef WIN3264 - /* Check shortname after we have done 'heads' and before we do 'tails' + /* + * Handle ":8" after we have done 'heads' and before we do 'tails'. */ if (has_shortname) { - pbuf = NULL; - /* Copy the string if it is shortened by :h */ - if (*fnamelen < (int)STRLEN(*fnamep)) + /* Copy the string if it is shortened by :h and when it wasn't copied + * yet, because we are going to change it in place. Avoids changing + * the buffer name for "%:8". */ + if (*fnamelen < (int)STRLEN(*fnamep) || *fnamep == fname_start) { p = vim_strnsave(*fnamep, *fnamelen); - if (p == 0) + if (p == NULL) return -1; vim_free(*bufp); *bufp = *fnamep = p; } /* Split into two implementations - makes it easier. First is where - * there isn't a full name already, second is where there is. - */ + * there isn't a full name already, second is where there is. */ if (!has_fullname && !vim_isAbsName(*fnamep)) { if (shortpath_for_partial(fnamep, bufp, fnamelen) == FAIL) @@ -23404,18 +23406,16 @@ repeat: } else { - int l; + int l = *fnamelen; - /* Simple case, already have the full-name + /* Simple case, already have the full-name. * Nearly always shorter, so try first time. */ - l = *fnamelen; if (get_short_pathname(fnamep, bufp, &l) == FAIL) return -1; if (l == 0) { - /* Couldn't find the filename.. search the paths. - */ + /* Couldn't find the filename, search the paths. */ l = *fnamelen; if (shortpath_for_invalid_fname(fnamep, bufp, &l) == FAIL) return -1; diff --git a/src/version.c b/src/version.c index 133037690c..35a5479d6a 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 281, /**/ 280, /**/ From f4bbe1b24d080c52e39a62fc81f4c3738566660b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 15:23:23 +0200 Subject: [PATCH 42/86] Added tag v7-3-281 for changeset 45ead8a0bede --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index f4fa5220b4..6738dc7a65 100644 --- a/.hgtags +++ b/.hgtags @@ -1615,3 +1615,4 @@ e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 6622f28b7e87a93de6f1520945d1c5d2a1fc0dab v7-3-278 342b176089678e86cde3e1afac4aaaa1e5153f99 v7-3-279 58bba69b3371d9ff02b27fe24f044e229c8aa99a v7-3-280 +45ead8a0bedeade57c320d72e9f710a703e61cf0 v7-3-281 From f55f73cb3089297ddfddf532c412a35916f4a03a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 16:25:48 +0200 Subject: [PATCH 43/86] updated for version 7.3.282 Problem: When using input() and :echo in a loop the displayed text is incorrect. (Benjamin Fritz) Solution: Only restore the cursor position when there is a command line. (Ben Schmidt) --- src/ex_getln.c | 8 ++++++-- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ex_getln.c b/src/ex_getln.c index ed0082c132..8239c0c877 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -1969,8 +1969,12 @@ getcmdline_prompt(firstc, prompt, attr, xp_context, xp_arg) # endif s = getcmdline(firstc, 1L, 0); restore_cmdline(&save_ccline); - /* Restore msg_col, the prompt from input() may have changed it. */ - msg_col = msg_col_save; + /* Restore msg_col, the prompt from input() may have changed it. + * But only if called recursively and the commandline is therefore being + * restored to an old one; if not, the input() prompt stays on the screen, + * so we need its modified msg_col left intact. */ + if (ccline.cmdbuff != NULL) + msg_col = msg_col_save; return s; } diff --git a/src/version.c b/src/version.c index 35a5479d6a..f9760e9a88 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 282, /**/ 281, /**/ From f226625aefa68ccb2fbabfc0f1ffe42472f883b9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 16:25:48 +0200 Subject: [PATCH 44/86] Added tag v7-3-282 for changeset 92167bb91c95 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 6738dc7a65..527705b1cf 100644 --- a/.hgtags +++ b/.hgtags @@ -1616,3 +1616,4 @@ e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 342b176089678e86cde3e1afac4aaaa1e5153f99 v7-3-279 58bba69b3371d9ff02b27fe24f044e229c8aa99a v7-3-280 45ead8a0bedeade57c320d72e9f710a703e61cf0 v7-3-281 +92167bb91c95410a0550ff8c94370307bb7d9d80 v7-3-282 From 9404aab7e5c6ee916dfae1766cc578d30735b38f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 17:18:20 +0200 Subject: [PATCH 45/86] updated for version 7.3.283 Problem: An expression mapping with a multi-byte character containing a 0x80 byte gets messed up. (ZyX) Solution: Unescape the expression before evaluating it (Yukihiro Nakadaira) --- src/getchar.c | 20 +++++++++++++++++--- src/version.c | 2 ++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/getchar.c b/src/getchar.c index 0437e94af6..697eb3142e 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3262,9 +3262,9 @@ do_map(maptype, arg, mode, abbrev) validate_maphash(); /* - * find end of keys and skip CTRL-Vs (and backslashes) in it + * Find end of keys and skip CTRL-Vs (and backslashes) in it. * Accept backslash like CTRL-V when 'cpoptions' does not contain 'B'. - * with :unmap white space is included in the keys, no argument possible + * with :unmap white space is included in the keys, no argument possible. */ p = keys; do_backslash = (vim_strchr(p_cpo, CPO_BSLASH) == NULL); @@ -4506,12 +4506,23 @@ eval_map_expr(str, c) { char_u *res; char_u *p; + char_u *expr; char_u *save_cmd; pos_T save_cursor; + /* Remove escaping of CSI, because "str" is in a format to be used as + * typeahead. */ + expr = vim_strsave(str); + if (expr == NULL) + return NULL; + vim_unescape_csi(expr); + save_cmd = save_cmdline_alloc(); if (save_cmd == NULL) + { + vim_free(expr); return NULL; + } /* Forbid changing text or using ":normal" to avoid most of the bad side * effects. Also restore the cursor position. */ @@ -4521,7 +4532,7 @@ eval_map_expr(str, c) #endif set_vim_var_char(c); /* set v:char to the typed character */ save_cursor = curwin->w_cursor; - p = eval_to_string(str, NULL, FALSE); + p = eval_to_string(expr, NULL, FALSE); --textlock; #ifdef FEAT_EX_EXTRA --ex_normal_lock; @@ -4529,8 +4540,11 @@ eval_map_expr(str, c) curwin->w_cursor = save_cursor; restore_cmdline_alloc(save_cmd); + vim_free(expr); + if (p == NULL) return NULL; + /* Escape CSI in the result to be able to use the string as typeahead. */ res = vim_strsave_escape_csi(p); vim_free(p); diff --git a/src/version.c b/src/version.c index f9760e9a88..b5fe5aa1a1 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 283, /**/ 282, /**/ From bc4b1d2485c5c2d5b7787be0f99ff823a3cba2ab Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 17:18:20 +0200 Subject: [PATCH 46/86] Added tag v7-3-283 for changeset 47b6d37b6012 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index 527705b1cf..c05e325ebf 100644 --- a/.hgtags +++ b/.hgtags @@ -1617,3 +1617,4 @@ e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 58bba69b3371d9ff02b27fe24f044e229c8aa99a v7-3-280 45ead8a0bedeade57c320d72e9f710a703e61cf0 v7-3-281 92167bb91c95410a0550ff8c94370307bb7d9d80 v7-3-282 +47b6d37b60122f45eb147106b8da1322c1cdbc60 v7-3-283 From a73d723be84cd95595f00e9f68b235f0e018e4b7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 20:33:22 +0200 Subject: [PATCH 47/86] updated for version 7.3.284 Problem: The str2special() function doesn't handle multi-byte characters properly. Solution: Recognize multi-byte characters. (partly by Vladimir Vichniakov) --- src/getchar.c | 12 +++++++++++- src/message.c | 21 ++++++++++++++++----- src/misc2.c | 43 ++++++++++++++++++++++++++++++------------- src/version.c | 2 ++ 4 files changed, 59 insertions(+), 19 deletions(-) diff --git a/src/getchar.c b/src/getchar.c index 697eb3142e..16bf65a0b9 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3964,7 +3964,17 @@ showmap(mp, local) if (*mp->m_str == NUL) msg_puts_attr((char_u *)"", hl_attr(HLF_8)); else - msg_outtrans_special(mp->m_str, FALSE); + { + /* Remove escaping of CSI, because "m_str" is in a format to be used + * as typeahead. */ + char_u *s = vim_strsave(mp->m_str); + if (s != NULL) + { + vim_unescape_csi(s); + msg_outtrans_special(s, FALSE); + vim_free(s); + } + } #ifdef FEAT_EVAL if (p_verbose > 0) last_set_msg(mp->m_script_ID); diff --git a/src/message.c b/src/message.c index 89248b4cf0..76bf69d6d7 100644 --- a/src/message.c +++ b/src/message.c @@ -1547,16 +1547,27 @@ str2special(sp, from) if (IS_SPECIAL(c) || modifiers) /* special key */ special = TRUE; } - *sp = str + 1; #ifdef FEAT_MBYTE - /* For multi-byte characters check for an illegal byte. */ - if (has_mbyte && MB_BYTE2LEN(*str) > (*mb_ptr2len)(str)) + if (has_mbyte && !IS_SPECIAL(c)) { - transchar_nonprint(buf, c); - return buf; + int len = (*mb_ptr2len)(str); + + /* For multi-byte characters check for an illegal byte. */ + if (has_mbyte && MB_BYTE2LEN(*str) > len) + { + transchar_nonprint(buf, c); + *sp = str + 1; + return buf; + } + /* Since 'special' is TRUE the multi-byte character 'c' will be + * processed by get_special_key_name() */ + c = (*mb_ptr2char)(str); + *sp = str + len; } + else #endif + *sp = str + 1; /* Make unprintable characters in <> form, also and . * Use only for lhs of a mapping. */ diff --git a/src/misc2.c b/src/misc2.c index f91a64aced..dbcd653c1f 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -2754,6 +2754,7 @@ find_special_key(srcp, modp, keycode, keep_x_key) int bit; int key; unsigned long n; + int l; src = *srcp; if (src[0] != '<') @@ -2766,8 +2767,17 @@ find_special_key(srcp, modp, keycode, keep_x_key) if (*bp == '-') { last_dash = bp; - if (bp[1] != NUL && bp[2] == '>') - ++bp; /* anything accepted, like */ + if (bp[1] != NUL) + { +#ifdef FEAT_MBYTE + if (has_mbyte) + l = mb_ptr2len(bp + 1); + else +#endif + l = 1; + if (bp[l + 1] == '>') + bp += l; /* anything accepted, like */ + } } if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) bp += 3; /* skip t_xx, xx may be '-' or '>' */ @@ -2777,15 +2787,6 @@ find_special_key(srcp, modp, keycode, keep_x_key) { end_of_name = bp + 1; - if (STRNICMP(src + 1, "char-", 5) == 0 && VIM_ISDIGIT(src[6])) - { - /* or or */ - vim_str2nr(src + 6, NULL, NULL, TRUE, TRUE, NULL, &n); - *modp = 0; - *srcp = end_of_name; - return (int)n; - } - /* Which modifiers are given? */ modifiers = 0x0; for (bp = src + 1; bp < last_dash; bp++) @@ -2804,11 +2805,27 @@ find_special_key(srcp, modp, keycode, keep_x_key) */ if (bp >= last_dash) { + if (STRNICMP(last_dash + 1, "char-", 5) == 0 + && VIM_ISDIGIT(last_dash[6])) + { + /* or or */ + vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n); + *modp = modifiers; + *srcp = end_of_name; + return (int)n; + } + /* * Modifier with single letter, or special key name. */ - if (modifiers != 0 && last_dash[2] == '>') - key = last_dash[1]; +#ifdef FEAT_MBYTE + if (has_mbyte) + l = mb_ptr2len(last_dash + 1); + else +#endif + l = 1; + if (modifiers != 0 && last_dash[l + 1] == '>') + key = PTR2CHAR(last_dash + 1); else { key = get_special_key_code(last_dash + 1); diff --git a/src/version.c b/src/version.c index b5fe5aa1a1..650e99f7bf 100644 --- a/src/version.c +++ b/src/version.c @@ -709,6 +709,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 284, /**/ 283, /**/ From 24c79f8574623e8c58f41f9e32937adc339ef528 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 17 Aug 2011 20:33:23 +0200 Subject: [PATCH 48/86] Added tag v7-3-284 for changeset 27d43855b723 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index c05e325ebf..e6f3fdba44 100644 --- a/.hgtags +++ b/.hgtags @@ -1618,3 +1618,4 @@ e5b17a5f651696ad4c523a21822692115d371250 v7-3-277 45ead8a0bedeade57c320d72e9f710a703e61cf0 v7-3-281 92167bb91c95410a0550ff8c94370307bb7d9d80 v7-3-282 47b6d37b60122f45eb147106b8da1322c1cdbc60 v7-3-283 +27d43855b72312500e6fc2122e167a579a1f35f2 v7-3-284 From 36083d9981ff4ed30a0050158d1a693af43e8046 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 19 Aug 2011 22:29:02 +0200 Subject: [PATCH 49/86] updated for version 7.3.285 Problem: Mapping no longer works. Solution: Properly check for "char-". Add a test for it. --- src/misc2.c | 42 ++++++++++++++++++++++++------------------ src/testdir/test75.in | 6 ++++++ src/testdir/test75.ok | 2 ++ src/version.c | 2 ++ 4 files changed, 34 insertions(+), 18 deletions(-) diff --git a/src/misc2.c b/src/misc2.c index dbcd653c1f..4c05a8cb85 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -2781,6 +2781,12 @@ find_special_key(srcp, modp, keycode, keep_x_key) } if (bp[0] == 't' && bp[1] == '_' && bp[2] && bp[3]) bp += 3; /* skip t_xx, xx may be '-' or '>' */ + else if (STRNICMP(bp, "char-", 5) == 0) + { + vim_str2nr(bp + 5, NULL, &l, TRUE, TRUE, NULL, NULL); + bp += l + 5; + break; + } } if (*bp == '>') /* found matching '>' */ @@ -2810,27 +2816,27 @@ find_special_key(srcp, modp, keycode, keep_x_key) { /* or or */ vim_str2nr(last_dash + 6, NULL, NULL, TRUE, TRUE, NULL, &n); - *modp = modifiers; - *srcp = end_of_name; - return (int)n; + key = (int)n; } - - /* - * Modifier with single letter, or special key name. - */ -#ifdef FEAT_MBYTE - if (has_mbyte) - l = mb_ptr2len(last_dash + 1); - else -#endif - l = 1; - if (modifiers != 0 && last_dash[l + 1] == '>') - key = PTR2CHAR(last_dash + 1); else { - key = get_special_key_code(last_dash + 1); - if (!keep_x_key) - key = handle_x_keys(key); + /* + * Modifier with single letter, or special key name. + */ +#ifdef FEAT_MBYTE + if (has_mbyte) + l = mb_ptr2len(last_dash + 1); + else +#endif + l = 1; + if (modifiers != 0 && last_dash[l + 1] == '>') + key = PTR2CHAR(last_dash + 1); + else + { + key = get_special_key_code(last_dash + 1); + if (!keep_x_key) + key = handle_x_keys(key); + } } /* diff --git a/src/testdir/test75.in b/src/testdir/test75.in index 2de7a089be..5369d8a3df 100644 --- a/src/testdir/test75.in +++ b/src/testdir/test75.in @@ -2,6 +2,7 @@ STARTTEST :so small.vim +:set cpo-=< :" Test maparg() with a string result :map foo isfoo :vnoremap