From de0dfed7013f5c40b3ef9fb448edb7fa6ab65bb4 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 24 Feb 2009 03:30:14 +0000 Subject: [PATCH] updated for version 7.2-126 --- src/ex_cmds.c | 56 ++++++++++++++++++++++++++++++------------- src/misc2.c | 6 +++++ src/proto/ex_cmds.pro | 1 + src/version.c | 2 ++ 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 1ac46f312..d95a3c23b 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -6541,6 +6541,7 @@ static sign_T *first_sign = NULL; static int last_sign_typenr = MAX_TYPENR; /* is decremented */ static void sign_list_defined __ARGS((sign_T *sp)); +static void sign_undefine __ARGS((sign_T *sp, sign_T *sp_prev)); /* * ":sign" command @@ -6749,24 +6750,8 @@ ex_sign(eap) /* ":sign list {name}" */ sign_list_defined(sp); else - { /* ":sign undefine {name}" */ - vim_free(sp->sn_name); - vim_free(sp->sn_icon); -#ifdef FEAT_SIGN_ICONS - if (sp->sn_image != NULL) - { - out_flush(); - gui_mch_destroy_sign(sp->sn_image); - } -#endif - vim_free(sp->sn_text); - if (sp_prev == NULL) - first_sign = sp->sn_next; - else - sp_prev->sn_next = sp->sn_next; - vim_free(sp); - } + sign_undefine(sp, sp_prev); } } else @@ -7014,6 +6999,31 @@ sign_list_defined(sp) } } +/* + * Undefine a sign and free its memory. + */ + static void +sign_undefine(sp, sp_prev) + sign_T *sp; + sign_T *sp_prev; +{ + vim_free(sp->sn_name); + vim_free(sp->sn_icon); +#ifdef FEAT_SIGN_ICONS + if (sp->sn_image != NULL) + { + out_flush(); + gui_mch_destroy_sign(sp->sn_image); + } +#endif + vim_free(sp->sn_text); + if (sp_prev == NULL) + first_sign = sp->sn_next; + else + sp_prev->sn_next = sp->sn_next; + vim_free(sp); +} + /* * Get highlighting attribute for sign "typenr". * If "line" is TRUE: line highl, if FALSE: text highl. @@ -7088,6 +7098,18 @@ sign_typenr2name(typenr) return (char_u *)_("[Deleted]"); } +#if defined(EXITFREE) || defined(PROTO) +/* + * Undefine/free all signs. + */ + void +free_signs() +{ + while (first_sign != NULL) + sign_undefine(first_sign, NULL); +} +#endif + #endif #if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO) diff --git a/src/misc2.c b/src/misc2.c index 427708c04..fafe931e6 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1010,6 +1010,9 @@ free_all_mem() # if defined(FEAT_PROFILE) do_cmdline_cmd((char_u *)"profdel *"); # endif +# if defined(FEAT_KEYMAP) + do_cmdline_cmd((char_u *)"set keymap="); +#endif # ifdef FEAT_TITLE free_titles(); @@ -1034,6 +1037,9 @@ free_all_mem() free_regexp_stuff(); free_tag_stuff(); free_cd_dir(); +# ifdef FEAT_SIGNS + free_signs(); +# endif # ifdef FEAT_EVAL set_expr_line(NULL); # endif diff --git a/src/proto/ex_cmds.pro b/src/proto/ex_cmds.pro index 1a15c88e7..b2c77cd17 100644 --- a/src/proto/ex_cmds.pro +++ b/src/proto/ex_cmds.pro @@ -40,6 +40,7 @@ void global_exe __ARGS((char_u *cmd)); int read_viminfo_sub_string __ARGS((vir_T *virp, int force)); void write_viminfo_sub_string __ARGS((FILE *fp)); void free_old_sub __ARGS((void)); +void free_signs __ARGS((void)); int prepare_tagpreview __ARGS((int undo_sync)); void ex_help __ARGS((exarg_T *eap)); char_u *check_help_lang __ARGS((char_u *arg)); diff --git a/src/version.c b/src/version.c index c97e44271..8189b4390 100644 --- a/src/version.c +++ b/src/version.c @@ -676,6 +676,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 126, /**/ 125, /**/ -- 2.40.0