diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-02-07 22:01:03 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-02-07 22:01:03 +0000 |
commit | 7c62692d430af7313d52257895cfa8298676b6f6 (patch) | |
tree | e29d1348de49aa33b8423ed2290002e39c7a0d1c /src | |
parent | f97ca8f0665f4604f7778ea709573d920ab83240 (diff) | |
download | vim-git-7c62692d430af7313d52257895cfa8298676b6f6.tar.gz |
updated for version 7.0049
Diffstat (limited to 'src')
-rw-r--r-- | src/edit.c | 10 | ||||
-rw-r--r-- | src/ex_cmds2.c | 11 | ||||
-rw-r--r-- | src/ex_docmd.c | 8 | ||||
-rw-r--r-- | src/ex_getln.c | 9 | ||||
-rw-r--r-- | src/fileio.c | 14 | ||||
-rw-r--r-- | src/gui_motif.c | 79 | ||||
-rw-r--r-- | src/gui_xmebw.c | 19 | ||||
-rw-r--r-- | src/move.c | 3 | ||||
-rw-r--r-- | src/ops.c | 92 | ||||
-rw-r--r-- | src/option.c | 11 | ||||
-rw-r--r-- | src/option.h | 3 | ||||
-rw-r--r-- | src/os_unix.c | 3 | ||||
-rw-r--r-- | src/proto/gui_motif.pro | 1 | ||||
-rw-r--r-- | src/quickfix.c | 65 | ||||
-rw-r--r-- | src/structs.h | 1 | ||||
-rw-r--r-- | src/version.h | 4 | ||||
-rw-r--r-- | src/vim.h | 2 |
17 files changed, 249 insertions, 86 deletions
diff --git a/src/edit.c b/src/edit.c index 175256e64..a8897362d 100644 --- a/src/edit.c +++ b/src/edit.c @@ -5151,7 +5151,9 @@ cursor_up(n, upd_topline) if (n > 0) { lnum = curwin->w_cursor.lnum; - if (lnum <= 1) + /* This fails if the cursor is already in the first line or the count + * is larger than the line number and '-' is in 'cpoptions' */ + if (lnum <= 1 || (n >= lnum && vim_strchr(p_cpo, CPO_MINUS) != NULL)) return FAIL; if (n >= lnum) lnum = 1; @@ -5212,7 +5214,11 @@ cursor_down(n, upd_topline) /* Move to last line of fold, will fail if it's the end-of-file. */ (void)hasFolding(lnum, NULL, &lnum); #endif - if (lnum >= curbuf->b_ml.ml_line_count) + /* This fails if the cursor is already in the last line or would move + * beyound the last line and '-' is in 'cpoptions' */ + if (lnum >= curbuf->b_ml.ml_line_count + || (lnum + n > curbuf->b_ml.ml_line_count + && vim_strchr(p_cpo, CPO_MINUS) != NULL)) return FAIL; if (lnum + n >= curbuf->b_ml.ml_line_count) lnum = curbuf->b_ml.ml_line_count; diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 82557febb..6c8ece95b 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -2339,11 +2339,12 @@ do_source(fname, check_other, is_vimrc) if (SCRIPT_NAME(current_SID) != NULL && ( # ifdef UNIX - /* compare dev/ino when possible, it catches symbolic - * links */ - (stat_ok && SCRIPT_DEV(current_SID) != -1) - ? (SCRIPT_DEV(current_SID) == st.st_dev - && SCRIPT_INO(current_SID) == st.st_ino) : + /* Compare dev/ino when possible, it catches symbolic + * links. Also compare file names, the inode may change + * when the file was edited. */ + ((stat_ok && SCRIPT_DEV(current_SID) != -1) + && (SCRIPT_DEV(current_SID) == st.st_dev + && SCRIPT_INO(current_SID) == st.st_ino)) || # endif fnamecmp(SCRIPT_NAME(current_SID), fname_exp) == 0)) break; diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 5cecf30c6..899e4c8f4 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -594,6 +594,14 @@ do_exmode(improved) MSG(_("Entering Ex mode. Type \"visual\" to go to Normal mode.")); while (exmode_active) { +#ifdef FEAT_EX_EXTRA + /* Check for a ":normal" command and no more characters left. */ + if (ex_normal_busy > 0 && typebuf.tb_len == 0) + { + exmode_active = FALSE; + break; + } +#endif msg_scroll = TRUE; need_wait_return = FALSE; ex_pressedreturn = FALSE; diff --git a/src/ex_getln.c b/src/ex_getln.c index e17e671ef..a7dfd9a75 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -996,8 +996,13 @@ getcmdline(firstc, count, indent) case ESC: /* get here if p_wc != ESC or when ESC typed twice */ case Ctrl_C: - /* In exmode it doesn't make sense to return. */ - if (exmode_active) + /* In exmode it doesn't make sense to return. Except when + * ":normal" runs out of characters. */ + if (exmode_active +#ifdef FEAT_EX_EXTRA + && (ex_normal_busy == 0 || typebuf.tb_len > 0) +#endif + ) goto cmdline_not_changed; gotesc = TRUE; /* will free ccline.cmdbuff after diff --git a/src/fileio.c b/src/fileio.c index ee1c90b88..ea7c924d9 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2701,6 +2701,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit, int buf_fname_s = FALSE; int did_cmd = FALSE; int nofile_err = FALSE; + int empty_memline = (buf->b_ml.ml_mfp == NULL); /* * Apply PRE aucocommands. @@ -2772,7 +2773,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit, */ if (!buf_valid(buf)) buf = NULL; - if (buf == NULL || buf->b_ml.ml_mfp == NULL + if (buf == NULL || (buf->b_ml.ml_mfp == NULL && !empty_memline) || did_cmd || nofile_err || aborting()) { --no_wait_return; @@ -6650,6 +6651,8 @@ static struct event_name {"InsertChange", EVENT_INSERTCHANGE}, {"InsertEnter", EVENT_INSERTENTER}, {"InsertLeave", EVENT_INSERTLEAVE}, + {"QuickFixCmdPost", EVENT_QUICKFIXCMDPOST}, + {"QuickFixCmdPre", EVENT_QUICKFIXCMDPRE}, {"RemoteReply", EVENT_REMOTEREPLY}, {"StdinReadPost", EVENT_STDINREADPOST}, {"StdinReadPre", EVENT_STDINREADPRE}, @@ -8042,9 +8045,12 @@ apply_autocmds_group(event, fname, fname_io, force, group, buf, eap) else { sfname = vim_strsave(fname); - /* Don't try expanding FileType, Syntax or WindowID. */ - if (event == EVENT_FILETYPE || event == EVENT_SYNTAX - || event == EVENT_REMOTEREPLY) + /* Don't try expanding FileType, Syntax, WindowID or QuickFixCmd* */ + if (event == EVENT_FILETYPE + || event == EVENT_SYNTAX + || event == EVENT_REMOTEREPLY + || event == EVENT_QUICKFIXCMDPRE + || event == EVENT_QUICKFIXCMDPOST) fname = vim_strsave(fname); else fname = FullName_save(fname, FALSE); diff --git a/src/gui_motif.c b/src/gui_motif.c index acb9d81fa..a1da3d0af 100644 --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -886,7 +886,8 @@ gui_mch_compute_menu_height(id) #include "gui_x11_pm.h" static int check_xpm __ARGS((char_u *path)); -static char **get_toolbar_pixmap __ARGS((vimmenu_T *menu)); +static char **get_toolbar_pixmap __ARGS((vimmenu_T *menu, char **fname)); +static int add_pixmap_args __ARGS((vimmenu_T *menu, Arg *args, int n)); /* * Read an Xpm file. Return OK or FAIL. @@ -916,16 +917,20 @@ check_xpm(path) /* * Allocated a pixmap for toolbar menu "menu". + * When it's to be read from a file, "fname" is set to the file name + * (in allocated memory). * Return a blank pixmap if it fails. */ static char ** -get_toolbar_pixmap(menu) +get_toolbar_pixmap(menu, fname) vimmenu_T *menu; + char **fname; { char_u buf[MAXPATHL]; /* buffer storing expanded pathname */ char **xpm = NULL; /* xpm array */ int res; + *fname = NULL; buf[0] = NUL; /* start with NULL path */ if (menu->iconfile != NULL) @@ -938,7 +943,10 @@ get_toolbar_pixmap(menu) if (res == FAIL && gui_find_bitmap(menu->name, buf, "xpm") == OK) res = check_xpm(buf); if (res == OK) + { + *fname = (char *)vim_strsave(buf); return tb_blank_xpm; + } } if (menu->icon_builtin || gui_find_bitmap(menu->name, buf, "xpm") == FAIL) @@ -952,6 +960,33 @@ get_toolbar_pixmap(menu) return xpm; } + +/* + * Add arguments for the toolbar pixmap to a menu item. + */ + static int +add_pixmap_args(menu, args, n) + vimmenu_T *menu; + Arg *args; + int n; +{ + vim_free(menu->xpm_fname); + menu->xpm = get_toolbar_pixmap(menu, &menu->xpm_fname); + if (menu->xpm == NULL) + { + XtSetArg(args[n], XmNlabelType, XmSTRING); n++; + } + else + { + if (menu->xpm_fname != NULL) + { + XtSetArg(args[n], XmNpixmapFile, menu->xpm_fname); n++; + } + XtSetArg(args[n], XmNpixmapData, menu->xpm); n++; + XtSetArg(args[n], XmNlabelLocation, XmBOTTOM); n++; + } + return n; +} #endif /* FEAT_TOOLBAR */ void @@ -1025,16 +1060,8 @@ gui_mch_add_menu_item(menu, idx) xms = XmStringCreate((char *)menu->dname, STRING_TAG); XtSetArg(args[n], XmNlabelString, xms); n++; - menu->xpm = get_toolbar_pixmap(menu); - if (menu->xpm == NULL) - { - XtSetArg(args[n], XmNlabelType, XmSTRING); n++; - } - else - { - XtSetArg(args[n], XmNpixmapData, menu->xpm); n++; - XtSetArg(args[n], XmNlabelLocation, XmBOTTOM); n++; - } + n = add_pixmap_args(menu, args, n); + type = xmEnhancedButtonWidgetClass; } @@ -1264,16 +1291,7 @@ submenu_change(menu, colors) int n = 0; Arg args[18]; - mp->xpm = get_toolbar_pixmap(mp); - if (menu->xpm == NULL) - { - XtSetArg(args[n], XmNlabelType, XmSTRING); n++; - } - else - { - XtSetArg(args[n], XmNpixmapData, menu->xpm); n++; - XtSetArg(args[n], XmNlabelLocation, XmBOTTOM); n++; - } + n = add_pixmap_args(mp, args, n); XtSetValues(mp->id, args, n); } # ifdef FEAT_BEVAL @@ -2846,6 +2864,23 @@ gui_mch_compute_toolbar_height() return (int)(height + (borders << 1)); } + void +motif_get_toolbar_colors(bgp, fgp, bsp, tsp, hsp) + Pixel *bgp; + Pixel *fgp; + Pixel *bsp; + Pixel *tsp; + Pixel *hsp; +{ + XtVaGetValues(toolBar, + XmNbackground, bgp, + XmNforeground, fgp, + XmNbottomShadowColor, bsp, + XmNtopShadowColor, tsp, + XmNhighlightColor, hsp, + NULL); +} + # ifdef FEAT_FOOTER /* * The next toolbar enter/leave callbacks should really do balloon help. But diff --git a/src/gui_xmebw.c b/src/gui_xmebw.c index aa22a88b1..ff7d2e68d 100644 --- a/src/gui_xmebw.c +++ b/src/gui_xmebw.c @@ -292,13 +292,14 @@ set_pixmap(XmEnhancedButtonWidget eb) int x; int y; unsigned int height, width, border, depth; - int status; + int status = 0; Pixmap mask; Pixmap pix = None; Pixmap arm_pix = None; Pixmap ins_pix = None; Pixmap high_pix = None; char **data = (char **) eb->enhancedbutton.pixmap_data; + char *fname = (char *) eb->enhancedbutton.pixmap_file; int shift; GC gc; @@ -313,6 +314,7 @@ set_pixmap(XmEnhancedButtonWidget eb) root = RootWindow(dpy, scr); eb->label.pixmap = None; + eb->enhancedbutton.pixmap_depth = 0; eb->enhancedbutton.pixmap_width = 0; eb->enhancedbutton.pixmap_height = 0; @@ -321,6 +323,14 @@ set_pixmap(XmEnhancedButtonWidget eb) eb->enhancedbutton.highlight_pixmap = None; eb->enhancedbutton.insensitive_pixmap = None; + /* We use dynamic colors, get them now. */ + motif_get_toolbar_colors( + &eb->core.background_pixel, + &eb->primitive.foreground, + &eb->primitive.bottom_shadow_color, + &eb->primitive.top_shadow_color, + &eb->primitive.highlight_color); + /* Setup color subsititution table. */ color[0].pixel = eb->core.background_pixel; color[1].pixel = eb->core.background_pixel; @@ -337,9 +347,12 @@ set_pixmap(XmEnhancedButtonWidget eb) attr.colorsymbols = color; attr.numsymbols = XtNumber(color); - status = XpmCreatePixmapFromData(dpy, root, data, &pix, &mask, &attr); + if (fname) + status = XpmReadFileToPixmap(dpy, root, fname, &pix, &mask, &attr); + if (!fname || status != XpmSuccess) + status = XpmCreatePixmapFromData(dpy, root, data, &pix, &mask, &attr); - /* If somethin failed, we will fill in the default pixmap. */ + /* If something failed, we will fill in the default pixmap. */ if (status != XpmSuccess) status = XpmCreatePixmapFromData(dpy, root, blank_xpm, &pix, &mask, &attr); diff --git a/src/move.c b/src/move.c index 2fc226056..f3d7825f3 100644 --- a/src/move.c +++ b/src/move.c @@ -2471,7 +2471,8 @@ onepage(dir, count) foldAdjustCursor(); #endif cursor_correct(); - beginline(BL_SOL | BL_FIX); + if (retval == OK) + beginline(BL_SOL | BL_FIX); curwin->w_valid &= ~(VALID_WCOL|VALID_WROW|VALID_VIRTCOL); /* @@ -5829,16 +5829,16 @@ clear_oparg(oap) vim_memset(oap, 0, sizeof(oparg_T)); } -static long line_count_info __ARGS((char_u *line, long *wc, long limit, int eol_size)); +static long line_count_info __ARGS((char_u *line, long *wc, long *cc, long limit, int eol_size)); /* - * Count the number of characters and "words" in a line. + * Count the number of bytes, characters and "words" in a line. * * "Words" are counted by looking for boundaries between non-space and * space characters. (it seems to produce results that match 'wc'.) * - * Return value is character count; word count for the line is ADDED - * to "*wc". + * Return value is byte count; word count for the line is added to "*wc". + * Char count is added to "*cc". * * The function will only examine the first "limit" characters in the * line, stopping if it encounters an end-of-line (NUL byte). In that @@ -5846,16 +5846,19 @@ static long line_count_info __ARGS((char_u *line, long *wc, long limit, int eol_ * the size of the EOL character. */ static long -line_count_info(line, wc, limit, eol_size) +line_count_info(line, wc, cc, limit, eol_size) char_u *line; long *wc; + long *cc; long limit; int eol_size; { - long i, words = 0; + long i; + long words = 0; + long chars = 0; int is_word = 0; - for (i = 0; line[i] && i < limit; i++) + for (i = 0; line[i] && i < limit; ) { if (is_word) { @@ -5867,6 +5870,12 @@ line_count_info(line, wc, limit, eol_size) } else if (!vim_isspace(line[i])) is_word = 1; + ++chars; +#ifdef FEAT_MBYTE + i += mb_ptr2len_check(line + i); +#else + ++i; +#endif } if (is_word) @@ -5874,8 +5883,12 @@ line_count_info(line, wc, limit, eol_size) *wc += words; /* Add eol_size if the end of line was reached before hitting limit. */ - if (!line[i] && i < limit) + if (line[i] == NUL && i < limit) + { i += eol_size; + chars += eol_size; + } + *cc += chars; return i; } @@ -5891,12 +5904,14 @@ cursor_pos_info() char_u buf1[20]; char_u buf2[20]; linenr_T lnum; + long byte_count = 0; + long byte_count_cursor = 0; long char_count = 0; long char_count_cursor = 0; - int eol_size; - long last_check = 100000L; long word_count = 0; long word_count_cursor = 0; + int eol_size; + long last_check = 100000L; #ifdef FEAT_VISUAL long line_count_selected = 0; pos_T min_pos, max_pos; @@ -5956,12 +5971,12 @@ cursor_pos_info() for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum) { /* Check for a CTRL-C every 100000 characters. */ - if (char_count > last_check) + if (byte_count > last_check) { ui_breakcheck(); if (got_int) return; - last_check = char_count + 100000L; + last_check = byte_count + 100000L; } #ifdef FEAT_VISUAL @@ -6003,13 +6018,13 @@ cursor_pos_info() } if (s != NULL) { - char_count_cursor += line_count_info(s, - &word_count_cursor, len, eol_size); + byte_count_cursor += line_count_info(s, &word_count_cursor, + &char_count_cursor, len, eol_size); if (lnum == curbuf->b_ml.ml_line_count && !curbuf->b_p_eol && curbuf->b_p_bin && (long)STRLEN(s) < len) - char_count_cursor -= eol_size; + byte_count_cursor -= eol_size; } } else @@ -6019,19 +6034,21 @@ cursor_pos_info() if (lnum == curwin->w_cursor.lnum) { word_count_cursor += word_count; - char_count_cursor = char_count + - line_count_info(ml_get(lnum), &word_count_cursor, + char_count_cursor += char_count; + byte_count_cursor = byte_count + + line_count_info(ml_get(lnum), + &word_count_cursor, &char_count_cursor, (long)(curwin->w_cursor.col + 1), eol_size); } } /* Add to the running totals */ - char_count += line_count_info(ml_get(lnum), &word_count, - (long)MAXCOL, eol_size); + byte_count += line_count_info(ml_get(lnum), &word_count, + &char_count, (long)MAXCOL, eol_size); } /* Correction for when last line doesn't have an EOL. */ if (!curbuf->b_p_eol && curbuf->b_p_bin) - char_count -= eol_size; + byte_count -= eol_size; #ifdef FEAT_VISUAL if (VIsual_active) @@ -6046,12 +6063,20 @@ cursor_pos_info() else buf1[0] = NUL; - sprintf((char *)IObuff, - _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"), + if (char_count_cursor == byte_count_cursor + && char_count == byte_count) + sprintf((char *)IObuff, _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Bytes"), buf1, line_count_selected, (long)curbuf->b_ml.ml_line_count, word_count_cursor, word_count, - char_count_cursor, char_count); + byte_count_cursor, byte_count); + else + sprintf((char *)IObuff, _("Selected %s%ld of %ld Lines; %ld of %ld Words; %ld of %ld Chars; %ld of %ld Bytes"), + buf1, line_count_selected, + (long)curbuf->b_ml.ml_line_count, + word_count_cursor, word_count, + char_count_cursor, char_count, + byte_count_cursor, byte_count); } else #endif @@ -6062,20 +6087,29 @@ cursor_pos_info() (int)curwin->w_virtcol + 1); col_print(buf2, (int)STRLEN(p), linetabsize(p)); - sprintf((char *)IObuff, - _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"), + if (char_count_cursor == byte_count_cursor + && char_count == byte_count) + sprintf((char *)IObuff, _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Byte %ld of %ld"), + (char *)buf1, (char *)buf2, + (long)curwin->w_cursor.lnum, + (long)curbuf->b_ml.ml_line_count, + word_count_cursor, word_count, + byte_count_cursor, byte_count); + else + sprintf((char *)IObuff, _("Col %s of %s; Line %ld of %ld; Word %ld of %ld; Char %ld of %ld; Byte %ld of %ld"), (char *)buf1, (char *)buf2, (long)curwin->w_cursor.lnum, (long)curbuf->b_ml.ml_line_count, word_count_cursor, word_count, - char_count_cursor, char_count); + char_count_cursor, char_count, + byte_count_cursor, byte_count); } #ifdef FEAT_MBYTE - char_count = bomb_size(); - if (char_count > 0) + byte_count = bomb_size(); + if (byte_count > 0) sprintf((char *)IObuff + STRLEN(IObuff), _("(+%ld for BOM)"), - char_count); + byte_count); #endif /* Don't shorten this message, the user asked for it. */ p = p_shm; diff --git a/src/option.c b/src/option.c index 0c6178d63..ffeaf8644 100644 --- a/src/option.c +++ b/src/option.c @@ -2593,18 +2593,19 @@ set_init_1() /* * Find default value for 'shell' option. + * Don't use it if it is empty. */ - if ((p = mch_getenv((char_u *)"SHELL")) != NULL + if (((p = mch_getenv((char_u *)"SHELL")) != NULL && *p != NUL) #if defined(MSDOS) || defined(MSWIN) || defined(OS2) # ifdef __EMX__ - || (p = mch_getenv((char_u *)"EMXSHELL")) != NULL + || ((p = mch_getenv((char_u *)"EMXSHELL")) != NULL && *p != NUL) # endif - || (p = mch_getenv((char_u *)"COMSPEC")) != NULL + || ((p = mch_getenv((char_u *)"COMSPEC")) != NULL && *p != NUL) # ifdef WIN3264 - || (p = default_shell()) != NULL + || ((p = default_shell()) != NULL && *p != NUL) # endif #endif - ) + ) set_string_default("sh", p); #ifdef FEAT_WILDIGN diff --git a/src/option.h b/src/option.h index 1fb5488d3..9be2c4988 100644 --- a/src/option.h +++ b/src/option.h @@ -162,9 +162,10 @@ #define CPO_MATCH '%' #define CPO_STAR '*' /* ":*" means ":@" */ #define CPO_PLUS '+' /* ":write file" resets 'modified' */ +#define CPO_MINUS '-' /* "9-" fails at and before line 9 */ #define CPO_SPECI '<' /* don't recognize <> in mappings */ #define CPO_DEFAULT "aABceFs" -#define CPO_ALL "aAbBcCdDeEfFgiIjJkKlLmMnoOprRsStuvwWxy$!%*+<" +#define CPO_ALL "aAbBcCdDeEfFgiIjJkKlLmMnoOprRsStuvwWxy$!%*-+<" /* characters for p_ww option: */ #define WW_ALL "bshl<>[],~" diff --git a/src/os_unix.c b/src/os_unix.c index 4dd38ce7e..c09638f4c 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3222,8 +3222,9 @@ mch_get_shellsize() /* * 2. get size from environment + * When being POSIX compliant this overrules the ioctl() values! */ - if (columns == 0 || rows == 0) + if (columns == 0 || rows == 0 || getenv("VIM_POSIX") != NULL) { if ((p = (char_u *)getenv("LINES"))) rows = atoi((char *)p); diff --git a/src/proto/gui_motif.pro b/src/proto/gui_motif.pro index 94a7c4519..8c49d2f2f 100644 --- a/src/proto/gui_motif.pro +++ b/src/proto/gui_motif.pro @@ -34,6 +34,7 @@ void gui_mch_enable_footer __ARGS((int showit)); void gui_mch_set_footer __ARGS((char_u *s)); void gui_mch_show_toolbar __ARGS((int showit)); int gui_mch_compute_toolbar_height __ARGS((void)); +void motif_get_toolbar_colors __ARGS((Pixel *bgp, Pixel *fgp, Pixel *bsp, Pixel *tsp, Pixel *hsp)); void gui_motif_menu_fontlist __ARGS((Widget id)); void gui_mch_find_dialog __ARGS((exarg_T *eap)); void gui_mch_replace_dialog __ARGS((exarg_T *eap)); diff --git a/src/quickfix.c b/src/quickfix.c index a4110035f..a8544b34e 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2083,9 +2083,27 @@ grep_internal(cmdidx) ex_make(eap) exarg_T *eap; { - char_u *name; + char_u *fname; char_u *cmd; unsigned len; +#ifdef FEAT_AUTOCMD + char_u *au_name = NULL; + + switch (eap->cmdidx) + { + case CMD_make: au_name = (char_u *)"make"; break; + case CMD_grep: au_name = (char_u *)"grep"; break; + case CMD_grepadd: au_name = (char_u *)"grepadd"; break; + default: break; + } + if (au_name != NULL) + { + apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, + curbuf->b_fname, TRUE, curbuf); + if (did_throw || force_abort) + return; + } +#endif /* Redirect ":grep" to ":vimgrep" if 'grepprg' is "internal". */ if (grep_internal(eap->cmdidx)) @@ -2095,24 +2113,24 @@ ex_make(eap) } autowrite_all(); - name = get_mef_name(); - if (name == NULL) + fname = get_mef_name(); + if (fname == NULL) return; - mch_remove(name); /* in case it's not unique */ + mch_remove(fname); /* in case it's not unique */ /* * If 'shellpipe' empty: don't redirect to 'errorfile'. */ len = (unsigned)STRLEN(p_shq) * 2 + (unsigned)STRLEN(eap->arg) + 1; if (*p_sp != NUL) - len += (unsigned)STRLEN(p_sp) + (unsigned)STRLEN(name) + 3; + len += (unsigned)STRLEN(p_sp) + (unsigned)STRLEN(fname) + 3; cmd = alloc(len); if (cmd == NULL) return; sprintf((char *)cmd, "%s%s%s", (char *)p_shq, (char *)eap->arg, (char *)p_shq); if (*p_sp != NUL) - append_redir(cmd, p_sp, name); + append_redir(cmd, p_sp, fname); /* * Output a newline if there's something else than the :make command that * was typed (in which case the cursor is in column 0). @@ -2132,14 +2150,20 @@ ex_make(eap) (void)char_avail(); #endif - if (qf_init(name, eap->cmdidx != CMD_make ? p_gefm : p_efm, + if (qf_init(fname, eap->cmdidx != CMD_make ? p_gefm : p_efm, eap->cmdidx != CMD_grepadd) > 0 && !eap->forceit) qf_jump(0, 0, FALSE); /* display first error */ - mch_remove(name); - vim_free(name); + mch_remove(fname); + vim_free(fname); vim_free(cmd); + +#ifdef FEAT_AUTOCMD + if (au_name != NULL) + apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, + curbuf->b_fname, TRUE, curbuf); +#endif } /* @@ -2275,6 +2299,23 @@ ex_vimgrep(eap) char_u *save_ei = NULL; aco_save_T aco; #endif +#ifdef FEAT_AUTOCMD + char_u *au_name = NULL; + + switch (eap->cmdidx) + { + case CMD_vimgrep: au_name = (char_u *)"vimgrep"; break; + case CMD_vimgrepadd: au_name = (char_u *)"vimgrepadd"; break; + default: break; + } + if (au_name != NULL) + { + apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, + curbuf->b_fname, TRUE, curbuf); + if (did_throw || force_abort) + return; + } +#endif /* Make 'cpoptions' empty, the 'l' flag should not be used here. */ save_cpo = p_cpo; @@ -2496,6 +2537,12 @@ jumpend: else EMSG2(_(e_nomatch2), s); +#ifdef FEAT_AUTOCMD + if (au_name != NULL) + apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, + curbuf->b_fname, TRUE, curbuf); +#endif + theend: vim_free(regmatch.regprog); diff --git a/src/structs.h b/src/structs.h index ff4d2d64e..8a81611c2 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1967,6 +1967,7 @@ struct VimMenu #ifdef FEAT_GUI_MOTIF int sensitive; /* turn button on/off */ char **xpm; /* pixmap data */ + char *xpm_fname; /* file with pixmap data */ #endif #ifdef FEAT_GUI_ATHENA Pixmap image; /* Toolbar image */ diff --git a/src/version.h b/src/version.h index 187babb41..6dfc7d5fc 100644 --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_MEDIUM "7.0aa ALPHA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 5)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 5, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 7)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Feb 7, compiled " @@ -1074,6 +1074,8 @@ enum auto_event EVENT_INSERTCHANGE, /* when changing Insert/Replace mode */ EVENT_INSERTENTER, /* when entering Insert mode */ EVENT_INSERTLEAVE, /* when leaving Insert mode */ + EVENT_QUICKFIXCMDPOST, /* after :make, :grep etc */ + EVENT_QUICKFIXCMDPRE, /* before :make, :grep etc */ EVENT_STDINREADPOST, /* after reading from stdin */ EVENT_STDINREADPRE, /* before reading from stdin */ EVENT_SYNTAX, /* syntax selected */ |