To: vim_dev@googlegroups.com Subject: Patch 7.4.1005 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1005 Problem: Vim users are not always happy. Solution: Make them happy. Files: src/ex_cmds.h, src/ex_cmds.c, src/proto/ex_cmds.pro *** ../vim-7.4.1004/src/ex_cmds.h 2015-09-08 18:46:04.341233631 +0200 --- src/ex_cmds.h 2015-12-31 15:25:24.767529154 +0100 *************** *** 1378,1383 **** --- 1378,1386 ---- EX(CMD_syncbind, "syncbind", ex_syncbind, TRLBAR, ADDR_LINES), + EX(CMD_smile, "smile", ex_smile, + TRLBAR|CMDWIN|SBOXOK, + ADDR_LINES), EX(CMD_t, "t", ex_copymove, RANGE|WHOLEFOLD|EXTRA|TRLBAR|CMDWIN|MODIFY, ADDR_LINES), *** ../vim-7.4.1004/src/ex_cmds.c 2015-12-17 15:07:28.829556034 +0100 --- src/ex_cmds.c 2015-12-31 15:58:12.406404176 +0100 *************** *** 6938,6946 **** int sn_typenr; /* type number of sign */ char_u *sn_name; /* name of sign */ char_u *sn_icon; /* name of pixmap */ ! #ifdef FEAT_SIGN_ICONS void *sn_image; /* icon image */ ! #endif char_u *sn_text; /* text used instead of pixmap */ int sn_line_hl; /* highlight ID for line */ int sn_text_hl; /* highlight ID for text */ --- 6938,6946 ---- int sn_typenr; /* type number of sign */ char_u *sn_name; /* name of sign */ char_u *sn_icon; /* name of pixmap */ ! # ifdef FEAT_SIGN_ICONS void *sn_image; /* icon image */ ! # endif char_u *sn_text; /* text used instead of pixmap */ int sn_line_hl; /* highlight ID for line */ int sn_text_hl; /* highlight ID for text */ *************** *** 6955,6973 **** static char *cmds[] = { "define", ! #define SIGNCMD_DEFINE 0 "undefine", ! #define SIGNCMD_UNDEFINE 1 "list", ! #define SIGNCMD_LIST 2 "place", ! #define SIGNCMD_PLACE 3 "unplace", ! #define SIGNCMD_UNPLACE 4 "jump", ! #define SIGNCMD_JUMP 5 NULL ! #define SIGNCMD_LAST 6 }; /* --- 6955,6973 ---- static char *cmds[] = { "define", ! # define SIGNCMD_DEFINE 0 "undefine", ! # define SIGNCMD_UNDEFINE 1 "list", ! # define SIGNCMD_LIST 2 "place", ! # define SIGNCMD_PLACE 3 "unplace", ! # define SIGNCMD_UNPLACE 4 "jump", ! # define SIGNCMD_JUMP 5 NULL ! # define SIGNCMD_LAST 6 }; /* *************** *** 7110,7116 **** vim_free(sp->sn_icon); sp->sn_icon = vim_strnsave(arg, (int)(p - arg)); backslash_halve(sp->sn_icon); ! #ifdef FEAT_SIGN_ICONS if (gui.in_use) { out_flush(); --- 7110,7116 ---- vim_free(sp->sn_icon); sp->sn_icon = vim_strnsave(arg, (int)(p - arg)); backslash_halve(sp->sn_icon); ! # ifdef FEAT_SIGN_ICONS if (gui.in_use) { out_flush(); *************** *** 7118,7124 **** gui_mch_destroy_sign(sp->sn_image); sp->sn_image = gui_mch_register_sign(sp->sn_icon); } ! #endif } else if (STRNCMP(arg, "text=", 5) == 0) { --- 7118,7124 ---- gui_mch_destroy_sign(sp->sn_image); sp->sn_image = gui_mch_register_sign(sp->sn_icon); } ! # endif } else if (STRNCMP(arg, "text=", 5) == 0) { *************** *** 7127,7133 **** int len; arg += 5; ! #ifdef FEAT_MBYTE /* Count cells and check for non-printable chars */ if (has_mbyte) { --- 7127,7133 ---- int len; arg += 5; ! # ifdef FEAT_MBYTE /* Count cells and check for non-printable chars */ if (has_mbyte) { *************** *** 7140,7146 **** } } else ! #endif { for (s = arg; s < p; ++s) if (!vim_isprintc(*s)) --- 7140,7146 ---- } } else ! # endif { for (s = arg; s < p; ++s) if (!vim_isprintc(*s)) *************** *** 7343,7351 **** do_cmdline_cmd(cmd); vim_free(cmd); } ! #ifdef FEAT_FOLDING foldOpenCursor(); ! #endif } else EMSGN(_("E157: Invalid sign ID: %ld"), id); --- 7343,7351 ---- do_cmdline_cmd(cmd); vim_free(cmd); } ! # ifdef FEAT_FOLDING foldOpenCursor(); ! # endif } else EMSGN(_("E157: Invalid sign ID: %ld"), id); *************** *** 7395,7401 **** } } ! #if defined(FEAT_SIGN_ICONS) || defined(PROTO) /* * Allocate the icons. Called when the GUI has started. Allows defining * signs before it starts. --- 7395,7401 ---- } } ! # if defined(FEAT_SIGN_ICONS) || defined(PROTO) /* * Allocate the icons. Called when the GUI has started. Allows defining * signs before it starts. *************** *** 7409,7415 **** if (sp->sn_icon != NULL) sp->sn_image = gui_mch_register_sign(sp->sn_icon); } ! #endif /* * List one sign. --- 7409,7415 ---- if (sp->sn_icon != NULL) sp->sn_image = gui_mch_register_sign(sp->sn_icon); } ! # endif /* * List one sign. *************** *** 7425,7436 **** { MSG_PUTS(" icon="); msg_outtrans(sp->sn_icon); ! #ifdef FEAT_SIGN_ICONS if (sp->sn_image == NULL) MSG_PUTS(_(" (NOT FOUND)")); ! #else MSG_PUTS(_(" (not supported)")); ! #endif } if (sp->sn_text != NULL) { --- 7425,7436 ---- { MSG_PUTS(" icon="); msg_outtrans(sp->sn_icon); ! # ifdef FEAT_SIGN_ICONS if (sp->sn_image == NULL) MSG_PUTS(_(" (NOT FOUND)")); ! # else MSG_PUTS(_(" (not supported)")); ! # endif } if (sp->sn_text != NULL) { *************** *** 7467,7479 **** { 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; --- 7467,7479 ---- { 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; *************** *** 7527,7533 **** return NULL; } ! #if defined(FEAT_SIGN_ICONS) || defined(PROTO) void * sign_get_image(typenr) int typenr; /* the attribute which may have a sign */ --- 7527,7533 ---- return NULL; } ! # if defined(FEAT_SIGN_ICONS) || defined(PROTO) void * sign_get_image(typenr) int typenr; /* the attribute which may have a sign */ *************** *** 7539,7545 **** return sp->sn_image; return NULL; } ! #endif /* * Get the name of a sign by its typenr. --- 7539,7545 ---- return sp->sn_image; return NULL; } ! # endif /* * Get the name of a sign by its typenr. *************** *** 7556,7562 **** return (char_u *)_("[Deleted]"); } ! #if defined(EXITFREE) || defined(PROTO) /* * Undefine/free all signs. */ --- 7556,7562 ---- return (char_u *)_("[Deleted]"); } ! # if defined(EXITFREE) || defined(PROTO) /* * Undefine/free all signs. */ *************** *** 7566,7574 **** while (first_sign != NULL) sign_undefine(first_sign, NULL); } ! #endif ! #if defined(FEAT_CMDL_COMPL) || defined(PROTO) static enum { EXP_SUBCMD, /* expand :sign sub-commands */ --- 7566,7574 ---- while (first_sign != NULL) sign_undefine(first_sign, NULL); } ! # endif ! # if defined(FEAT_CMDL_COMPL) || defined(PROTO) static enum { EXP_SUBCMD, /* expand :sign sub-commands */ *************** *** 7746,7753 **** } } } #endif ! #endif #if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO) /* --- 7746,7775 ---- } } } + # endif #endif ! ! /* ! * Make the user happy. ! */ ! void ! ex_smile(eap) ! exarg_T *eap UNUSED; ! { ! static char *code = "\34 \4o\14$\4ox\30 \2o\30$\1ox\25 \2o\36$\1o\11 \1o\1$\3 \2$\1 \1o\1$x\5 \1o\1 \1$\1 \2o\10 \1o\44$\1o\7 \2$\1 \2$\1 \2$\1o\1$x\2 \2o\1 \1$\1 \1$\1 \1\"\1$\6 \1o\11$\4 \15$\4 \11$\1o\7 \3$\1o\2$\1o\1$x\2 \1\"\6$\1o\1$\5 \1o\11$\6 \13$\6 \12$\1o\4 \10$x\4 \7$\4 \13$\6 \13$\6 \27$x\4 \27$\4 \15$\4 \16$\2 \3\"\3$x\5 \1\"\3$\4\"\61$\5 \1\"\3$x\6 \3$\3 \1o\62$\5 \1\"\3$\1ox\5 \1o\2$\1\"\3 \63$\7 \3$\1ox\5 \3$\4 \55$\1\"\1 \1\"\6$\5o\4$\1ox\4 \1o\3$\4o\5$\2 \45$\3 \1o\21$x\4 \10$\1\"\4$\3 \42$\5 \4$\10\"x\3 \4\"\7 \4$\4 \1\"\34$\1\"\6 \1o\3$x\16 \1\"\3$\1o\5 \3\"\22$\1\"\2$\1\"\11 \3$x\20 \3$\1o\12 \1\"\2$\2\"\6$\4\"\13 \1o\3$x\21 \4$\1o\40 \1o\3$\1\"x\22 \1\"\4$\1o\6 \1o\6$\1o\1\"\4$\1o\10 \1o\4$x\24 \1\"\5$\2o\5 \2\"\4$\1o\5$\1o\3 \1o\4$\2\"x\27 \2\"\5$\4o\2 \1\"\3$\1o\11$\3\"x\32 \2\"\7$\2o\1 \12$x\42 \4\"\13$x\46 \14$x\47 \12$\1\"x\50 \1\"\3$\4\"x"; ! char *p; ! int n; ! ! msg_start(); ! msg_putchar('\n'); ! for (p = code; *p != NUL; ++p) ! if (*p == 'x') ! msg_putchar('\n'); ! else ! for (n = *p++; n > 0; --n) ! msg_putchar(*p); ! msg_clr_eos(); ! } #if defined(FEAT_GUI) || defined(FEAT_CLIENTSERVER) || defined(PROTO) /* *** ../vim-7.4.1004/src/proto/ex_cmds.pro 2014-09-19 19:39:30.766446025 +0200 --- src/proto/ex_cmds.pro 2015-12-31 15:29:49.360689705 +0100 *************** *** 61,65 **** --- 61,66 ---- void free_signs __ARGS((void)); char_u *get_sign_name __ARGS((expand_T *xp, int idx)); void set_context_in_sign_cmd __ARGS((expand_T *xp, char_u *arg)); + void ex_smile __ARGS((exarg_T *eap)); void ex_drop __ARGS((exarg_T *eap)); /* vim: set ft=c : */ *** ../vim-7.4.1004/src/version.c 2015-12-30 17:56:01.815380914 +0100 --- src/version.c 2015-12-31 15:25:56.747186006 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 1005, /**/ -- f y cn rd ths thn y cn hv grt jb n cmptr prgrmmng /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///