From 7e2ec008f5c5152205d0b8a7d88177b374225d8d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 16:31:06 +0200 Subject: [PATCH 01/39] patch 7.4.855 Problem: GTK: font glitches for combining characters Solution: Use pango_shape_full() instead of pango_shape(). (luchr, PR #393) --- src/gui_gtk_x11.c | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 5538446056..5c4abce65e 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -5063,8 +5063,8 @@ not_ascii: * done, because drawing the cursor would change the display. */ item->analysis.shape_engine = default_shape_engine; - pango_shape((const char *)s + item->offset, item->length, - &item->analysis, glyphs); + pango_shape_full((const char *)s + item->offset, item->length, + (const char *)s, len, &item->analysis, glyphs); /* * Fixed-width hack: iterate over the array and assign a fixed * width to each glyph, thus overriding the choice made by the diff --git a/src/version.c b/src/version.c index 7f7f0dda2c..7733d4b5e2 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 855, /**/ 854, /**/ From a09a2c5857ab854f0870573b5160da1964c905a2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 17:31:59 +0200 Subject: [PATCH 02/39] patch 7.4.856 Problem: "zt" still doesn't work well with filler lines. (Gary Johnson) Solution: Check for filler lines above the cursor. (Christian Brabandt) --- src/move.c | 10 ++++------ src/version.c | 2 ++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/move.c b/src/move.c index 594f9acf57..449382fe97 100644 --- a/src/move.c +++ b/src/move.c @@ -1751,12 +1751,10 @@ scroll_cursor_top(min_scroll, always) new_topline = top + 1; #ifdef FEAT_DIFF - /* used already contains the number of filler lines above, don't add it + /* "used" already contains the number of filler lines above, don't add it * again. - * TODO: if filler lines above new top are to be considered as context for - * the current window, leave next statement commented, else hide filler - * lines above cursor line, by adding them to extra */ - /* extra += diff_check_fill(curwin, curwin->w_cursor.lnum); */ + * Hide filler lines above cursor line by adding them to "extra". */ + extra += diff_check_fill(curwin, curwin->w_cursor.lnum); #endif /* @@ -1771,7 +1769,7 @@ scroll_cursor_top(min_scroll, always) i = 1; else #endif - i = plines(top); + i = plines_nofill(top); used += i; if (extra + i <= off && bot < curbuf->b_ml.ml_line_count) { diff --git a/src/version.c b/src/version.c index 7733d4b5e2..a3b567ef83 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 856, /**/ 855, /**/ From 4a4b821085847651b71d8ad9fab9f180635cb453 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 17:50:41 +0200 Subject: [PATCH 03/39] patch 7.4.857 Problem: Dragging the current tab with the mouse doesn't work properly. Solution: Take the current tabpage index into account. (Hirohito Higashi) --- src/normal.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/normal.c b/src/normal.c index ae7b83ad22..69b0dcecbe 100644 --- a/src/normal.c +++ b/src/normal.c @@ -2561,7 +2561,8 @@ do_mouse(oap, c, dir, count, fixindent) if (in_tab_line) { c1 = TabPageIdxs[mouse_col]; - tabpage_move(c1 <= 0 ? 9999 : c1 - 1); + tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab) + ? c1 - 1 : c1); } return FALSE; } diff --git a/src/version.c b/src/version.c index a3b567ef83..3fb4ad2fe2 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 857, /**/ 856, /**/ From aa23b379421aa214e6543b06c974594a25799b09 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 18:46:31 +0200 Subject: [PATCH 04/39] patch 7.4.858 Problem: It's a bit clumsy to execute a command on a list of matches. Solution: Add the ":ldo", ":lfdo", ":cdo" and ":cfdo" commands. (Yegappan Lakshmanan) --- runtime/doc/cmdline.txt | 4 + runtime/doc/editing.txt | 3 +- runtime/doc/index.txt | 4 + runtime/doc/tabpage.txt | 3 +- runtime/doc/windows.txt | 6 +- src/ex_cmds.h | 13 +++ src/ex_cmds2.c | 52 ++++++++- src/ex_docmd.c | 43 ++++++- src/proto/quickfix.pro | 3 + src/quickfix.c | 222 ++++++++++++++++++++++++++++++++++--- src/testdir/Make_amiga.mak | 2 + src/testdir/Make_dos.mak | 1 + src/testdir/Make_ming.mak | 1 + src/testdir/Make_os2.mak | 1 + src/testdir/Make_vms.mms | 3 +- src/testdir/Makefile | 1 + src/testdir/test_cdo.in | 107 ++++++++++++++++++ src/testdir/test_cdo.ok | 66 +++++++++++ src/version.c | 2 + 19 files changed, 506 insertions(+), 31 deletions(-) create mode 100644 src/testdir/test_cdo.in create mode 100644 src/testdir/test_cdo.ok diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 94fe977cc7..fe2ef76ef5 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -511,6 +511,8 @@ followed by another Vim command: :argdo :autocmd :bufdo + :cdo + :cfdo :command :cscope :debug @@ -521,6 +523,8 @@ followed by another Vim command: :help :helpfind :lcscope + :ldo + :lfdo :make :normal :perl diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 49a96f6a66..5666e68b5a 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -868,7 +868,8 @@ USING THE ARGUMENT LIST each file. {not in Vi} {not available when compiled without the |+listcmds| feature} - Also see |:windo|, |:tabdo| and |:bufdo|. + Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|, + |:cfdo| and |:lfdo| Example: > :args *.c diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index e8171a90e4..3949c2b577 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1138,6 +1138,8 @@ tag command action ~ |:cc| :cc go to specific error |:cclose| :ccl[ose] close quickfix window |:cd| :cd change directory +|:cdo| :cdo execute command in each valid error list entry +|:cfdo| :cfd[o] execute command in each file in error list |:center| :ce[nter] format lines at the center |:cexpr| :cex[pr] read errors from expr and jump to first |:cfile| :cf[ile] read file with error messages and jump to first @@ -1296,6 +1298,8 @@ tag command action ~ |:lchdir| :lch[dir] change directory locally |:lclose| :lcl[ose] close location window |:lcscope| :lcs[cope] like ":cscope" but uses location list +|:ldo| :ld[o] execute command in valid location list entries +|:lfdo| :lfd[o] execute command in each file in location list |:left| :le[ft] left align lines |:leftabove| :lefta[bove] make split window appear left or above |:let| :let assign a value to a variable or option diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index 46e0a8fde2..b98c18b02c 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -248,7 +248,8 @@ LOOPING OVER TAB PAGES: {cmd} must not open or close tab pages or reorder them. {not in Vi} {not available when compiled without the |+listcmds| feature} - Also see |:windo|, |:argdo| and |:bufdo|. + Also see |:windo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, |:cfdo| + and |:lfdo| ============================================================================== 3. Other items *tab-page-other* diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index a7db69c520..4b947fc81b 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -715,7 +715,8 @@ can also get to them with the buffer list commands, like ":bnext". {cmd} must not open or close windows or reorder them. {not in Vi} {not available when compiled without the |+listcmds| feature} - Also see |:tabdo|, |:argdo| and |:bufdo|. + Also see |:tabdo|, |:argdo|, |:bufdo|, |:cdo|, |:ldo|, + |:cfdo| and |:lfdo| *:bufdo* :[range]bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list or if @@ -743,7 +744,8 @@ can also get to them with the buffer list commands, like ":bnext". each buffer. {not in Vi} {not available when compiled without the |+listcmds| feature} - Also see |:tabdo|, |:argdo| and |:windo|. + Also see |:tabdo|, |:argdo|, |:windo|, |:cdo|, |:ldo|, + |:cfdo| and |:lfdo| Examples: > diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 7945956971..874ac6ba0a 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -65,6 +65,7 @@ #define ADDR_LOADED_BUFFERS 3 #define ADDR_BUFFERS 4 #define ADDR_TABS 5 +#define ADDR_QUICKFIX 6 #ifndef DO_DECLARE_EXCMD typedef struct exarg exarg_T; @@ -270,6 +271,9 @@ EX(CMD_cclose, "cclose", ex_cclose, EX(CMD_cd, "cd", ex_cd, BANG|FILE1|TRLBAR|CMDWIN, ADDR_LINES), +EX(CMD_cdo, "cdo", ex_listdo, + BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, + ADDR_QUICKFIX), EX(CMD_center, "center", ex_align, TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY, ADDR_LINES), @@ -279,6 +283,9 @@ EX(CMD_cexpr, "cexpr", ex_cexpr, EX(CMD_cfile, "cfile", ex_cfile, TRLBAR|FILE1|BANG, ADDR_LINES), +EX(CMD_cfdo, "cfdo", ex_listdo, + BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, + ADDR_QUICKFIX), EX(CMD_cfirst, "cfirst", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), @@ -729,6 +736,9 @@ EX(CMD_lclose, "lclose", ex_cclose, EX(CMD_lcscope, "lcscope", do_cscope, EXTRA|NOTRLCOM|XFILE, ADDR_LINES), +EX(CMD_ldo, "ldo", ex_listdo, + BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, + ADDR_QUICKFIX), EX(CMD_left, "left", ex_align, TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY, ADDR_LINES), @@ -744,6 +754,9 @@ EX(CMD_lexpr, "lexpr", ex_cexpr, EX(CMD_lfile, "lfile", ex_cfile, TRLBAR|FILE1|BANG, ADDR_LINES), +EX(CMD_lfdo, "lfdo", ex_listdo, + BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, + ADDR_QUICKFIX), EX(CMD_lfirst, "lfirst", ex_cc, RANGE|NOTADR|COUNT|TRLBAR|BANG, ADDR_LINES), diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index eefd5d2377..3cc2d45a71 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -2429,7 +2429,7 @@ ex_argdelete(eap) } /* - * ":argdo", ":windo", ":bufdo", ":tabdo" + * ":argdo", ":windo", ":bufdo", ":tabdo", ":cdo", ":ldo", ":cfdo" and ":lfdo" */ void ex_listdo(eap) @@ -2446,6 +2446,10 @@ ex_listdo(eap) char_u *save_ei = NULL; #endif char_u *p_shm_save; +#ifdef FEAT_QUICKFIX + int qf_size; + int qf_idx; +#endif #ifndef FEAT_WINDOWS if (eap->cmdidx == CMD_windo) @@ -2498,18 +2502,37 @@ ex_listdo(eap) } /* set pcmark now */ if (eap->cmdidx == CMD_bufdo) - { + { /* Advance to the first listed buffer after "eap->line1". */ - for (buf = firstbuf; buf != NULL && (buf->b_fnum < eap->line1 + for (buf = firstbuf; buf != NULL && (buf->b_fnum < eap->line1 || !buf->b_p_bl); buf = buf->b_next) if (buf->b_fnum > eap->line2) { buf = NULL; break; } - if (buf != NULL) + if (buf != NULL) goto_buffer(eap, DOBUF_FIRST, FORWARD, buf->b_fnum); - } + } +#ifdef FEAT_QUICKFIX + else if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo + || eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) + { + qf_size = qf_get_size(eap); + if (qf_size <= 0 || eap->line1 > qf_size) + buf = NULL; + else + { + ex_cc(eap); + + buf = curbuf; + i = eap->line1 - 1; + if (eap->addr_count <= 0) + /* default is all the quickfix/location list entries */ + eap->line2 = qf_size; + } + } +#endif else setpcmark(); listcmd_busy = TRUE; /* avoids setting pcmark below */ @@ -2595,11 +2618,28 @@ ex_listdo(eap) set_option_value((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); - /* If autocommands took us elsewhere, quit here */ + /* If autocommands took us elsewhere, quit here. */ if (curbuf->b_fnum != next_fnum) break; } +#ifdef FEAT_QUICKFIX + if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo + || eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) + { + if (i >= qf_size || i >= eap->line2) + break; + + qf_idx = qf_get_cur_idx(eap); + + ex_cnext(eap); + + /* If jumping to the next quickfix entry fails, quit here */ + if (qf_get_cur_idx(eap) == qf_idx) + break; + } +#endif + if (eap->cmdidx == CMD_windo) { validate_cursor(); /* cursor may have moved */ diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 7633d54200..35b6637fdc 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -135,7 +135,7 @@ static int getargopt __ARGS((exarg_T *eap)); #endif static int check_more __ARGS((int, int)); -static linenr_T get_address __ARGS((char_u **, int addr_type, int skip, int to_other_file)); +static linenr_T get_address __ARGS((exarg_T *, char_u **, int addr_type, int skip, int to_other_file)); static void get_flags __ARGS((exarg_T *eap)); #if !defined(FEAT_PERL) \ || !defined(FEAT_PYTHON) || !defined(FEAT_PYTHON3) \ @@ -2173,9 +2173,12 @@ do_one_cmd(cmdlinep, sourcing, lnum = CURRENT_TAB_NR; ea.line2 = lnum; break; + case ADDR_QUICKFIX: + ea.line2 = qf_get_cur_valid_idx(&ea); + break; } ea.cmd = skipwhite(ea.cmd); - lnum = get_address(&ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0); + lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0); if (ea.cmd == NULL) /* error detected */ goto doend; if (lnum == MAXLNUM) @@ -2233,6 +2236,12 @@ do_one_cmd(cmdlinep, sourcing, ea.line2 = ARGCOUNT; } break; + case ADDR_QUICKFIX: + ea.line1 = 1; + ea.line2 = qf_get_size(&ea); + if (ea.line2 == 0) + ea.line2 = 1; + break; } ++ea.addr_count; } @@ -2693,6 +2702,11 @@ do_one_cmd(cmdlinep, sourcing, else ea.line2 = ARGCOUNT; break; + case ADDR_QUICKFIX: + ea.line2 = qf_get_size(&ea); + if (ea.line2 == 0) + ea.line2 = 1; + break; } } @@ -3839,6 +3853,8 @@ set_one_cmd_context(xp, buff) case CMD_botright: case CMD_browse: case CMD_bufdo: + case CMD_cdo: + case CMD_cfdo: case CMD_confirm: case CMD_debug: case CMD_folddoclosed: @@ -3848,7 +3864,9 @@ set_one_cmd_context(xp, buff) case CMD_keepjumps: case CMD_keepmarks: case CMD_keeppatterns: + case CMD_ldo: case CMD_leftabove: + case CMD_lfdo: case CMD_lockmarks: case CMD_noautocmd: case CMD_noswapfile: @@ -4321,7 +4339,8 @@ skip_range(cmd, ctx) * Return MAXLNUM when no Ex address was found. */ static linenr_T -get_address(ptr, addr_type, skip, to_other_file) +get_address(eap, ptr, addr_type, skip, to_other_file) + exarg_T *eap; char_u **ptr; int addr_type; /* flag: one of ADDR_LINES, ... */ int skip; /* only skip the address, don't use it */ @@ -4362,6 +4381,9 @@ get_address(ptr, addr_type, skip, to_other_file) case ADDR_TABS: lnum = CURRENT_TAB_NR; break; + case ADDR_QUICKFIX: + lnum = qf_get_cur_valid_idx(eap); + break; } break; @@ -4394,6 +4416,11 @@ get_address(ptr, addr_type, skip, to_other_file) case ADDR_TABS: lnum = LAST_TAB_NR; break; + case ADDR_QUICKFIX: + lnum = qf_get_size(eap); + if (lnum == 0) + lnum = 1; + break; } break; @@ -4569,6 +4596,9 @@ get_address(ptr, addr_type, skip, to_other_file) case ADDR_TABS: lnum = CURRENT_TAB_NR; break; + case ADDR_QUICKFIX: + lnum = qf_get_cur_valid_idx(eap); + break; } } @@ -4707,6 +4737,10 @@ invalid_range(eap) if (eap->line2 > LAST_TAB_NR) return (char_u *)_(e_invrange); break; + case ADDR_QUICKFIX: + if (eap->line2 != 1 && eap->line2 > qf_get_size(eap)) + return (char_u *)_(e_invrange); + break; } } return NULL; @@ -5817,6 +5851,7 @@ static struct {ADDR_TABS, "tabs"}, {ADDR_BUFFERS, "buffers"}, {ADDR_WINDOWS, "windows"}, + {ADDR_QUICKFIX, "quickfix"}, {-1, NULL} }; #endif @@ -9224,7 +9259,7 @@ ex_copymove(eap) { long n; - n = get_address(&eap->arg, eap->addr_type, FALSE, FALSE); + n = get_address(eap, &eap->arg, eap->addr_type, FALSE, FALSE); if (eap->arg == NULL) /* error detected */ { eap->nextcmd = NULL; diff --git a/src/proto/quickfix.pro b/src/proto/quickfix.pro index a5c690f646..c4e502e6d8 100644 --- a/src/proto/quickfix.pro +++ b/src/proto/quickfix.pro @@ -17,6 +17,9 @@ int bt_dontwrite_msg __ARGS((buf_T *buf)); int buf_hide __ARGS((buf_T *buf)); int grep_internal __ARGS((cmdidx_T cmdidx)); void ex_make __ARGS((exarg_T *eap)); +int qf_get_size __ARGS((exarg_T *eap)); +int qf_get_cur_idx __ARGS((exarg_T *eap)); +int qf_get_cur_valid_idx __ARGS((exarg_T *eap)); void ex_cc __ARGS((exarg_T *eap)); void ex_cnext __ARGS((exarg_T *eap)); void ex_cfile __ARGS((exarg_T *eap)); diff --git a/src/quickfix.c b/src/quickfix.c index 463056b565..7243a0cbc4 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -1373,7 +1373,7 @@ qf_clean_dir_stack(stackptr) /* * Check in which directory of the directory stack the given file can be * found. - * Returns a pointer to the directory name or NULL if not found + * Returns a pointer to the directory name or NULL if not found. * Cleans up intermediate directory entries. * * TODO: How to solve the following problem? @@ -2989,20 +2989,184 @@ get_mef_name() return name; } +/* + * Returns the number of valid entries in the current quickfix/location list. + */ + int +qf_get_size(eap) + exarg_T *eap; +{ + qf_info_T *qi = &ql_info; + qfline_T *qfp; + int i, sz = 0; + int prev_fnum = 0; + + if (eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) + { + /* Location list */ + qi = GET_LOC_LIST(curwin); + if (qi == NULL) + return 0; + } + + for (i = 0, qfp = qi->qf_lists[qi->qf_curlist].qf_start; + (i < qi->qf_lists[qi->qf_curlist].qf_count) && (qfp != NULL); + ++i, qfp = qfp->qf_next) + { + if (qfp->qf_valid) + { + if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo) + sz++; /* Count all valid entries */ + else if (qfp->qf_fnum > 0 && qfp->qf_fnum != prev_fnum) + { + /* Count the number of files */ + sz++; + prev_fnum = qfp->qf_fnum; + } + } + } + + return sz; +} + +/* + * Returns the current index of the quickfix/location list. + * Returns 0 if there is an error. + */ + int +qf_get_cur_idx(eap) + exarg_T *eap; +{ + qf_info_T *qi = &ql_info; + + if (eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) + { + /* Location list */ + qi = GET_LOC_LIST(curwin); + if (qi == NULL) + return 0; + } + + return qi->qf_lists[qi->qf_curlist].qf_index; +} + +/* + * Returns the current index in the quickfix/location list (counting only valid + * entries). If no valid entries are in the list, then returns 1. + */ + int +qf_get_cur_valid_idx(eap) + exarg_T *eap; +{ + qf_info_T *qi = &ql_info; + qf_list_T *qfl; + qfline_T *qfp; + int i, eidx = 0; + int prev_fnum = 0; + + if (eap->cmdidx == CMD_ldo || eap->cmdidx == CMD_lfdo) + { + /* Location list */ + qi = GET_LOC_LIST(curwin); + if (qi == NULL) + return 1; + } + + qfl = &qi->qf_lists[qi->qf_curlist]; + qfp = qfl->qf_start; + + /* check if the list has valid errors */ + if (qfl->qf_count <= 0 || qfl->qf_nonevalid) + return 1; + + for (i = 1; i <= qfl->qf_index && qfp!= NULL; i++, qfp = qfp->qf_next) + { + if (qfp->qf_valid) + { + if (eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) + { + if (qfp->qf_fnum > 0 && qfp->qf_fnum != prev_fnum) + { + /* Count the number of files */ + eidx++; + prev_fnum = qfp->qf_fnum; + } + } + else + eidx++; + } + } + + return eidx ? eidx : 1; +} + +/* + * Get the 'n'th valid error entry in the quickfix or location list. + * Used by :cdo, :ldo, :cfdo and :lfdo commands. + * For :cdo and :ldo returns the 'n'th valid error entry. + * For :cfdo and :lfdo returns the 'n'th valid file entry. + */ + static int +qf_get_nth_valid_entry(qi, n, fdo) + qf_info_T *qi; + int n; + int fdo; +{ + qf_list_T *qfl = &qi->qf_lists[qi->qf_curlist]; + qfline_T *qfp = qfl->qf_start; + int i, eidx; + int prev_fnum = 0; + + /* check if the list has valid errors */ + if (qfl->qf_count <= 0 || qfl->qf_nonevalid) + return 1; + + for (i = 1, eidx = 0; i <= qfl->qf_count && qfp!= NULL; + i++, qfp = qfp->qf_next) + { + if (qfp->qf_valid) + { + if (fdo) + { + if (qfp->qf_fnum > 0 && qfp->qf_fnum != prev_fnum) + { + /* Count the number of files */ + eidx++; + prev_fnum = qfp->qf_fnum; + } + } + else + eidx++; + } + + if (eidx == n) + break; + } + + if (i <= qfl->qf_count) + return i; + else + return 1; +} + /* * ":cc", ":crewind", ":cfirst" and ":clast". * ":ll", ":lrewind", ":lfirst" and ":llast". + * ":cdo", ":ldo", ":cfdo" and ":lfdo" */ void ex_cc(eap) exarg_T *eap; { qf_info_T *qi = &ql_info; + int errornr; if (eap->cmdidx == CMD_ll || eap->cmdidx == CMD_lrewind || eap->cmdidx == CMD_lfirst - || eap->cmdidx == CMD_llast) + || eap->cmdidx == CMD_llast + || eap->cmdidx == CMD_ldo + || eap->cmdidx == CMD_lfdo) { qi = GET_LOC_LIST(curwin); if (qi == NULL) @@ -3012,34 +3176,51 @@ ex_cc(eap) } } - qf_jump(qi, 0, - eap->addr_count > 0 - ? (int)eap->line2 - : (eap->cmdidx == CMD_cc || eap->cmdidx == CMD_ll) - ? 0 - : (eap->cmdidx == CMD_crewind || eap->cmdidx == CMD_lrewind - || eap->cmdidx == CMD_cfirst || eap->cmdidx == CMD_lfirst) - ? 1 - : 32767, - eap->forceit); + if (eap->addr_count > 0) + errornr = (int)eap->line2; + else + { + if (eap->cmdidx == CMD_cc || eap->cmdidx == CMD_ll) + errornr = 0; + else if (eap->cmdidx == CMD_crewind || eap->cmdidx == CMD_lrewind + || eap->cmdidx == CMD_cfirst || eap->cmdidx == CMD_lfirst) + errornr = 1; + else + errornr = 32767; + } + + /* For cdo and ldo commands, jump to the nth valid error. + * For cfdo and lfdo commands, jump to the nth valid file entry. + */ + if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo || + eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) + errornr = qf_get_nth_valid_entry(qi, + eap->addr_count > 0 ? (int)eap->line1 : 1, + eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo); + + qf_jump(qi, 0, errornr, eap->forceit); } /* * ":cnext", ":cnfile", ":cNext" and ":cprevious". * ":lnext", ":lNext", ":lprevious", ":lnfile", ":lNfile" and ":lpfile". + * Also, used by ":cdo", ":ldo", ":cfdo" and ":lfdo" commands. */ void ex_cnext(eap) exarg_T *eap; { qf_info_T *qi = &ql_info; + int errornr; if (eap->cmdidx == CMD_lnext || eap->cmdidx == CMD_lNext || eap->cmdidx == CMD_lprevious || eap->cmdidx == CMD_lnfile || eap->cmdidx == CMD_lNfile - || eap->cmdidx == CMD_lpfile) + || eap->cmdidx == CMD_lpfile + || eap->cmdidx == CMD_ldo + || eap->cmdidx == CMD_lfdo) { qi = GET_LOC_LIST(curwin); if (qi == NULL) @@ -3049,15 +3230,24 @@ ex_cnext(eap) } } - qf_jump(qi, (eap->cmdidx == CMD_cnext || eap->cmdidx == CMD_lnext) + if (eap->addr_count > 0 && + (eap->cmdidx != CMD_cdo && eap->cmdidx != CMD_ldo && + eap->cmdidx != CMD_cfdo && eap->cmdidx != CMD_lfdo)) + errornr = (int)eap->line2; + else + errornr = 1; + + qf_jump(qi, (eap->cmdidx == CMD_cnext || eap->cmdidx == CMD_lnext + || eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo) ? FORWARD - : (eap->cmdidx == CMD_cnfile || eap->cmdidx == CMD_lnfile) + : (eap->cmdidx == CMD_cnfile || eap->cmdidx == CMD_lnfile + || eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo) ? FORWARD_FILE : (eap->cmdidx == CMD_cpfile || eap->cmdidx == CMD_lpfile || eap->cmdidx == CMD_cNfile || eap->cmdidx == CMD_lNfile) ? BACKWARD_FILE : BACKWARD, - eap->addr_count > 0 ? (int)eap->line2 : 1, eap->forceit); + errornr, eap->forceit); } /* diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 901a7c139a..af27919e8d 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -41,6 +41,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test_autocmd_option.out \ test_autoformat_join.out \ test_breakindent.out \ + test_cdo.out \ test_changelist.out \ test_charsearch.out \ test_close_count.out \ @@ -195,6 +196,7 @@ test_argument_count.out: test_argument_count.in test_autocmd_option.out: test_autocmd_option.in test_autoformat_join.out: test_autoformat_join.in test_breakindent.out: test_breakindent.in +test_cdo.out: test_cdo.in test_changelist.out: test_changelist.in test_charsearch.out: test_charsearch.in test_close_count.out: test_close_count.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index 603f4a4118..abef950468 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -40,6 +40,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test_autocmd_option.out \ test_autoformat_join.out \ test_breakindent.out \ + test_cdo.out \ test_changelist.out \ test_charsearch.out \ test_close_count.out \ diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak index 1b76bcc980..aa59a014ec 100644 --- a/src/testdir/Make_ming.mak +++ b/src/testdir/Make_ming.mak @@ -62,6 +62,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test_autocmd_option.out \ test_autoformat_join.out \ test_breakindent.out \ + test_cdo.out \ test_changelist.out \ test_charsearch.out \ test_close_count.out \ diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index 08f78cb1e8..9150af7149 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -42,6 +42,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test_autocmd_option.out \ test_autoformat_join.out \ test_breakindent.out \ + test_cdo.out \ test_changelist.out \ test_charsearch.out \ test_close_count.out \ diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 6e77153883..a716d0361d 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, # Sandor Kopanyi, # -# Last change: 2015 Sep 01 +# Last change: 2015 Sep 08 # # This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64. # Edit the lines in the Configuration section below to select. @@ -101,6 +101,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test_autocmd_option.out \ test_autoformat_join.out \ test_breakindent.out \ + test_cdo.out \ test_changelist.out \ test_charsearch.out \ test_close_count.out \ diff --git a/src/testdir/Makefile b/src/testdir/Makefile index f29ec8b455..39d8388ecb 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -38,6 +38,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test_autocmd_option.out \ test_autoformat_join.out \ test_breakindent.out \ + test_cdo.out \ test_changelist.out \ test_charsearch.out \ test_close_count.out \ diff --git a/src/testdir/test_cdo.in b/src/testdir/test_cdo.in new file mode 100644 index 0000000000..fb80ea1164 --- /dev/null +++ b/src/testdir/test_cdo.in @@ -0,0 +1,107 @@ +Tests for the :cdo, :cfdo, :ldo and :lfdo commands + +STARTTEST +:so small.vim +:if !has('quickfix') | e! test.ok | wq! test.out | endif + +:call writefile(["Line1", "Line2", "Line3"], 'Xtestfile1') +:call writefile(["Line1", "Line2", "Line3"], 'Xtestfile2') +:call writefile(["Line1", "Line2", "Line3"], 'Xtestfile3') + +:function RunTests(cchar) +: let nl="\n" + +: enew +: " Try with an empty list +: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" + +: " Populate the list and then try +: exe a:cchar . "getexpr ['non-error 1', 'Xtestfile1:1:3:Line1', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:3:1:Line3']" +: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" + +: " Run command only on selected error lines +: enew +: exe "2,3" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: " Boundary condition tests +: enew +: exe "1,1" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: enew +: exe "3" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: " Range test commands +: enew +: exe "%" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: enew +: exe "1,$" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: enew +: exe a:cchar . 'prev' +: exe "." . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: " Invalid error lines test +: enew +: exe "27" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "4,5" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" + +: " Run commands from an unsaved buffer +: let v:errmsg='' +: enew +: setlocal modified +: exe "2,2" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: if v:errmsg =~# 'No write since last change' +: let g:result .= 'Unsaved file change test passed' . nl +: else +: let g:result .= 'Unsaved file change test failed' . nl +: endif + +: " If the executed command fails, then the operation should be aborted +: enew! +: let subst_count = 0 +: exe a:cchar . "do s/Line/xLine/ | let subst_count += 1" +: if subst_count == 1 && getline('.') == 'xLine1' +: let g:result .= 'Abort command on error test passed' . nl +: else +: let g:result .= 'Abort command on error test failed' . nl +: endif + +: exe "2,2" . a:cchar . "do! let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" + +: " List with no valid error entries +: edit! +2 Xtestfile1 +: exe a:cchar . "getexpr ['non-error 1', 'non-error 2', 'non-error 3']" +: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "2" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: let v:errmsg='' +: exe "%" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "1,$" . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "." . a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: let g:result .= v:errmsg + +: " List with only one valid entry +: exe a:cchar . "getexpr ['Xtestfile3:3:1:Line3']" +: exe a:cchar . "do let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" + +: " Tests for :cfdo and :lfdo commands +: exe a:cchar . "getexpr ['non-error 1', 'Xtestfile1:1:3:Line1', 'Xtestfile1:2:1:Line2', 'non-error 2', 'Xtestfile2:2:2:Line2', 'non-error 3', 'Xtestfile3:2:3:Line2', 'Xtestfile3:3:1:Line3']" +: exe a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "3" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "2,3" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "%" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe "1,$" . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +: exe a:cchar . 'pfile' +: exe "." . a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" + +: " List with only one valid entry +: exe a:cchar . "getexpr ['Xtestfile2:2:5:Line2']" +: exe a:cchar . "fdo let g:result .= expand('%') . ' ' . line('.') . 'L' . ' ' . col('.') . 'C' . nl" +:endfunction + +:let result='' +:" Tests for the :cdo quickfix list command +:call RunTests('c') +:let result .= "\n" +:" Tests for the :ldo location list command +:call RunTests('l') + +:edit! test.out +:0put =result +:wq! +ENDTEST + diff --git a/src/testdir/test_cdo.ok b/src/testdir/test_cdo.ok new file mode 100644 index 0000000000..ddcff4bbb8 --- /dev/null +++ b/src/testdir/test_cdo.ok @@ -0,0 +1,66 @@ +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile2 2L 2C +Unsaved file change test passed +Abort command on error test passed +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile3 2L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile2 2L 2C +Xtestfile2 2L 5C + +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile2 2L 2C +Unsaved file change test passed +Abort command on error test passed +Xtestfile2 2L 2C +Xtestfile3 3L 1C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile3 2L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile1 1L 3C +Xtestfile2 2L 2C +Xtestfile3 2L 3C +Xtestfile2 2L 2C +Xtestfile2 2L 5C + diff --git a/src/version.c b/src/version.c index 3fb4ad2fe2..0e2e51e2ed 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 858, /**/ 857, /**/ From d8986fd91494642b3bab305406aa55268498f49c Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 19:10:55 +0200 Subject: [PATCH 05/39] patch 7.4.859 Problem: Vim doesn't recognize all htmldjango files. Solution: Recognize a comment. (Daniel Hahler, PR #410) --- runtime/filetype.vim | 4 ++-- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 6bdedfdc99..923df6e2a6 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2015 Aug 11 +" Last Change: 2015 Sep 08 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -872,7 +872,7 @@ func! s:FThtml() setf xhtml return endif - if getline(n) =~ '{%\s*\(extends\|block\|load\)\>' + if getline(n) =~ '{%\s*\(extends\|block\|load\)\>\|{#\s\+' setf htmldjango return endif diff --git a/src/version.c b/src/version.c index 0e2e51e2ed..c1d51e0456 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 859, /**/ 858, /**/ From a122b5e98afe18c9cfdab31b77d2a9fbb8e36416 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 19:13:51 +0200 Subject: [PATCH 06/39] patch 7.4.860 Problem: Filetype detection is outdated. Solution: Include all recent and not-so-recent changes. --- src/version.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/version.c b/src/version.c index c1d51e0456..7ffdd18150 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 860, /**/ 859, /**/ From 3cbe0c01ad71875bd662edb629f9e792a734f292 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 20:00:22 +0200 Subject: [PATCH 07/39] patch 7.4.861 Problem: pango_shape_full() is not always available. Solution: Add a configure check. --- src/auto/configure | 31 +++++++++++++++++++++++++++++++ src/config.h.in | 3 +++ src/configure.in | 16 ++++++++++++++++ src/gui_gtk_x11.c | 5 +++++ src/version.c | 2 ++ 5 files changed, 57 insertions(+) diff --git a/src/auto/configure b/src/auto/configure index cdefc9c299..3bd5685f58 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -12181,6 +12181,37 @@ else $as_echo "yes" >&6; } fi +if test "x$GTK_CFLAGS" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pango_shape_full" >&5 +$as_echo_n "checking for pango_shape_full... " >&6; } + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ + pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_PANGO_SHAPE_FULL 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-gpm argument" >&5 $as_echo_n "checking --disable-gpm argument... " >&6; } # Check whether --enable-gpm was given. diff --git a/src/config.h.in b/src/config.h.in index b8168a55f6..e8d61831a1 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -369,6 +369,9 @@ #undef HAVE_SOLARIS_ACL #undef HAVE_AIX_ACL +/* Define if pango_shape_full() is available. */ +#undef HAVE_PANGO_SHAPE_FULL + /* Define if you want to add support of GPM (Linux console mouse daemon) */ #undef HAVE_GPM diff --git a/src/configure.in b/src/configure.in index 80d70b0e50..f17fcb9aa4 100644 --- a/src/configure.in +++ b/src/configure.in @@ -3539,6 +3539,22 @@ else AC_MSG_RESULT(yes) fi +if test "x$GTK_CFLAGS" != "x"; then + dnl pango_shape_full() is new, fall back to pango_shape(). + AC_MSG_CHECKING(for pango_shape_full) + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_COMPILE( + [#include ], + [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL), + AC_MSG_RESULT(no)) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" +fi + AC_MSG_CHECKING(--disable-gpm argument) AC_ARG_ENABLE(gpm, [ --disable-gpm Don't use gpm (Linux mouse daemon).], , diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 5c4abce65e..bcd05c43e5 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -5063,8 +5063,13 @@ not_ascii: * done, because drawing the cursor would change the display. */ item->analysis.shape_engine = default_shape_engine; +#ifdef HAVE_PANGO_SHAPE_FULL pango_shape_full((const char *)s + item->offset, item->length, (const char *)s, len, &item->analysis, glyphs); +#else + pango_shape((const char *)s + item->offset, item->length, + &item->analysis, glyphs); +#endif /* * Fixed-width hack: iterate over the array and assign a fixed * width to each glyph, thus overriding the choice made by the diff --git a/src/version.c b/src/version.c index 7ffdd18150..78d061c8dc 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 861, /**/ 860, /**/ From 12969c04fe7bd27dc0cbf37709eb40a86d4a27f9 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 8 Sep 2015 23:36:10 +0200 Subject: [PATCH 08/39] Update documentation and syntax files. --- runtime/doc/change.txt | 4 +-- runtime/doc/eval.txt | 9 ++--- runtime/doc/farsi.txt | 4 +-- runtime/doc/index.txt | 2 +- runtime/doc/insert.txt | 2 +- runtime/doc/quickfix.txt | 71 +++++++++++++++++++++++++++++++++++++- runtime/doc/tags | 6 ++++ runtime/doc/todo.txt | 34 +++++++----------- runtime/doc/windows.txt | 18 +++++----- runtime/syntax/gnuplot.vim | 33 +++++++++--------- runtime/syntax/rst.vim | 4 +-- 11 files changed, 127 insertions(+), 60 deletions(-) diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index a7c8a277d1..3a8107ecd2 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.4. Last change: 2015 Aug 04 +*change.txt* For Vim version 7.4. Last change: 2015 Sep 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1135,7 +1135,7 @@ Rationale: In Vi the "y" command followed by a backwards motion would With a linewise yank command the cursor is put in the first line, but the column is unmodified, thus it may not be on the first yanked character. -There are nine types of registers: *registers* *E354* +There are ten types of registers: *registers* *E354* 1. The unnamed register "" 2. 10 numbered registers "0 to "9 3. The small delete register "- diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 893624ac54..84811c0f85 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2015 Jul 21 +*eval.txt* For Vim version 7.4. Last change: 2015 Sep 06 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1747,7 +1747,7 @@ bufexists( {expr}) Number TRUE if buffer {expr} exists buflisted( {expr}) Number TRUE if buffer {expr} is listed bufloaded( {expr}) Number TRUE if buffer {expr} is loaded bufname( {expr}) String Name of the buffer {expr} -bufnr( {expr}) Number Number of the buffer {expr} +bufnr( {expr} [, {create}]) Number Number of the buffer {expr} bufwinnr( {expr}) Number window number of buffer {expr} byte2line( {byte}) Number line number at byte count {byte} byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr} @@ -5419,7 +5419,7 @@ setbufvar({expr}, {varname}, {val}) *setbufvar()* :call setbufvar("todo", "myvar", "foobar") < This function is not available in the |sandbox|. -setcharsearch() *setcharsearch()* +setcharsearch({dict}) *setcharsearch()* Set the current character search information to {dict}, which contains one or more of the following entries: @@ -5861,7 +5861,8 @@ split({expr} [, {pattern} [, {keepempty}]]) *split()* :let words = split(getline('.'), '\W\+') < To split a string in individual characters: > :for c in split(mystring, '\zs') -< If you want to keep the separator you can also use '\zs': > +< If you want to keep the separator you can also use '\zs' at + the end of the pattern: > :echo split('abc:def:ghi', ':\zs') < ['abc:', 'def:', 'ghi'] ~ Splitting a table where the first element can be empty: > diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt index c901d9272b..4f805cef3a 100644 --- a/runtime/doc/farsi.txt +++ b/runtime/doc/farsi.txt @@ -1,4 +1,4 @@ -*farsi.txt* For Vim version 7.4. Last change: 2010 Aug 07 +*farsi.txt* For Vim version 7.4. Last change: 2015 Aug 29 VIM REFERENCE MANUAL by Mortaza Ghassab Shiran @@ -59,7 +59,7 @@ o Toggling between Farsi ISIR-3342 standard encoding and Vim Farsi via F9 right-to-left mode, this function is also supported only in right-to-left mode. -Farsi Fonts *farsi fonts* +Farsi Fonts *farsi-fonts* ----------- The following files are found in the subdirectories of the '$VIM/farsi/fonts' diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt index 3949c2b577..ded50d0e66 100644 --- a/runtime/doc/index.txt +++ b/runtime/doc/index.txt @@ -1,4 +1,4 @@ -*index.txt* For Vim version 7.4. Last change: 2015 Feb 12 +*index.txt* For Vim version 7.4. Last change: 2015 Sep 08 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index b0eae9fee1..6fd08b8957 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.4. Last change: 2015 Jun 20 +*insert.txt* For Vim version 7.4. Last change: 2015 Sep 01 VIM REFERENCE MANUAL by Bram Moolenaar diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index 22d99b908b..9858d4eb76 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -1,4 +1,4 @@ -*quickfix.txt* For Vim version 7.4. Last change: 2014 Mar 27 +*quickfix.txt* For Vim version 7.4. Last change: 2015 Sep 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -299,6 +299,75 @@ use this code: > au QuickfixCmdPost make call QfMakeConv() +EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: + *:cdo* +:cdo[!] {cmd} Execute {cmd} in each valid entry in the quickfix list. + It works like doing this: > + :cfirst + :{cmd} + :cnext + :{cmd} + etc. +< When the current file can't be |abandon|ed and the [!] + is not present, the command fails. + When an error is detected excecution stops. + The last buffer (or where an error occurred) becomes + the current buffer. + {cmd} can contain '|' to concatenate several commands. + + Only valid entries in the quickfix list are used. + A range can be used to select entries, e.g.: > + :10,$cdo cmd +< To skip entries 1 to 9. + + Note: While this command is executing, the Syntax + autocommand event is disabled by adding it to + 'eventignore'. This considerably speeds up editing + each buffer. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + Also see |:bufdo|, |:tabdo|, |:argdo|, |:windo|, + |:ldo|, |:cfdo| and |:lfdo|. + + *:cfdo* +:cfdo[!] {cmd} Execute {cmd} in each file in the quickfix list. + It works like doing this: > + :cfirst + :{cmd} + :cnfile + :{cmd} + etc. +< Otherwise it works the same as `:cdo`. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + + *:ldo* +:ld[o][!] {cmd} Execute {cmd} in each valid entry in the location list + for the current window. + It works like doing this: > + :lfirst + :{cmd} + :lnext + :{cmd} + etc. +< Only valid entries in the location list are used. + Otherwise it works the same as `:cdo`. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + + *:lfdo* +:lfdo[!] {cmd} Execute {cmd} in each file in the location list for + the current window. + It works like doing this: > + :lfirst + :{cmd} + :lnfile + :{cmd} + etc. +< Otherwise it works the same as `:ldo`. + {not in Vi} {not available when compiled without the + |+listcmds| feature} + ============================================================================= 2. The error window *quickfix-window* diff --git a/runtime/doc/tags b/runtime/doc/tags index 00f9776b3f..e66d364b97 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -2015,11 +2015,13 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :cclose quickfix.txt /*:cclose* :cd editing.txt /*:cd* :cd- editing.txt /*:cd-* +:cdo quickfix.txt /*:cdo* :ce change.txt /*:ce* :center change.txt /*:center* :cex quickfix.txt /*:cex* :cexpr quickfix.txt /*:cexpr* :cf quickfix.txt /*:cf* +:cfdo quickfix.txt /*:cfdo* :cfile quickfix.txt /*:cfile* :cfir quickfix.txt /*:cfir* :cfirst quickfix.txt /*:cfirst* @@ -2366,6 +2368,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :lclose quickfix.txt /*:lclose* :lcs if_cscop.txt /*:lcs* :lcscope if_cscop.txt /*:lcscope* +:ldo quickfix.txt /*:ldo* :le change.txt /*:le* :left change.txt /*:left* :lefta windows.txt /*:lefta* @@ -2384,6 +2387,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* :lex quickfix.txt /*:lex* :lexpr quickfix.txt /*:lexpr* :lf quickfix.txt /*:lf* +:lfdo quickfix.txt /*:lfdo* :lfile quickfix.txt /*:lfile* :lfir quickfix.txt /*:lfir* :lfirst quickfix.txt /*:lfirst* @@ -5656,6 +5660,7 @@ extensions-improvements todo.txt /*extensions-improvements* f motion.txt /*f* faq intro.txt /*faq* farsi farsi.txt /*farsi* +farsi-fonts farsi.txt /*farsi-fonts* farsi.txt farsi.txt /*farsi.txt* fasm.vim syntax.txt /*fasm.vim* fcs_choice-variable eval.txt /*fcs_choice-variable* @@ -6542,6 +6547,7 @@ i_CTRL-G_ insert.txt /*i_CTRL-G_* i_CTRL-G_ insert.txt /*i_CTRL-G_* i_CTRL-G_CTRL-J insert.txt /*i_CTRL-G_CTRL-J* i_CTRL-G_CTRL-K insert.txt /*i_CTRL-G_CTRL-K* +i_CTRL-G_U insert.txt /*i_CTRL-G_U* i_CTRL-G_j insert.txt /*i_CTRL-G_j* i_CTRL-G_k insert.txt /*i_CTRL-G_k* i_CTRL-G_u insert.txt /*i_CTRL-G_u* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 85192836d2..84027fe8cc 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2015 Aug 25 +*todo.txt* For Vim version 7.4. Last change: 2015 Sep 08 VIM REFERENCE MANUAL by Bram Moolenaar @@ -73,6 +73,8 @@ Regexp problems: - this doesn't work: "syntax match ErrorMsg /.\%9l\%>20c\&\%<28c/". Leaving out the \& works. Seems any column check after \& fails. +A link from the README.md to Contributing.md would be great. + Still using freed memory after using setloclist(). (lcd, 2014 Jul 23) More info Jul 24. Not clear why. @@ -93,19 +95,18 @@ Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28) Crash when changing the 'tags' option from a remote command. (Benjamin Fritz, 2015 Mar 18, stack trace Mar 20) +Patch to queue commands for clientserver. (James Kolb, 2015 Sep 1) Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab. -Updated Breton spell script. (pull request 396, Dominique) +Unexpected delay when using CTRL-O u. It's not timeoutlen. +(Gary Johnson, 2015 Aug 28) Can src/GvimExt/Make_cyg.mak be removed? Same for src/xxd/Make_cyg.mak Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) -Patch to add CTRL-g U to not break undo for the following cursor movement -command. (Christian Brabandt, 2015 Aug 4) - MS-Windows: When editing a file with a leading space, writing it uses the wrong name. (Aram, 2014 Nov 7) Vim 7.4. @@ -115,8 +116,6 @@ specifically? First try with the parens, then without. Value returned by virtcol() changes depending on how lines wrap. This is inconsistent with the documentation. -Better greek spell checking. Issue 299. - Add bzl filetype support. (David Barnett, 2015 Aug 11) When complete() first argument is before where insert started and 'backspace' @@ -131,12 +130,6 @@ Goes away when disabling the swap file. (might1, Feb 16) MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) -Patch to improve IME handling in the MS-Windows console. -(Ken Takata, 2015 Aug 8) - -Patch to support Unicode I/O in the MS-Windows console. -(Ken Takata, 2015 Aug 8) Also by Yasuhiro Matsumoto. - The argument for "-S" is not taken literally, the ":so" command expands wildcards. Add a ":nowild" command modifier? (ZyX, 2015 March 4) @@ -146,6 +139,9 @@ effects for when set by the user, on init and when reset to default. Proposal to make options.txt easier to read. (Arnaud Decara, 2015 Aug 5) Update Aug 14. +Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6) +Update Sep 7. + Build with Python on Mac does not always use the right library. (Kazunobu Kuriyama, 2015 Mar 28) @@ -156,10 +152,6 @@ inserts a slash when needed? pathconcat(dir, path) (Thilo Six, 2015 Aug 12) ml_updatechunk() is slow when retrying for another encoding. (John Little, 2014 Sep 11) -Patch to fix that "zt" in diff mode doesn't always work properly. -(Christian Brabandt, 2015 Aug 6) Need to uncomment a line to not have filler -lines. - Patch to fix checking global option value when not using it. (Arnaud Decara, 2015 Jul 23) @@ -222,6 +214,9 @@ Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24) Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan 26, update 2013 Dec 14, another 2014 Nov 22) +Patch to improve behavior of dead keys on MS-Windows. (John Wellesz, 2015 Aug +25) https://github.com/vim/vim/pull/399.diff + Result of systemlist() does not show whether text ended in line break. (Bjorn Linse, 2014 Nov 27) @@ -238,11 +233,6 @@ Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19) Should be easy to highlight all matches with 'incsearch'. Idea by Itchyny, 2015 Feb 6. -Patch to add ":ldo" and ":cdo", execute commands over quickfix list and -location list. (Yegappan Lakshmanan, 2013 Jun 2, update 2015 Mar 21) -Update by Florian Walch, 2015 Jul 1. -Update by Yegappan, 2015 Jul 24. - Plugins need to make a lot of effort, lots of mappings, to know what happened before pressing the key that triggers a plugin action. How about keeping the last N pressed keys, so that they do not need to be mapped? diff --git a/runtime/doc/windows.txt b/runtime/doc/windows.txt index 4b947fc81b..020f32d50f 100644 --- a/runtime/doc/windows.txt +++ b/runtime/doc/windows.txt @@ -1,4 +1,4 @@ -*windows.txt* For Vim version 7.4. Last change: 2015 Jul 21 +*windows.txt* For Vim version 7.4. Last change: 2015 Aug 29 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1117,13 +1117,13 @@ list of buffers. |unlisted-buffer| the current buffer remains being edited. See |:buffer-!| for [!]. This will also edit a buffer that is not in the buffer list, without setting the 'buflisted' flag. - Also see ||+cmd|. + Also see |+cmd|. :[N]b[uffer][!] [+cmd] {bufname} Edit buffer for {bufname} from the buffer list. See |:buffer-!| for [!]. This will also edit a buffer that is not in the buffer list, without setting the 'buflisted' flag. - Also see ||+cmd|. + Also see |+cmd|. :[N]sb[uffer] [+cmd] [N] *:sb* *:sbuffer* Split window and edit buffer [N] from the buffer list. If [N] @@ -1131,7 +1131,7 @@ list of buffers. |unlisted-buffer| "useopen" setting of 'switchbuf' when splitting. This will also edit a buffer that is not in the buffer list, without setting the 'buflisted' flag. - Also see ||+cmd|. + Also see |+cmd|. :[N]sb[uffer] [+cmd] {bufname} Split window and edit buffer for {bufname} from the buffer @@ -1140,13 +1140,13 @@ list of buffers. |unlisted-buffer| Note: If what you want to do is split the buffer, make a copy under another name, you can do it this way: > :w foobar | sp # -< Also see ||+cmd|. +< Also see |+cmd|. :[N]bn[ext][!] [+cmd] [N] *:bn* *:bnext* *E87* Go to [N]th next buffer in buffer list. [N] defaults to one. Wraps around the end of the buffer list. See |:buffer-!| for [!]. - Also see ||+cmd|. + Also see |+cmd|. If you are in a help buffer, this takes you to the next help buffer (if there is one). Similarly, if you are in a normal (non-help) buffer, this takes you to the next normal buffer. @@ -1159,21 +1159,21 @@ list of buffers. |unlisted-buffer| :[N]sbn[ext] [+cmd] [N] Split window and go to [N]th next buffer in buffer list. Wraps around the end of the buffer list. Uses 'switchbuf' - Also see ||+cmd|. + Also see |+cmd|. :[N]bN[ext][!] [+cmd] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88* :[N]bp[revious][!] [+cmd] [N] Go to [N]th previous buffer in buffer list. [N] defaults to one. Wraps around the start of the buffer list. See |:buffer-!| for [!] and 'switchbuf'. - Also see ||+cmd|. + Also see |+cmd|. :[N]sbN[ext] [+cmd] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious* :[N]sbp[revious] [+cmd] [N] Split window and go to [N]th previous buffer in buffer list. Wraps around the start of the buffer list. Uses 'switchbuf'. - Also see ||+cmd|. + Also see |+cmd|. :br[ewind][!] [+cmd] *:br* *:brewind* Go to first buffer in buffer list. If the buffer list is diff --git a/runtime/syntax/gnuplot.vim b/runtime/syntax/gnuplot.vim index 03d813c99f..d85932d401 100644 --- a/runtime/syntax/gnuplot.vim +++ b/runtime/syntax/gnuplot.vim @@ -1,8 +1,9 @@ " Vim syntax file " Language: gnuplot 4.7.0 -" Maintainer: Andrew Rasmussen andyras@users.sourceforge.net +" Maintainer: Josh Wainwright +" Last Maintainer: Andrew Rasmussen andyras@users.sourceforge.net " Original Maintainer: John Hoelzel johnh51@users.sourceforge.net -" Last Change: 2014-02-24 +" Last Change: 2015-08-25 " Filenames: *.gnu *.plt *.gpi *.gih *.gp *.gnuplot scripts: #!*gnuplot " URL: http://www.vim.org/scripts/script.php?script_id=4873 " Original URL: http://johnh51.get.to/vim/syntax/gnuplot.vim @@ -364,18 +365,18 @@ syn keyword gnuplotKeyword samples " set size syn keyword gnuplotKeyword size square nosquare ratio noratio " set style -syn keyword gnuplotKeyword style function data noborder rectangle arrow -syn keyword gnuplotKeyword default nohead head heads size filled empty -syn keyword gnuplotKeyword nofilled front back boxplot range fraction -syn keyword gnuplotKeyword outliers nooutliers pointtype candlesticks -syn keyword gnuplotKeyword separation labels off auto x x2 sorted unsorted -syn keyword gnuplotKeyword fill empty transparent solid pattern border -syn keyword gnuplotKeyword increment userstyles financebars line default -syn keyword gnuplotKeyword linetype lt linecolor lc linewidth lw pointtype -syn keyword gnuplotKeyword pt pointsize ps pointinterval pi palette circle -syn keyword gnuplotKeyword radius graph screen wedge nowedge ellipse size -syn keyword gnuplotKeyword units xx xy yy histogram line textbox opaque -syn keyword gnuplotKeyword border noborder +syn keyword gnuplotKeyword style arrow auto back border boxplot +syn keyword gnuplotKeyword candlesticks circle clustered columnstacked data +syn keyword gnuplotKeyword default ellipse empty fill[ed] financebars +syn keyword gnuplotKeyword fraction front function gap graph head[s] +syn keyword gnuplotKeyword histogram increment labels lc line linecolor +syn keyword gnuplotKeyword linetype linewidth lt lw noborder nofilled +syn keyword gnuplotKeyword nohead nooutliers nowedge off opaque outliers +syn keyword gnuplotKeyword palette pattern pi pointinterval pointsize +syn keyword gnuplotKeyword pointtype ps pt radius range rectangle +syn keyword gnuplotKeyword rowstacked screen separation size solid sorted +syn keyword gnuplotKeyword textbox transparent units unsorted userstyles +syn keyword gnuplotKeyword wedge x x2 xx xy yy " set surface syn keyword gnuplotKeyword surface implicit explicit " set table @@ -496,8 +497,8 @@ syn keyword gnuplotTodo contained TODO FIXME XXX syn keyword gnuplotStatement cd call clear evaluate exit fit help history syn keyword gnuplotStatement load lower pause plot p print pwd quit raise syn keyword gnuplotStatement refresh replot rep reread reset save set show -syn keyword gnuplotStatement shell splot spstats system test undefine unset -syn keyword gnuplotStatement update +syn keyword gnuplotStatement shell splot spstats stats system test undefine +syn keyword gnuplotStatement unset update " ---- Define the default highlighting ---- " " For version 5.7 and earlier: only when not done already diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim index c1f25699e7..8b17104be4 100644 --- a/runtime/syntax/rst.vim +++ b/runtime/syntax/rst.vim @@ -2,7 +2,7 @@ " Language: reStructuredText documentation format " Maintainer: Marshall Ward " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2014-10-03 +" Latest Revision: 2015-09-07 if exists("b:current_syntax") finish @@ -81,7 +81,7 @@ syn region rstHyperlinkTarget matchgroup=rstDirective execute 'syn region rstExDirective contained matchgroup=rstDirective' . \ ' start=+' . s:ReferenceName . '::\_s+' . \ ' skip=+^$+' . - \ ' end=+^\s\@!+ contains=@rstCruft' + \ ' end=+^\s\@!+ contains=@rstCruft,rstLiteralBlock' execute 'syn match rstSubstitutionDefinition contained' . \ ' /|' . s:ReferenceName . '|\_s\+/ nextgroup=@rstDirectives' From 5325b9bbae8a717510ef7248f3ce8b50281bd33f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 9 Sep 2015 20:27:02 +0200 Subject: [PATCH 09/39] patch 7.4.862 Problem: Still problems with pango_shape_full() not available. Solution: Change AC_TRY_COMPILE to AC_TRY_LINK. --- src/auto/configure | 5 +++-- src/configure.in | 2 +- src/version.c | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/auto/configure b/src/auto/configure index 3bd5685f58..f2f34d90c6 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -12199,7 +12199,7 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; }; $as_echo "#define HAVE_PANGO_SHAPE_FULL 1" >>confdefs.h @@ -12207,7 +12207,8 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi diff --git a/src/configure.in b/src/configure.in index f17fcb9aa4..e558186adf 100644 --- a/src/configure.in +++ b/src/configure.in @@ -3546,7 +3546,7 @@ if test "x$GTK_CFLAGS" != "x"; then ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" - AC_TRY_COMPILE( + AC_TRY_LINK( [#include ], [ pango_shape_full(NULL, 0, NULL, 0, NULL, NULL); ], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_PANGO_SHAPE_FULL), diff --git a/src/version.c b/src/version.c index 78d061c8dc..9044ca2215 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 862, /**/ 861, /**/ From 43335ea394fe247132b9701c55cccf51e6c36425 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 9 Sep 2015 20:59:37 +0200 Subject: [PATCH 10/39] patch 7.4.863 Problem: plines_nofill() used without the diff feature. Solution: Define PLINES_NOFILL(). --- src/macros.h | 6 ++++++ src/move.c | 41 ++++++++--------------------------------- src/version.c | 2 ++ 3 files changed, 16 insertions(+), 33 deletions(-) diff --git a/src/macros.h b/src/macros.h index 773cffdf77..f70e206144 100644 --- a/src/macros.h +++ b/src/macros.h @@ -315,3 +315,9 @@ # endif # endif #endif + +#ifdef FEAT_DIFF +# define PLINES_NOFILL(x) plines_nofill(x) +#else +# define PLINES_NOFILL(x) plines(x) +#endif diff --git a/src/move.c b/src/move.c index 449382fe97..bc6a1207cd 100644 --- a/src/move.c +++ b/src/move.c @@ -1252,11 +1252,7 @@ scrolldown(line_count, byfold) } else #endif -#ifdef FEAT_DIFF - done += plines_nofill(curwin->w_topline); -#else - done += plines(curwin->w_topline); -#endif + done += PLINES_NOFILL(curwin->w_topline); } --curwin->w_botline; /* approximate w_botline */ invalidate_botline(); @@ -1609,13 +1605,7 @@ topline_back(lp) lp->height = 1; else #endif - { -#ifdef FEAT_DIFF - lp->height = plines_nofill(lp->lnum); -#else - lp->height = plines(lp->lnum); -#endif - } + lp->height = PLINES_NOFILL(lp->lnum); } } @@ -1653,11 +1643,7 @@ botline_forw(lp) else #endif { -#ifdef FEAT_DIFF - lp->height = plines_nofill(lp->lnum); -#else - lp->height = plines(lp->lnum); -#endif + lp->height = PLINES_NOFILL(lp->lnum); } } } @@ -1769,7 +1755,7 @@ scroll_cursor_top(min_scroll, always) i = 1; else #endif - i = plines_nofill(top); + i = PLINES_NOFILL(top); used += i; if (extra + i <= off && bot < curbuf->b_ml.ml_line_count) { @@ -2273,11 +2259,8 @@ cursor_correct() ++above; else #endif -#ifndef FEAT_DIFF - above += plines(topline); -#else - above += plines_nofill(topline); - + above += PLINES_NOFILL(topline); +#ifdef FEAT_DIFF /* Count filler lines below this line as context. */ if (topline < botline) above += diff_check_fill(curwin, topline + 1); @@ -2666,11 +2649,7 @@ halfpage(flag, Prenum) else #endif { -#ifdef FEAT_DIFF - i = plines_nofill(curwin->w_topline); -#else - i = plines(curwin->w_topline); -#endif + i = PLINES_NOFILL(curwin->w_topline); n -= i; if (n < 0 && scrolled > 0) break; @@ -2776,11 +2755,7 @@ halfpage(flag, Prenum) else #endif { -#ifdef FEAT_DIFF - i = plines_nofill(curwin->w_topline - 1); -#else - i = plines(curwin->w_topline - 1); -#endif + i = PLINES_NOFILL(curwin->w_topline - 1); n -= i; if (n < 0 && scrolled > 0) break; diff --git a/src/version.c b/src/version.c index 9044ca2215..7aff3f2391 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 863, /**/ 862, /**/ From e906c502079770ae0e0071c74cefb802689ff193 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 9 Sep 2015 21:10:39 +0200 Subject: [PATCH 11/39] patch 7.4.864 Problem: Tiny build fails. Solution: Put qf_ items inside #ifdef. --- src/ex_docmd.c | 16 +++++++++++++++- src/version.c | 2 ++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 35b6637fdc..045375ac40 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2173,9 +2173,11 @@ do_one_cmd(cmdlinep, sourcing, lnum = CURRENT_TAB_NR; ea.line2 = lnum; break; +#ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: ea.line2 = qf_get_cur_valid_idx(&ea); break; +#endif } ea.cmd = skipwhite(ea.cmd); lnum = get_address(&ea, &ea.cmd, ea.addr_type, ea.skip, ea.addr_count == 0); @@ -2236,12 +2238,14 @@ do_one_cmd(cmdlinep, sourcing, ea.line2 = ARGCOUNT; } break; +#ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: ea.line1 = 1; ea.line2 = qf_get_size(&ea); if (ea.line2 == 0) ea.line2 = 1; break; +#endif } ++ea.addr_count; } @@ -2702,11 +2706,13 @@ do_one_cmd(cmdlinep, sourcing, else ea.line2 = ARGCOUNT; break; +#ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: ea.line2 = qf_get_size(&ea); if (ea.line2 == 0) ea.line2 = 1; break; +#endif } } @@ -4340,7 +4346,7 @@ skip_range(cmd, ctx) */ static linenr_T get_address(eap, ptr, addr_type, skip, to_other_file) - exarg_T *eap; + exarg_T *eap UNUSED; char_u **ptr; int addr_type; /* flag: one of ADDR_LINES, ... */ int skip; /* only skip the address, don't use it */ @@ -4381,9 +4387,11 @@ get_address(eap, ptr, addr_type, skip, to_other_file) case ADDR_TABS: lnum = CURRENT_TAB_NR; break; +#ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: lnum = qf_get_cur_valid_idx(eap); break; +#endif } break; @@ -4416,11 +4424,13 @@ get_address(eap, ptr, addr_type, skip, to_other_file) case ADDR_TABS: lnum = LAST_TAB_NR; break; +#ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: lnum = qf_get_size(eap); if (lnum == 0) lnum = 1; break; +#endif } break; @@ -4596,9 +4606,11 @@ get_address(eap, ptr, addr_type, skip, to_other_file) case ADDR_TABS: lnum = CURRENT_TAB_NR; break; +#ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: lnum = qf_get_cur_valid_idx(eap); break; +#endif } } @@ -4737,10 +4749,12 @@ invalid_range(eap) if (eap->line2 > LAST_TAB_NR) return (char_u *)_(e_invrange); break; +#ifdef FEAT_QUICKFIX case ADDR_QUICKFIX: if (eap->line2 != 1 && eap->line2 > qf_get_size(eap)) return (char_u *)_(e_invrange); break; +#endif } } return NULL; diff --git a/src/version.c b/src/version.c index 7aff3f2391..d1ee1f28ee 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 864, /**/ 863, /**/ From ed84b76021df763619cabaedddc44eb5ee849136 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Wed, 9 Sep 2015 22:35:29 +0200 Subject: [PATCH 12/39] patch 7.4.865 Problem: Compiler warning for uninitialized variable. Solution: Initialize. --- src/ex_cmds2.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 3cc2d45a71..30f9e9d18b 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -2447,7 +2447,7 @@ ex_listdo(eap) #endif char_u *p_shm_save; #ifdef FEAT_QUICKFIX - int qf_size; + int qf_size = 0; int qf_idx; #endif diff --git a/src/version.c b/src/version.c index d1ee1f28ee..a9b20dc0db 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 865, /**/ 864, /**/ From 93c88e0f6a4a8f7634ed84721daf4af46fc0d5db Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2015 14:12:05 +0200 Subject: [PATCH 13/39] patch 7.4.866 Problem: Crash when changing the 'tags' option from a remote command. (Benjamin Fritz) Solution: Instead of executing messages immediately, use a queue, like for netbeans. (James Kolb) --- src/ex_docmd.c | 10 +-- src/getchar.c | 5 +- src/gui_gtk_x11.c | 7 +- src/gui_w48.c | 5 +- src/gui_x11.c | 7 +- src/if_xcmdsrv.c | 139 +++++++++++++++++++++++++++++++++------ src/macros.h | 4 ++ src/misc2.c | 20 ++++++ src/os_unix.c | 39 ++++++----- src/proto/if_xcmdsrv.pro | 4 +- src/proto/misc2.pro | 1 + src/version.c | 2 + 12 files changed, 185 insertions(+), 58 deletions(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 045375ac40..bb07c8bf45 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -9033,11 +9033,11 @@ do_sleep(msec) { ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE); ui_breakcheck(); -#ifdef FEAT_NETBEANS_INTG - /* Process the netbeans messages that may have been received in the - * call to ui_breakcheck() when the GUI is in use. This may occur when - * running a test case. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + /* Process the netbeans and clientserver messages that may have been + * received in the call to ui_breakcheck() when the GUI is in use. This + * may occur when running a test case. */ + parse_queued_messages(); #endif } } diff --git a/src/getchar.c b/src/getchar.c index a80432fc5a..87588a93ac 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3034,9 +3034,8 @@ inchar(buf, maxlen, wait_time, tb_change_cnt) ) { -#if defined(FEAT_NETBEANS_INTG) - /* Process the queued netbeans messages. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + parse_queued_messages(); #endif if (got_int || (script_char = getc(scriptin[curscript])) < 0) diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index bcd05c43e5..d19e61a8ed 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -650,7 +650,7 @@ property_event(GtkWidget *widget, xev.xproperty.atom = commProperty; xev.xproperty.window = commWindow; xev.xproperty.state = PropertyNewValue; - serverEventProc(GDK_WINDOW_XDISPLAY(widget->window), &xev); + serverEventProc(GDK_WINDOW_XDISPLAY(widget->window), &xev, 0); } return FALSE; } @@ -5476,9 +5476,8 @@ gui_mch_wait_for_chars(long wtime) focus = gui.in_focus; } -#if defined(FEAT_NETBEANS_INTG) - /* Process any queued netbeans messages. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + parse_queued_messages(); #endif /* diff --git a/src/gui_w48.c b/src/gui_w48.c index 1096ec8452..b40a6b9e00 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -2016,9 +2016,8 @@ gui_mch_wait_for_chars(int wtime) s_need_activate = FALSE; } -#ifdef FEAT_NETBEANS_INTG - /* Process the queued netbeans messages. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + parse_queued_messages(); #endif /* diff --git a/src/gui_x11.c b/src/gui_x11.c index ed71b26ce8..276930728f 100644 --- a/src/gui_x11.c +++ b/src/gui_x11.c @@ -2895,9 +2895,8 @@ gui_mch_wait_for_chars(wtime) focus = gui.in_focus; } -#if defined(FEAT_NETBEANS_INTG) - /* Process any queued netbeans messages. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + parse_queued_messages(); #endif /* @@ -3199,7 +3198,7 @@ gui_x11_send_event_handler(w, client_data, event, dum) if (e->type == PropertyNotify && e->window == commWindow && e->atom == commProperty && e->state == PropertyNewValue) { - serverEventProc(gui.dpy, event); + serverEventProc(gui.dpy, event, 0); } } #endif diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c index d8c64ad4b0..dfa8fcbcb8 100644 --- a/src/if_xcmdsrv.c +++ b/src/if_xcmdsrv.c @@ -169,6 +169,19 @@ enum ServerReplyOp { SROP_Find, SROP_Add, SROP_Delete }; typedef int (*EndCond) __ARGS((void *)); +struct x_cmdqueue +{ + char_u *propInfo; + int len; + struct x_cmdqueue *next; + struct x_cmdqueue *prev; +}; + +typedef struct x_cmdqueue x_queue_T; + +/* dummy node, header for circular queue */ +static x_queue_T head = {NULL, 0, NULL, NULL}; + /* * Forward declarations for procedures defined later in this file: */ @@ -186,6 +199,8 @@ static struct ServerReply *ServerReplyFind __ARGS((Window w, enum ServerReplyOp static int AppendPropCarefully __ARGS((Display *display, Window window, Atom property, char_u *value, int length)); static int x_error_check __ARGS((Display *dpy, XErrorEvent *error_event)); static int IsSerialName __ARGS((char_u *name)); +static void save_in_queue __ARGS((char_u *buf, int len)); +static void server_parse_message __ARGS((Display *dpy, char_u *propInfo, int numItems)); /* Private variables for the "server" functionality */ static Atom registryProperty = None; @@ -595,7 +610,7 @@ ServerWait(dpy, w, endCond, endData, localLoop, seconds) while (TRUE) { while (XCheckWindowEvent(dpy, commWindow, PropertyChangeMask, &event)) - serverEventProc(dpy, &event); + serverEventProc(dpy, &event, 1); if (endCond(endData) != 0) break; @@ -1127,22 +1142,25 @@ GetRegProp(dpy, regPropp, numItemsp, domsg) return OK; } + /* * This procedure is invoked by the various X event loops throughout Vims when * a property changes on the communication window. This procedure reads the - * property and handles command requests and responses. + * property and enqueues command requests and responses. If immediate is true, + * it runs the event immediatly instead of enqueuing it. Immediate can cause + * unintended behavior and should only be used for code that blocks for a + * response. */ void -serverEventProc(dpy, eventPtr) +serverEventProc(dpy, eventPtr, immediate) Display *dpy; - XEvent *eventPtr; /* Information about event. */ + XEvent *eventPtr; /* Information about event. */ + int immediate; /* Run event immediately. Should mostly be 0. */ { char_u *propInfo; - char_u *p; - int result, actualFormat, code; + int result, actualFormat; long_u numItems, bytesAfter; Atom actualType; - char_u *tofree; if (eventPtr != NULL) { @@ -1168,6 +1186,87 @@ serverEventProc(dpy, eventPtr) XFree(propInfo); return; } + if (immediate) + server_parse_message(dpy, propInfo, numItems); + else + save_in_queue(propInfo, numItems); +} + +/* + * Saves x clientserver commands in a queue so that they can be called when + * vim is idle. + */ + static void +save_in_queue(propInfo, len) + char_u *propInfo; + int len; +{ + x_queue_T *node; + + node = (x_queue_T *)alloc(sizeof(x_queue_T)); + if (node == NULL) + return; /* out of memory */ + node->propInfo = propInfo; + node->len = len; + + if (head.next == NULL) /* initialize circular queue */ + { + head.next = &head; + head.prev = &head; + } + + /* insert node at tail of queue */ + node->next = &head; + node->prev = head.prev; + head.prev->next = node; + head.prev = node; +} + +/* + * Parses queued clientserver messages. + */ + void +server_parse_messages() +{ + char_u *p; + x_queue_T *node; + + if (!X_DISPLAY) + return; /* cannot happen? */ + while (head.next != NULL && head.next != &head) + { + node = head.next; + server_parse_message(X_DISPLAY, node->propInfo, node->len); + head.next = node->next; + node->next->prev = node->prev; + vim_free(node); + } +} + +/* + * Returns a non-zero value if there are clientserver messages waiting + * int the queue. + */ + int +server_waiting() +{ + return head.next != NULL && head.next != &head; +} + +/* + * Prases a single clientserver message. A single message may contain multiple + * commands. + * "propInfo" will be freed. + */ + static void +server_parse_message(dpy, propInfo, numItems) + Display *dpy; + char_u *propInfo; /* A string containing 0 or more X commands */ + int numItems; /* The size of propInfo in bytes. */ +{ + char_u *p; + int code; + char_u *tofree; /* * Several commands and results could arrive in the property at @@ -1248,16 +1347,16 @@ serverEventProc(dpy, eventPtr) if (script == NULL || name == NULL) continue; - if (serverName != NULL && STRICMP(name, serverName) == 0) - { - script = serverConvert(enc, script, &tofree); - if (asKeys) - server_to_input_buf(script); - else - { - char_u *res; + if (serverName != NULL && STRICMP(name, serverName) == 0) + { + script = serverConvert(enc, script, &tofree); + if (asKeys) + server_to_input_buf(script); + else + { + char_u *res; - res = eval_client_expr_to_string(script); + res = eval_client_expr_to_string(script); if (resWindow != None) { garray_T reply; @@ -1290,10 +1389,10 @@ serverEventProc(dpy, eventPtr) reply.ga_data, reply.ga_len); ga_clear(&reply); } - vim_free(res); - } - vim_free(tofree); - } + vim_free(res); + } + vim_free(tofree); + } } else if (*p == 'r' && p[1] == 0) { diff --git a/src/macros.h b/src/macros.h index f70e206144..caaca9a3ef 100644 --- a/src/macros.h +++ b/src/macros.h @@ -321,3 +321,7 @@ #else # define PLINES_NOFILL(x) plines(x) #endif + +#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_CLIENTSERVER) +# define MESSAGE_QUEUE +#endif diff --git a/src/misc2.c b/src/misc2.c index 379916b393..e6a4e747d9 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -6328,3 +6328,23 @@ has_non_ascii(s) return FALSE; } #endif + +#if defined(MESSAGE_QUEUE) || defined(PROTO) +/* + * Process messages that have been queued for netbeans or clientserver. + * These functions can call arbitrary vimscript and should only be called when + * it is safe to do so. + */ + void +parse_queued_messages() +{ +# ifdef FEAT_NETBEANS_INTG + /* Process the queued netbeans messages. */ + netbeans_parse_messages(); +# endif +# ifdef FEAT_CLIENTSERVER + /* Process the queued clientserver messages. */ + server_parse_messages(); +# endif +} +#endif diff --git a/src/os_unix.c b/src/os_unix.c index 2439c5e252..8f059be8fe 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -388,9 +388,8 @@ mch_inchar(buf, maxlen, wtime, tb_change_cnt) { int len; -#ifdef FEAT_NETBEANS_INTG - /* Process the queued netbeans messages. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + parse_queued_messages(); #endif /* Check if window changed size while we were busy, perhaps the ":set @@ -405,9 +404,8 @@ mch_inchar(buf, maxlen, wtime, tb_change_cnt) if (!do_resize) /* return if not interrupted by resize */ return 0; handle_resize(); -#ifdef FEAT_NETBEANS_INTG - /* Process the queued netbeans messages. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + parse_queued_messages(); #endif } } @@ -439,9 +437,8 @@ mch_inchar(buf, maxlen, wtime, tb_change_cnt) while (do_resize) /* window changed size */ handle_resize(); -#ifdef FEAT_NETBEANS_INTG - /* Process the queued netbeans messages. */ - netbeans_parse_messages(); +#ifdef MESSAGE_QUEUE + parse_queued_messages(); #endif /* * We want to be interrupted by the winch signal @@ -5208,6 +5205,7 @@ WaitForChar(msec) * When a GUI is being used, this will not be used for input -- webb * Returns also, when a request from Sniff is waiting -- toni. * Or when a Linux GPM mouse event is waiting. + * Or when a clientserver message is on the queue. */ #if defined(__BEOS__) int @@ -5601,6 +5599,11 @@ select_eintr: if (finished || msec == 0) break; +# ifdef FEAT_CLIENTSERVER + if (server_waiting()) + break; +# endif + /* We're going to loop around again, find out for how long */ if (msec > 0) { @@ -7106,31 +7109,31 @@ xterm_update() for (;;) { - XtInputMask mask = XtAppPending(app_context); + XtInputMask mask = XtAppPending(app_context); - if (mask == 0 || vim_is_input_buf_full()) + if (mask == 0 || vim_is_input_buf_full()) break; - if (mask & XtIMXEvent) + if (mask & XtIMXEvent) { /* There is an event to process. */ - XtAppNextEvent(app_context, &event); + XtAppNextEvent(app_context, &event); #ifdef FEAT_CLIENTSERVER { XPropertyEvent *e = (XPropertyEvent *)&event; if (e->type == PropertyNotify && e->window == commWindow && e->atom == commProperty && e->state == PropertyNewValue) - serverEventProc(xterm_dpy, &event); + serverEventProc(xterm_dpy, &event, 0); } #endif - XtDispatchEvent(&event); - } + XtDispatchEvent(&event); + } else { /* There is something else than an event to process. */ - XtAppProcessEvent(app_context, mask); - } + XtAppProcessEvent(app_context, mask); + } } } diff --git a/src/proto/if_xcmdsrv.pro b/src/proto/if_xcmdsrv.pro index dd6a12084d..30647539ee 100644 --- a/src/proto/if_xcmdsrv.pro +++ b/src/proto/if_xcmdsrv.pro @@ -7,5 +7,7 @@ Window serverStrToWin __ARGS((char_u *str)); int serverSendReply __ARGS((char_u *name, char_u *str)); int serverReadReply __ARGS((Display *dpy, Window win, char_u **str, int localLoop)); int serverPeekReply __ARGS((Display *dpy, Window win, char_u **str)); -void serverEventProc __ARGS((Display *dpy, XEvent *eventPtr)); +void serverEventProc __ARGS((Display *dpy, XEvent *eventPtr, int immediate)); +void server_parse_messages __ARGS((void)); +int server_waiting __ARGS((void)); /* vim: set ft=c : */ diff --git a/src/proto/misc2.pro b/src/proto/misc2.pro index f09ff33ac3..490b1aff8d 100644 --- a/src/proto/misc2.pro +++ b/src/proto/misc2.pro @@ -106,4 +106,5 @@ int put_bytes __ARGS((FILE *fd, long_u nr, int len)); void put_time __ARGS((FILE *fd, time_t the_time)); void time_to_bytes __ARGS((time_t the_time, char_u *buf)); int has_non_ascii __ARGS((char_u *s)); +void parse_queued_messages __ARGS((void)); /* vim: set ft=c : */ diff --git a/src/version.c b/src/version.c index a9b20dc0db..e5038260fc 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 866, /**/ 865, /**/ From 9534680731ea342c2fed01a812559958923480da Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2015 15:57:29 +0200 Subject: [PATCH 14/39] patch 7.4.867 Problem: Can't build on MS-Windows. (Taro Muraoka) Solution: Adjust #ifdef. --- src/misc2.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc2.c b/src/misc2.c index e6a4e747d9..407d6b5d55 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -6342,7 +6342,7 @@ parse_queued_messages() /* Process the queued netbeans messages. */ netbeans_parse_messages(); # endif -# ifdef FEAT_CLIENTSERVER +# if defined(FEAT_CLIENTSERVER) && defined(FEAT_X11) /* Process the queued clientserver messages. */ server_parse_messages(); # endif diff --git a/src/version.c b/src/version.c index e5038260fc..7d61973aa8 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 867, /**/ 866, /**/ From 54f018cd5994c3ffcd0740526e56db6934edf1f2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2015 17:30:40 +0200 Subject: [PATCH 15/39] patch 7.4.868 Problem: 'smarttab' is also effective when 'paste' is enabled. (Alexander Monakov) Solution: Disable 'smarttab' when 'paste' is set. (Christian Brabandt) Do the same for 'expandtab'. --- src/option.c | 23 +++++++++++++++++------ src/structs.h | 1 + src/version.c | 2 ++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/option.c b/src/option.c index 2fc6bd0483..d1bce6ac38 100644 --- a/src/option.c +++ b/src/option.c @@ -387,10 +387,11 @@ static long p_tw_nobin; static long p_wm_nobin; /* Saved values for when 'paste' is set */ +static int p_ai_nopaste; +static int p_et_nopaste; +static long p_sts_nopaste; static long p_tw_nopaste; static long p_wm_nopaste; -static long p_sts_nopaste; -static int p_ai_nopaste; struct vimoption { @@ -10702,6 +10703,7 @@ buf_copy_options(buf, flags) buf->b_p_fixeol = p_fixeol; buf->b_p_et = p_et; buf->b_p_et_nobin = p_et_nobin; + buf->b_p_et_nopaste = p_et_nopaste; buf->b_p_ml = p_ml; buf->b_p_ml_nobin = p_ml_nobin; buf->b_p_inf = p_inf; @@ -11640,6 +11642,7 @@ paste_option_changed() { static int old_p_paste = FALSE; static int save_sm = 0; + static int save_sta = 0; #ifdef FEAT_CMDL_INFO static int save_ru = 0; #endif @@ -11664,10 +11667,12 @@ paste_option_changed() buf->b_p_wm_nopaste = buf->b_p_wm; buf->b_p_sts_nopaste = buf->b_p_sts; buf->b_p_ai_nopaste = buf->b_p_ai; + buf->b_p_et_nopaste = buf->b_p_et; } /* save global options */ save_sm = p_sm; + save_sta = p_sta; #ifdef FEAT_CMDL_INFO save_ru = p_ru; #endif @@ -11676,10 +11681,11 @@ paste_option_changed() save_hkmap = p_hkmap; #endif /* save global values for local buffer options */ + p_ai_nopaste = p_ai; + p_et_nopaste = p_et; + p_sts_nopaste = p_sts; p_tw_nopaste = p_tw; p_wm_nopaste = p_wm; - p_sts_nopaste = p_sts; - p_ai_nopaste = p_ai; } /* @@ -11693,10 +11699,12 @@ paste_option_changed() buf->b_p_wm = 0; /* wrapmargin is 0 */ buf->b_p_sts = 0; /* softtabstop is 0 */ buf->b_p_ai = 0; /* no auto-indent */ + buf->b_p_et = 0; /* no expandtab */ } /* set global options */ p_sm = 0; /* no showmatch */ + p_sta = 0; /* no smarttab */ #ifdef FEAT_CMDL_INFO # ifdef FEAT_WINDOWS if (p_ru) @@ -11727,10 +11735,12 @@ paste_option_changed() buf->b_p_wm = buf->b_p_wm_nopaste; buf->b_p_sts = buf->b_p_sts_nopaste; buf->b_p_ai = buf->b_p_ai_nopaste; + buf->b_p_et = buf->b_p_et_nopaste; } /* restore global options */ p_sm = save_sm; + p_sta = save_sta; #ifdef FEAT_CMDL_INFO # ifdef FEAT_WINDOWS if (p_ru != save_ru) @@ -11743,10 +11753,11 @@ paste_option_changed() p_hkmap = save_hkmap; #endif /* set global values for local buffer options */ + p_ai = p_ai_nopaste; + p_et = p_et_nopaste; + p_sts = p_sts_nopaste; p_tw = p_tw_nopaste; p_wm = p_wm_nopaste; - p_sts = p_sts_nopaste; - p_ai = p_ai_nopaste; } old_p_paste = p_paste; diff --git a/src/structs.h b/src/structs.h index d14c5bd5a0..addc212bf8 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1589,6 +1589,7 @@ struct file_buffer int b_p_fixeol; /* 'fixendofline' */ int b_p_et; /* 'expandtab' */ int b_p_et_nobin; /* b_p_et saved for binary mode */ + int b_p_et_nopaste; /* b_p_et saved for paste mode */ #ifdef FEAT_MBYTE char_u *b_p_fenc; /* 'fileencoding' */ #endif diff --git a/src/version.c b/src/version.c index 7d61973aa8..a3eabcf3fe 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 868, /**/ 867, /**/ From 3b59755862f4604ded8155404a1fe4c84c606829 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2015 17:58:29 +0200 Subject: [PATCH 16/39] patch 7.4.869 Problem: MS-Windows: scrolling may cause text to disappear when using an Intel GPU. Solution: Call GetPixel(). (Yohei Endo) --- src/gui_w48.c | 28 +++++++++++++++++++++++----- src/version.c | 2 ++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/gui_w48.c b/src/gui_w48.c index b40a6b9e00..bff67a8131 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -2389,7 +2389,7 @@ show_tabline_popup_menu(void) return; if (first_tabpage->tp_next != NULL) - add_tabline_popup_menu_entry(tab_pmenu, + add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_CLOSE, _("Close tab")); add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab")); add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN, @@ -2931,10 +2931,10 @@ gui_mswin_get_valid_dimensions( base_width = gui_get_base_width() + (GetSystemMetrics(SM_CXFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; base_height = gui_get_base_height() + (GetSystemMetrics(SM_CYFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + GetSystemMetrics(SM_CYCAPTION) #ifdef FEAT_MENU + gui_mswin_get_menu_height(FALSE) @@ -2996,6 +2996,20 @@ get_scroll_flags(void) return 0; } +/* + * On some Intel GPUs, the regions drawn just prior to ScrollWindowEx() + * may not be scrolled out properly. + * For gVim, when _OnScroll() is repeated, the character at the + * previous cursor position may be left drawn after scroll. + * The problem can be avoided by calling GetPixel() to get a pixel in + * the region before ScrollWindowEx(). + */ + static void +intel_gpu_workaround(void) +{ + GetPixel(s_hdc, FILL_X(gui.col), FILL_Y(gui.row)); +} + /* * Delete the given number of lines from the given row, scrolling up any * text further down within the scroll region. @@ -3007,6 +3021,8 @@ gui_mch_delete_lines( { RECT rc; + intel_gpu_workaround(); + rc.left = FILL_X(gui.scroll_region_left); rc.right = FILL_X(gui.scroll_region_right + 1); rc.top = FILL_Y(row); @@ -3038,6 +3054,8 @@ gui_mch_insert_lines( { RECT rc; + intel_gpu_workaround(); + rc.left = FILL_X(gui.scroll_region_left); rc.right = FILL_X(gui.scroll_region_right + 1); rc.top = FILL_Y(row); @@ -3319,10 +3337,10 @@ gui_mch_newfont() GetWindowRect(s_hwnd, &rect); gui_resize_shell(rect.right - rect.left - (GetSystemMetrics(SM_CXFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2, + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2, rect.bottom - rect.top - (GetSystemMetrics(SM_CYFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 - GetSystemMetrics(SM_CYCAPTION) #ifdef FEAT_MENU - gui_mswin_get_menu_height(FALSE) diff --git a/src/version.c b/src/version.c index a3eabcf3fe..bc1e5550ca 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 869, /**/ 868, /**/ From 2455c4ede8d4ff6f0754977b548708eec08869eb Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2015 18:29:39 +0200 Subject: [PATCH 17/39] patch 7.4.870 Problem: May get into an invalid state when using getchar() in an expression mapping. Solution: Anticipate mod_mask to change. (idea by Yukihiro Nakadaira) --- src/getchar.c | 5 ++++- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/getchar.c b/src/getchar.c index 87588a93ac..f4ec991b09 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -1630,13 +1630,16 @@ vgetc() last_recorded_len = 0; for (;;) /* this is done twice if there are modifiers */ { + int did_inc = FALSE; + if (mod_mask) /* no mapping after modifier has been read */ { ++no_mapping; ++allow_keys; + did_inc = TRUE; /* mod_mask may change value */ } c = vgetorpeek(TRUE); - if (mod_mask) + if (did_inc) { --no_mapping; --allow_keys; diff --git a/src/version.c b/src/version.c index bc1e5550ca..0cb1fc62b5 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 870, /**/ 869, /**/ From 7b256fe7445b46929f660ea74e9090418f857696 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2015 19:05:59 +0200 Subject: [PATCH 18/39] patch 7.4.871 Problem: Vim leaks memory, when 'wildignore' filters out all matches. Solution: Free the files array when it becomes empty. --- src/misc1.c | 48 ++++++++++++++++++++++++++++-------------------- src/version.c | 2 ++ 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/misc1.c b/src/misc1.c index 8b5ea647e8..7eb3dce8b9 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -9697,14 +9697,14 @@ expand_wildcards_eval(pat, num_file, file, flags) /* * Expand wildcards. Calls gen_expand_wildcards() and removes files matching * 'wildignore'. - * Returns OK or FAIL. When FAIL then "num_file" won't be set. + * Returns OK or FAIL. When FAIL then "num_files" won't be set. */ int -expand_wildcards(num_pat, pat, num_file, file, flags) +expand_wildcards(num_pat, pat, num_files, files, flags) int num_pat; /* number of input patterns */ char_u **pat; /* array of input patterns */ - int *num_file; /* resulting number of files */ - char_u ***file; /* array of resulting files */ + int *num_files; /* resulting number of files */ + char_u ***files; /* array of resulting files */ int flags; /* EW_DIR, etc. */ { int retval; @@ -9712,7 +9712,7 @@ expand_wildcards(num_pat, pat, num_file, file, flags) char_u *p; int non_suf_match; /* number without matching suffix */ - retval = gen_expand_wildcards(num_pat, pat, num_file, file, flags); + retval = gen_expand_wildcards(num_pat, pat, num_files, files, flags); /* When keeping all matches, return here */ if ((flags & EW_KEEPALL) || retval == FAIL) @@ -9726,47 +9726,55 @@ expand_wildcards(num_pat, pat, num_file, file, flags) { char_u *ffname; - /* check all files in (*file)[] */ - for (i = 0; i < *num_file; ++i) + /* check all files in (*files)[] */ + for (i = 0; i < *num_files; ++i) { - ffname = FullName_save((*file)[i], FALSE); + ffname = FullName_save((*files)[i], FALSE); if (ffname == NULL) /* out of memory */ break; # ifdef VMS vms_remove_version(ffname); # endif - if (match_file_list(p_wig, (*file)[i], ffname)) + if (match_file_list(p_wig, (*files)[i], ffname)) { - /* remove this matching file from the list */ - vim_free((*file)[i]); - for (j = i; j + 1 < *num_file; ++j) - (*file)[j] = (*file)[j + 1]; - --*num_file; + /* remove this matching files from the list */ + vim_free((*files)[i]); + for (j = i; j + 1 < *num_files; ++j) + (*files)[j] = (*files)[j + 1]; + --*num_files; --i; } vim_free(ffname); } + + /* If the number of matches is now zero, we fail. */ + if (*num_files == 0) + { + vim_free(*files); + *files = NULL; + return FAIL; + } } #endif /* * Move the names where 'suffixes' match to the end. */ - if (*num_file > 1) + if (*num_files > 1) { non_suf_match = 0; - for (i = 0; i < *num_file; ++i) + for (i = 0; i < *num_files; ++i) { - if (!match_suffix((*file)[i])) + if (!match_suffix((*files)[i])) { /* * Move the name without matching suffix to the front * of the list. */ - p = (*file)[i]; + p = (*files)[i]; for (j = i; j > non_suf_match; --j) - (*file)[j] = (*file)[j - 1]; - (*file)[non_suf_match++] = p; + (*files)[j] = (*files)[j - 1]; + (*files)[non_suf_match++] = p; } } } diff --git a/src/version.c b/src/version.c index 0cb1fc62b5..20107c5015 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 871, /**/ 870, /**/ From 0600f3511c6018cbcdb170a904bcf6533a06bf2d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Tue, 15 Sep 2015 19:18:18 +0200 Subject: [PATCH 19/39] patch 7.4.872 Problem: Not using CI services available. Solution: Add configuration files for travis and appveyor. (PR #401) --- .travis.yml | 37 +++++++++++++++++++++++++++++++++++++ Filelist | 2 ++ appveyor.yml | 15 +++++++++++++++ src/version.c | 2 ++ 4 files changed, 56 insertions(+) create mode 100644 .travis.yml create mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..b8210ca9e4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +language: c + +compiler: + - clang + - gcc + +env: + - COVERAGE=yes CFLAGS=--coverage LDFLAGS=--coverage FEATURES=huge + "CONFOPT='--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp'" + - COVERAGE=no FEATURES=small CONFOPT= + - COVERAGE=no FEATURES=tiny CONFOPT= + +sudo: false + +addons: + apt: + packages: + - lcov + - libperl-dev + - python-dev + - python3-dev + - liblua5.1-0-dev + - lua5.1 + +before_install: + - pip install --user cpp-coveralls + +script: + - NPROC=$(getconf _NPROCESSORS_ONLN) + - ./configure --with-features=$FEATURES $CONFOPT --enable-fail-if-missing && make -j$NPROC + - ./src/vim --version + - make test + +after_success: + - if [ x"$COVERAGE" = "xyes" ]; then ~/.local/bin/coveralls -b src -x .xs -e src/xxd -e src/if_perl.c --encodings utf-8 latin-1 EUC-KR; fi + +# vim:set sts=2 sw=2 tw=0 et: diff --git a/Filelist b/Filelist index 166e2f4fa6..2440a0cc8f 100644 --- a/Filelist +++ b/Filelist @@ -4,6 +4,8 @@ # source files for all source archives SRC_ALL = \ .hgignore \ + .travis.yml \ + appveyor.yml \ src/README.txt \ src/arabic.c \ src/arabic.h \ diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..3bda489a47 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,15 @@ +version: "{build}" + +before_build: + - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release' + +build_script: + - cd src + - sed -e "s/\$(LINKARGS2)/\$(LINKARGS2) | sed -e 's#.*\\\\r.*##'/" Make_mvc.mak > Make_mvc2.mak + - nmake -f Make_mvc2.mak CPU=AMD64 GUI=yes IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 PYTHON3_VER=34 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python34-x64 + - .\gvim -u NONE -c "redir @a | ver | 0put a | wq!" ver.txt + - type ver.txt + +test_script: + - cd testdir + - nmake -f Make_dos.mak VIMPROG=..\gvim diff --git a/src/version.c b/src/version.c index 20107c5015..53da1ea2a3 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 872, /**/ 871, /**/ From b8603882b1679385b287f14c527fa61eee60a9dd Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 17 Sep 2015 23:20:42 +0200 Subject: [PATCH 20/39] patch 7.4.873 Problem: Compiler warning for unused variable. (Tony Mechelynck) Solution: Remove the variable. Also fix int vs long_u mixup. --- src/if_xcmdsrv.c | 13 ++++++------- src/version.c | 2 ++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/if_xcmdsrv.c b/src/if_xcmdsrv.c index dfa8fcbcb8..cf6d9a77ae 100644 --- a/src/if_xcmdsrv.c +++ b/src/if_xcmdsrv.c @@ -172,7 +172,7 @@ typedef int (*EndCond) __ARGS((void *)); struct x_cmdqueue { char_u *propInfo; - int len; + long_u len; struct x_cmdqueue *next; struct x_cmdqueue *prev; }; @@ -199,8 +199,8 @@ static struct ServerReply *ServerReplyFind __ARGS((Window w, enum ServerReplyOp static int AppendPropCarefully __ARGS((Display *display, Window window, Atom property, char_u *value, int length)); static int x_error_check __ARGS((Display *dpy, XErrorEvent *error_event)); static int IsSerialName __ARGS((char_u *name)); -static void save_in_queue __ARGS((char_u *buf, int len)); -static void server_parse_message __ARGS((Display *dpy, char_u *propInfo, int numItems)); +static void save_in_queue __ARGS((char_u *buf, long_u len)); +static void server_parse_message __ARGS((Display *dpy, char_u *propInfo, long_u numItems)); /* Private variables for the "server" functionality */ static Atom registryProperty = None; @@ -1198,8 +1198,8 @@ serverEventProc(dpy, eventPtr, immediate) */ static void save_in_queue(propInfo, len) - char_u *propInfo; - int len; + char_u *propInfo; + long_u len; { x_queue_T *node; @@ -1228,7 +1228,6 @@ save_in_queue(propInfo, len) void server_parse_messages() { - char_u *p; x_queue_T *node; if (!X_DISPLAY) @@ -1262,7 +1261,7 @@ server_waiting() server_parse_message(dpy, propInfo, numItems) Display *dpy; char_u *propInfo; /* A string containing 0 or more X commands */ - int numItems; /* The size of propInfo in bytes. */ + long_u numItems; /* The size of propInfo in bytes. */ { char_u *p; int code; diff --git a/src/version.c b/src/version.c index 53da1ea2a3..9bbe042a70 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 873, /**/ 872, /**/ From 8919554fe17255cddbbce6b833fab9aba19c8b88 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 15:00:31 +0200 Subject: [PATCH 21/39] patch 7.4.874 Problem: MS-Windows: When Vim runs inside another application, the size isn't right. Solution: When in child mode compute the size differently. (Agorgianitis Loukas) --- src/gui_w48.c | 29 +++++++++++++++++++++-------- src/version.c | 2 ++ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/src/gui_w48.c b/src/gui_w48.c index bff67a8131..ef288e1e64 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -3335,17 +3335,30 @@ gui_mch_newfont() RECT rect; GetWindowRect(s_hwnd, &rect); - gui_resize_shell(rect.right - rect.left - - (GetSystemMetrics(SM_CXFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2, - rect.bottom - rect.top - - (GetSystemMetrics(SM_CYFRAME) + - GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 - - GetSystemMetrics(SM_CYCAPTION) + if (win_socket_id == 0) + { + gui_resize_shell(rect.right - rect.left + - (GetSystemMetrics(SM_CXFRAME) + + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2, + rect.bottom - rect.top + - (GetSystemMetrics(SM_CYFRAME) + + GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + - GetSystemMetrics(SM_CYCAPTION) +#ifdef FEAT_MENU + - gui_mswin_get_menu_height(FALSE) +#endif + ); + } + else + { + /* Inside another window, don't use the frame and border. */ + gui_resize_shell(rect.right - rect.left, + rect.bottom - rect.top #ifdef FEAT_MENU - gui_mswin_get_menu_height(FALSE) #endif - ); + ); + } } /* diff --git a/src/version.c b/src/version.c index 9bbe042a70..f8fe4a8911 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 874, /**/ 873, /**/ From 3fe076f0feb91460266fdf7f9133a59c49a53c4e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 15:00:56 +0200 Subject: [PATCH 22/39] patch 7.4.875 Problem: Not obvious how to contribute. Solution: Add a remark about CONTRIBUTING.md to README.md --- README.md | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 384c4ec8d7..809f8efcfb 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,11 @@ See one of these files for system-specific instructions: There are more `README_*.txt` files, depending on the distribution you used. +## Contributing ## + +If you would like to help making Vim better, see the `CONTRIBUTING.md` file. + + ## Information ## The latest news about Vim can be found on the Vim home page: diff --git a/src/version.c b/src/version.c index f8fe4a8911..1347ac8813 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 875, /**/ 874, /**/ From b0262f239e77480f81fa3345491b7b6d52a17f6d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 15:28:38 +0200 Subject: [PATCH 23/39] patch 7.4.876 Problem: Windows7: when using vim.exe with msys or msys2, conhost.exe (console window provider on Windows7) will freeze or crash. Solution: Make original screen buffer active, before executing external program. And when the program is finished, revert to vim's one. (Taro Muraoka) --- src/os_win32.c | 31 +++++++++++++++++++++++++++++-- src/version.c | 2 ++ 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/os_win32.c b/src/os_win32.c index 7695e938c3..6981d2f31c 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -234,6 +234,7 @@ static int suppress_winsize = 1; /* don't fiddle with console */ static char_u *exe_path = NULL; +static BOOL is_win7 = FALSE; static BOOL win8_or_later = FALSE; /* @@ -680,6 +681,9 @@ PlatformId(void) g_PlatformId = ovi.dwPlatformId; + if ((ovi.dwMajorVersion == 6 && ovi.dwMinorVersion == 1)) + is_win7 = TRUE; + if ((ovi.dwMajorVersion == 6 && ovi.dwMinorVersion >= 2) || ovi.dwMajorVersion > 6) win8_or_later = TRUE; @@ -4581,11 +4585,12 @@ mch_system(char *cmd, int options) else return mch_system_classic(cmd, options); } + #else # ifdef FEAT_MBYTE static int -mch_system(char *cmd, int options) +mch_system1(char *cmd, int options) { if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) { @@ -4600,9 +4605,31 @@ mch_system(char *cmd, int options) return system(cmd); } # else -# define mch_system(c, o) system(c) +# define mch_system1(c, o) system(c) # endif + static int +mch_system(char *cmd, int options) +{ + int ret; + + /* + * Restore non-termcap screen buffer before execute external program, and + * revert it after. Because msys and msys2's programs will cause freeze + * or crash conhost.exe (Windows's console window provider) and vim.exe, + * if active screen buffer is vim's one on Windows7. + */ + if (is_win7 && g_fTermcapMode) + SetConsoleActiveScreenBuffer(g_cbNonTermcap.handle); + + ret = mch_system1(cmd, options); + + if (is_win7 && g_fTermcapMode) + SetConsoleActiveScreenBuffer(g_cbTermcap.handle); + + return ret; +} + #endif /* diff --git a/src/version.c b/src/version.c index 1347ac8813..b24af2326c 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 876, /**/ 875, /**/ From 4d0c7bc74ac6fad5cb599dc3ade6996e848d83b6 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 16:38:01 +0200 Subject: [PATCH 24/39] patch 7.4.877 Problem: ":find" sometimes fails. (Excanoe) Solution: Compare current characters instead of previous ones. --- src/misc2.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/misc2.c b/src/misc2.c index 407d6b5d55..4f821178fb 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -5084,7 +5084,7 @@ ff_wc_equal(s1, s2) i += MB_PTR2LEN(s1 + i); j += MB_PTR2LEN(s2 + j); } - return c1 == c2; + return s1[i] == s2[j]; } #endif diff --git a/src/version.c b/src/version.c index b24af2326c..1c9eeedeb8 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 877, /**/ 876, /**/ From 69b67f7e774dc212e8c97495ee81c601b8a89ac2 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 16:59:47 +0200 Subject: [PATCH 25/39] patch 7.4.878 Problem: Coverity error for clearing only one byte of struct. Solution: Clear the whole struct. (Dominique Pelle) --- src/ex_docmd.c | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index bb07c8bf45..c3a01df9fb 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -871,7 +871,7 @@ do_cmdline(cmdline, fgetline, cookie, flags) if (flags & DOCMD_EXCRESET) save_dbg_stuff(&debug_saved); else - vim_memset(&debug_saved, 0, 1); + vim_memset(&debug_saved, 0, sizeof(debug_saved)); initial_trylevel = trylevel; diff --git a/src/version.c b/src/version.c index 1c9eeedeb8..fadd0d4892 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 878, /**/ 877, /**/ From 1d6328ca00fc6cfe37b1f5e038ec23f443258886 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 17:37:16 +0200 Subject: [PATCH 26/39] patch 7.4.879 Problem: Can't see line numbers in nested function calls. Solution: Add line number to the file name. (Alberto Fanjul) --- src/eval.c | 10 +++++++--- src/version.c | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/eval.c b/src/eval.c index 9a590c7491..064e55f6f2 100644 --- a/src/eval.c +++ b/src/eval.c @@ -23817,6 +23817,7 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict) int ai; char_u numbuf[NUMBUFLEN]; char_u *name; + size_t len; #ifdef FEAT_PROFILE proftime_T wait_start; proftime_T call_start; @@ -23948,13 +23949,16 @@ call_user_func(fp, argcount, argvars, rettv, firstline, lastline, selfdict) save_sourcing_name = sourcing_name; save_sourcing_lnum = sourcing_lnum; sourcing_lnum = 1; - sourcing_name = alloc((unsigned)((save_sourcing_name == NULL ? 0 - : STRLEN(save_sourcing_name)) + STRLEN(fp->uf_name) + 13)); + /* need space for function name + ("function " + 3) or "[number]" */ + len = (save_sourcing_name == NULL ? 0 : STRLEN(save_sourcing_name)) + + STRLEN(fp->uf_name) + 20; + sourcing_name = alloc((unsigned)len); if (sourcing_name != NULL) { if (save_sourcing_name != NULL && STRNCMP(save_sourcing_name, "function ", 9) == 0) - sprintf((char *)sourcing_name, "%s..", save_sourcing_name); + sprintf((char *)sourcing_name, "%s[%d]..", + save_sourcing_name, (int)save_sourcing_lnum); else STRCPY(sourcing_name, "function "); cat_func_name(sourcing_name + STRLEN(sourcing_name), fp); diff --git a/src/version.c b/src/version.c index fadd0d4892..f20dc8992e 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 879, /**/ 878, /**/ From 02d803fc0cc99a1c86a3553a1d445137eab1aa8d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 17:50:22 +0200 Subject: [PATCH 27/39] patch 7.4.880 Problem: No build and coverage status. Solution: Add links to the README file. (Christian Brabandt) --- README.md | 3 +++ src/version.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 809f8efcfb..e66e8b549f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ Which one you need depends on the system you want to run it on and whether you want or must compile it yourself. Check http://www.vim.org/download.php for an overview of currently available distributions. +[![Build Status](https://travis-ci.org/vim/vim.svg?branch=master)](https://travis-ci.org/vim/vim) +[![Coverage Status](https://coveralls.io/repos/vim/vim/badge.svg?branch=master&service=github)](https://coveralls.io/github/vim/vim?branch=master) + ## Documentation ## diff --git a/src/version.c b/src/version.c index f20dc8992e..37c63ecda4 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 880, /**/ 879, /**/ From 0a777ab9890ba0e8dd57f082e98fde1adab36aa0 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 17:56:50 +0200 Subject: [PATCH 28/39] patch 7.4.881 Problem: Test 49 fails. Solution: Add line number to check of call stack. --- src/testdir/test49.vim | 26 +++++++++++++------------- src/version.c | 2 ++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/testdir/test49.vim b/src/testdir/test49.vim index e08da5712d..50c17952a7 100644 --- a/src/testdir/test49.vim +++ b/src/testdir/test49.vim @@ -1,6 +1,6 @@ " Vim script language tests " Author: Servatius Brandt -" Last Change: 2013 Jun 06 +" Last Change: 2015 Sep 25 "------------------------------------------------------------------------------- " Test environment {{{1 @@ -5188,19 +5188,19 @@ catch /.*/ Xpath 65536 " X: 65536 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(1, "oops", '\', '\<2\>') + call CHECK(1, "oops", '\', '\<2\>') exec "let exception = v:exception" exec "let throwpoint = v:throwpoint" - call CHECK(2, "oops", '\', '\<2\>') + call CHECK(2, "oops", '\', '\<2\>') CmdException CmdThrowpoint - call CHECK(3, "oops", '\', '\<2\>') + call CHECK(3, "oops", '\', '\<2\>') call FuncException() call FuncThrowpoint() - call CHECK(4, "oops", '\', '\<2\>') + call CHECK(4, "oops", '\', '\<2\>') exec "source" scriptException exec "source" scriptThrowPoint - call CHECK(5, "oops", '\', '\<2\>') + call CHECK(5, "oops", '\', '\<2\>') try Xpath 131072 " X: 131072 call G("arrgh", 4) @@ -5208,7 +5208,7 @@ catch /.*/ Xpath 262144 " X: 262144 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(6, "arrgh", '\', '\<4\>') + call CHECK(6, "arrgh", '\', '\<4\>') try Xpath 524288 " X: 524288 let g:arg = "autsch" @@ -5226,7 +5226,7 @@ catch /.*/ Xpath 2097152 " X: 2097152 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(8, "arrgh", '\', '\<4\>') + call CHECK(8, "arrgh", '\', '\<4\>') try Xpath 4194304 " X: 4194304 let g:arg = "brrrr" @@ -5242,27 +5242,27 @@ catch /.*/ Xpath 16777216 " X: 16777216 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(10, "arrgh", '\', '\<4\>') + call CHECK(10, "arrgh", '\', '\<4\>') endtry Xpath 33554432 " X: 33554432 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(11, "arrgh", '\', '\<4\>') + call CHECK(11, "arrgh", '\', '\<4\>') endtry Xpath 67108864 " X: 67108864 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(12, "arrgh", '\', '\<4\>') + call CHECK(12, "arrgh", '\', '\<4\>') finally Xpath 134217728 " X: 134217728 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(13, "oops", '\', '\<2\>') + call CHECK(13, "oops", '\', '\<2\>') endtry Xpath 268435456 " X: 268435456 let exception = v:exception let throwpoint = v:throwpoint - call CHECK(14, "oops", '\', '\<2\>') + call CHECK(14, "oops", '\', '\<2\>') finally Xpath 536870912 " X: 536870912 let exception = v:exception diff --git a/src/version.c b/src/version.c index 37c63ecda4..079d99d680 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 881, /**/ 880, /**/ From 5f1fea28f5bc573e2430773c49e95ae1f9cc2a25 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 19:12:22 +0200 Subject: [PATCH 29/39] patch 7.4.882 Problem: When leaving the command line window with CTRL-C while a completion menu is displayed the menu isn't removed. Solution: Force a screen update. (Hirohito Higashi) --- src/edit.c | 6 ++++++ src/version.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/edit.c b/src/edit.c index db4a079e40..bd5c57e1a9 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3903,6 +3903,12 @@ ins_compl_prep(c) showmode(); } +#ifdef FEAT_CMDWIN + if (c == Ctrl_C && cmdwin_type != 0) + /* Avoid the popup menu remains displayed when leaving the + * command line window. */ + update_screen(0); +#endif #ifdef FEAT_CINDENT /* * Indent now if a key was typed that is in 'cinkeys'. diff --git a/src/version.c b/src/version.c index 079d99d680..586ce19c98 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 882, /**/ 881, /**/ From 10ad1d90da8c464e1bf08bf23d92d4888378a8a1 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 19:35:02 +0200 Subject: [PATCH 30/39] patch 7.4.883 Problem: Block-mode replace works characterwise instead of blockwise after column 147. (Issue #422) Solution: Set Visual mode. (Christian Brabandt) --- src/normal.c | 2 +- src/testdir/test_listlbr.in | 4 ++++ src/testdir/test_listlbr.ok | 3 +++ src/version.c | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/normal.c b/src/normal.c index 69b0dcecbe..b994056e65 100644 --- a/src/normal.c +++ b/src/normal.c @@ -9596,7 +9596,7 @@ get_op_vcol(oap, redo_VIsual_vcol, initial) || (!initial && oap->end.col < W_WIDTH(curwin))) return; - oap->block_mode = VIsual_active; + oap->block_mode = TRUE; #ifdef FEAT_MBYTE /* prevent from moving onto a trail byte */ diff --git a/src/testdir/test_listlbr.in b/src/testdir/test_listlbr.in index e5372d4de1..52cbc100cb 100644 --- a/src/testdir/test_listlbr.in +++ b/src/testdir/test_listlbr.in @@ -87,6 +87,10 @@ Go abcd{ef ghijklm no}pqrs2k0f{c% +:let g:test ="Test 11: using block replace mode after wrapping" +:$put =g:test +:set linebreak wrap +Go150aayypk147|jr0 :%w! test.out :qa! ENDTEST diff --git a/src/testdir/test_listlbr.ok b/src/testdir/test_listlbr.ok index 295a9f7378..ff30b46ee8 100644 --- a/src/testdir/test_listlbr.ok +++ b/src/testdir/test_listlbr.ok @@ -49,3 +49,6 @@ A Test 10: using normal commands after block-visual abcdpqrs +Test 11: using block replace mode after wrapping +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0aaa +aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa0aaa diff --git a/src/version.c b/src/version.c index 586ce19c98..38fdf93bd1 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 883, /**/ 882, /**/ From c1d20998d71f3fa0aebeeee42007a337cd7e3d8a Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 20:30:58 +0200 Subject: [PATCH 31/39] patch 7.4.884 Problem: Travis also builds on a tag push. Solution: Filter out tag pushes. (Kenichi Ito) --- .travis.yml | 4 ++++ src/version.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index b8210ca9e4..0ef9f57216 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,10 @@ env: sudo: false +branches: + except: + - /^v[0-9]/ + addons: apt: packages: diff --git a/src/version.c b/src/version.c index 38fdf93bd1..8d782620db 100644 --- a/src/version.c +++ b/src/version.c @@ -741,6 +741,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 884, /**/ 883, /**/ From ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 25 Sep 2015 20:34:21 +0200 Subject: [PATCH 32/39] Update various runtime files. --- runtime/autoload/python3complete.vim | 3 +- runtime/doc/cmdline.txt | 14 +++---- runtime/doc/eval.txt | 5 ++- runtime/doc/insert.txt | 4 +- runtime/doc/options.txt | 52 +++++++++++++++++--------- runtime/doc/todo.txt | 27 ++++++++------ runtime/filetype.vim | 6 +-- runtime/indent/html.vim | 54 ++++++++++++++++++++------- runtime/indent/yaml.vim | 10 ++++- runtime/spell/br/main.aap | 16 ++++---- runtime/spell/en.ascii.spl | Bin 568018 -> 568021 bytes runtime/spell/en.ascii.sug | Bin 555651 -> 555651 bytes runtime/spell/en.latin1.spl | Bin 570117 -> 608891 bytes runtime/spell/en.latin1.sug | Bin 556476 -> 596960 bytes runtime/spell/en.utf-8.spl | Bin 570548 -> 609336 bytes runtime/spell/en.utf-8.sug | Bin 556476 -> 596960 bytes runtime/syntax/cmake.vim | 12 +++--- runtime/syntax/python.vim | 6 ++- runtime/syntax/screen.vim | 20 ++++++++-- src/po/es.po | 3 +- 20 files changed, 155 insertions(+), 77 deletions(-) diff --git a/runtime/autoload/python3complete.vim b/runtime/autoload/python3complete.vim index b02200be7f..f0f3aaddb3 100644 --- a/runtime/autoload/python3complete.vim +++ b/runtime/autoload/python3complete.vim @@ -1,7 +1,7 @@ "python3complete.vim - Omni Completion for python " Maintainer: Aaron Griffin " Version: 0.9 -" Last Updated: 18 Jun 2009 +" Last Updated: 18 Jun 2009 (small fix 2015 Sep 14 from Debian) " " Roland Puntaier: this file contains adaptations for python3 and is parallel to pythoncomplete.vim " @@ -359,6 +359,7 @@ class PyParser: def __init__(self): self.top = Scope('global',0) self.scope = self.top + self.parserline = 0 def _parsedotname(self,pre=None): #returns (dottedname, nexttoken) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index fe2ef76ef5..6197171023 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.4. Last change: 2015 Jul 28 +*cmdline.txt* For Vim version 7.4. Last change: 2015 Sep 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -818,12 +818,12 @@ Note: these are typed literally, they are not special keys! (for FileType, Syntax and SpellFileMissing events). When executing a ":source" command, is replaced with the file name of the sourced file. *E498* - When executing a function, is replaced with - "function {function-name}"; function call nesting is - indicated like this: - "function {function-name1}..{function-name2}". Note that - filename-modifiers are useless when is used inside - a function. + When executing a function, is replaced with: + "function {function-name}[{lnum}]" + function call nesting is indicated like this: + "function {function-name1}[{lnum}]..{function-name2}[{lnum}]" + Note that filename-modifiers are useless when is + used inside a function. When executing a ":source" command, is replaced with the line number. *E842* When executing a function it's the line number relative to diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 84811c0f85..6e7039cefa 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2015 Sep 06 +*eval.txt* For Vim version 7.4. Last change: 2015 Sep 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -6122,6 +6122,9 @@ synID({lnum}, {col}, {trans}) *synID()* {col} is 1 for the leftmost column, {lnum} is 1 for the first line. 'synmaxcol' applies, in a longer line zero is returned. + Note that when the position is after the last character, + that's where the cursor can be in Insert mode, synID() returns + zero. When {trans} is non-zero, transparent items are reduced to the item that they reveal. This is useful when wanting to know diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt index 6fd08b8957..787d6115a6 100644 --- a/runtime/doc/insert.txt +++ b/runtime/doc/insert.txt @@ -1,4 +1,4 @@ -*insert.txt* For Vim version 7.4. Last change: 2015 Sep 01 +*insert.txt* For Vim version 7.4. Last change: 2015 Sep 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -152,7 +152,7 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R* CTRL-R a results in "ac". CTRL-R CTRL-R a results in "ab^Hc". < Options 'textwidth', 'formatoptions', etc. still apply. If - you also want to avoid these, use "r", see below. + you also want to avoid these, use CTRL-R CTRL-O, see below. The '.' register (last inserted text) is still inserted as typed. {not in Vi} diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 48793a94de..3cb667d35d 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1,4 +1,4 @@ -*options.txt* For Vim version 7.4. Last change: 2015 Aug 25 +*options.txt* For Vim version 7.4. Last change: 2015 Sep 15 VIM REFERENCE MANUAL by Bram Moolenaar @@ -796,7 +796,8 @@ A jump table for the options with a short description can be found at |Q_op|. line. When 'smartindent' or 'cindent' is on the indent is changed in a different way. - The 'autoindent' option is reset when the 'paste' option is set. + The 'autoindent' option is reset when the 'paste' option is set and + restored when 'paste' is reset. {small difference from Vi: After the indent is deleted when typing or , the cursor position when moving up or down is after the deleted indent; Vi puts the cursor somewhere in the deleted indent}. @@ -2835,6 +2836,8 @@ A jump table for the options with a short description can be found at |Q_op|. . Spaces are used in indents with the '>' and '<' commands and when 'autoindent' is on. To insert a real tab when 'expandtab' is on, use CTRL-V. See also |:retab| and |ins-expandtab|. + This option is reset when the 'paste' option is set and restored when + the 'paste' option is reset. NOTE: This option is reset when 'compatible' is set. *'exrc'* *'ex'* *'noexrc'* *'noex'* @@ -5412,19 +5415,21 @@ A jump table for the options with a short description can be found at |Q_op|. When the 'paste' option is switched on (also when it was already on): - mapping in Insert mode and Command-line mode is disabled - abbreviations are disabled - - 'textwidth' is set to 0 - - 'wrapmargin' is set to 0 - 'autoindent' is reset - - 'smartindent' is reset - - 'softtabstop' is set to 0 + - 'expandtab' is reset + - 'formatoptions' is used like it is empty - 'revins' is reset - 'ruler' is reset - 'showmatch' is reset - - 'formatoptions' is used like it is empty + - 'smartindent' is reset + - 'smarttab' is reset + - 'softtabstop' is set to 0 + - 'textwidth' is set to 0 + - 'wrapmargin' is set to 0 These options keep their value, but their effect is disabled: - - 'lisp' - - 'indentexpr' - 'cindent' + - 'indentexpr' + - 'lisp' NOTE: When you start editing another file while the 'paste' option is on, settings from the modelines or autocommands may change the settings again, causing trouble when pasting text. You might want to @@ -5857,7 +5862,9 @@ A jump table for the options with a short description can be found at |Q_op|. Inserting characters in Insert mode will work backwards. See "typing backwards" |ins-reverse|. This option can be toggled with the CTRL-_ command in Insert mode, when 'allowrevins' is set. - NOTE: This option is reset when 'compatible' or 'paste' is set. + NOTE: This option is reset when 'compatible' is set. + This option is reset when 'paste' is set and restored when 'paste' is + reset. *'rightleft'* *'rl'* *'norightleft'* *'norl'* 'rightleft' 'rl' boolean (default off) @@ -5913,7 +5920,8 @@ A jump table for the options with a short description can be found at |Q_op|. separated with a dash. For an empty line "0-1" is shown. For an empty buffer the line number will also be zero: "0,0-1". - This option is reset when the 'paste' option is set. + This option is reset when 'paste' is set and restored when 'paste' is + reset. If you don't want to see the ruler all the time but want to know where you are, use "g CTRL-G" |g_CTRL-G|. NOTE: This option is reset when 'compatible' is set. @@ -6552,7 +6560,9 @@ A jump table for the options with a short description can be found at |Q_op|. jump is only done if the match can be seen on the screen. The time to show the match can be set with 'matchtime'. A Beep is given if there is no match (no matter if the match can be - seen or not). This option is reset when the 'paste' option is set. + seen or not). + This option is reset when 'paste' is set and restored when 'paste' is + reset. When the 'm' flag is not included in 'cpoptions', typing a character will immediately move the cursor back to where it belongs. See the "sm" field in 'guicursor' for setting the cursor shape and @@ -6661,8 +6671,9 @@ A jump table for the options with a short description can be found at |Q_op|. mapping: ":inoremap # X^H#", where ^H is entered with CTRL-V CTRL-H. When using the ">>" command, lines starting with '#' are not shifted right. - NOTE: 'smartindent' is reset when 'compatible' is set. When 'paste' - is set smart indenting is disabled. + NOTE: 'smartindent' is reset when 'compatible' is set. + This option is reset when 'paste' is set and restored when 'paste' is + reset. *'smarttab'* *'sta'* *'nosmarttab'* *'nosta'* 'smarttab' 'sta' boolean (default off) @@ -6678,6 +6689,8 @@ A jump table for the options with a short description can be found at |Q_op|. What gets inserted (a or spaces) depends on the 'expandtab' option. Also see |ins-expandtab|. When 'expandtab' is not set, the number of spaces is minimized by using s. + This option is reset when 'paste' is set and restored when 'paste' is + reset. NOTE: This option is reset when 'compatible' is set. *'softtabstop'* *'sts'* @@ -6692,7 +6705,8 @@ A jump table for the options with a short description can be found at |Q_op|. commands like "x" still work on the actual characters. When 'sts' is zero, this feature is off. When 'sts' is negative, the value of 'shiftwidth' is used. - 'softtabstop' is set to 0 when the 'paste' option is set. + 'softtabstop' is set to 0 when the 'paste' option is set and restored + when 'paste' is reset. See also |ins-expandtab|. When 'expandtab' is not set, the number of spaces is minimized by using s. The 'L' flag in 'cpoptions' changes how tabs are used when 'list' is @@ -7451,8 +7465,10 @@ A jump table for the options with a short description can be found at |Q_op|. {not in Vi} Maximum width of text that is being inserted. A longer line will be broken after white space to get this width. A zero value disables - this. 'textwidth' is set to 0 when the 'paste' option is set. When - 'textwidth' is zero, 'wrapmargin' may be used. See also + this. + 'textwidth' is set to 0 when the 'paste' option is set and restored + when 'paste' is reset. + When 'textwidth' is zero, 'wrapmargin' may be used. See also 'formatoptions' and |ins-textwidth|. When 'formatexpr' is set it will be used to break the line. NOTE: This option is set to 0 when 'compatible' is set. @@ -8474,6 +8490,8 @@ A jump table for the options with a short description can be found at |Q_op|. Options that add a margin, such as 'number' and 'foldcolumn', cause the text width to be further reduced. This is Vi compatible. When 'textwidth' is non-zero, this option is not used. + This option is set to 0 when 'paste' is set and restored when 'paste' + is reset. See also 'formatoptions' and |ins-textwidth|. {Vi: works differently and less usefully} diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 84027fe8cc..fe75e59406 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 7.4. Last change: 2015 Sep 08 +*todo.txt* For Vim version 7.4. Last change: 2015 Sep 25 VIM REFERENCE MANUAL by Bram Moolenaar @@ -73,8 +73,6 @@ Regexp problems: - this doesn't work: "syntax match ErrorMsg /.\%9l\%>20c\&\%<28c/". Leaving out the \& works. Seems any column check after \& fails. -A link from the README.md to Contributing.md would be great. - Still using freed memory after using setloclist(). (lcd, 2014 Jul 23) More info Jul 24. Not clear why. @@ -93,10 +91,6 @@ Perhaps we can use ":silent window"? Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28) -Crash when changing the 'tags' option from a remote command. -(Benjamin Fritz, 2015 Mar 18, stack trace Mar 20) -Patch to queue commands for clientserver. (James Kolb, 2015 Sep 1) - Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab. Unexpected delay when using CTRL-O u. It's not timeoutlen. @@ -107,6 +101,8 @@ Same for src/xxd/Make_cyg.mak Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) +2html update. (Ben Fritz, 2015 Sep 9) + MS-Windows: When editing a file with a leading space, writing it uses the wrong name. (Aram, 2014 Nov 7) Vim 7.4. @@ -130,6 +126,9 @@ Goes away when disabling the swap file. (might1, Feb 16) MS-Windows: Crash opening very long file name starting with "\\". (Christian Brock, 2012 Jun 29) +The OptionSet autocommand event is not always triggered. (Rick Howe, 2015 Sep +24): setwinvar(), :diffthis, :diffoff. + The argument for "-S" is not taken literally, the ":so" command expands wildcards. Add a ":nowild" command modifier? (ZyX, 2015 March 4) @@ -139,8 +138,11 @@ effects for when set by the user, on init and when reset to default. Proposal to make options.txt easier to read. (Arnaud Decara, 2015 Aug 5) Update Aug 14. +Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015 +Sep 10) + Patch to be able to use hex numbers with :digraph. (Lcd, 2015 Sep 6) -Update Sep 7. +Update Sep 7. Update by Christian Brabandt, 2015 Sep 8. Build with Python on Mac does not always use the right library. (Kazunobu Kuriyama, 2015 Mar 28) @@ -209,6 +211,9 @@ Patch on Issue 72: 'autochdir' causes problems for :vimgrep. When 'balloonexpr' returns a list the result has a trailing newline. Just remove one trailing newline. (lcd, 2014 Oct 17) +When two SIGWINCH arrive very quickly, the second one may be lost. +(Josh Triplett, 2015 Sep 17) + Make comments in the test Makefile silent. (Kartik Agaram, 2014 Sep 24) Patch to add GUI colors to the terminal, when it supports it. (ZyX, 2013 Jan @@ -279,6 +284,9 @@ Delete old code in os_msdos.c, mch_FullName(). Patch: On MS-Windows shellescape() may have to triple double quotes. (Ingo Karkat, 2015 Jan 16) +Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15) +Update 2015 Jul 25 (email). + Redo only remembers the last change. Could use "{count}g." to redo an older change. How does the user know which change? At least have a way to list them: ":repeats". @@ -819,9 +827,6 @@ Patch to make "z=" work when 'spell' is off. Does this have nasty side effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12) Would also need to do this for spellbadword() and spellsuggest(). -Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15) -Update 2015 Jul 25 (email). - On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a 64 bits value. Change all number options to use nropt_T and define it to the right type. diff --git a/runtime/filetype.vim b/runtime/filetype.vim index 923df6e2a6..4e3e000a8b 100644 --- a/runtime/filetype.vim +++ b/runtime/filetype.vim @@ -1,7 +1,7 @@ " Vim support file to detect file types " " Maintainer: Bram Moolenaar -" Last Change: 2015 Sep 08 +" Last Change: 2015 Sep 22 " Listen very carefully, I will say this only once if exists("did_load_filetypes") @@ -143,7 +143,7 @@ au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch au BufNewFile,BufRead *.art setf art " AsciiDoc -au BufNewFile,BufRead *.asciidoc setf asciidoc +au BufNewFile,BufRead *.asciidoc,*.adoc setf asciidoc " ASN.1 au BufNewFile,BufRead *.asn,*.asn1 setf asn @@ -826,7 +826,7 @@ au BufNewFile,BufRead *.gs setf grads au BufNewFile,BufRead *.gretl setf gretl " Groovy -au BufNewFile,BufRead *.groovy setf groovy +au BufNewFile,BufRead *.gradle,*.groovy setf groovy " GNU Server Pages au BufNewFile,BufRead *.gsp setf gsp diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim index 7eb963b7b2..8aaf82e21f 100644 --- a/runtime/indent/html.vim +++ b/runtime/indent/html.vim @@ -2,7 +2,7 @@ " Header: "{{{ " Maintainer: Bram Moolenaar " Original Author: Andy Wokula -" Last Change: 2015 Jun 12 +" Last Change: 2015 Sep 25 " Version: 1.0 " Description: HTML indent script with cached state for faster indenting on a " range of lines. @@ -178,13 +178,15 @@ let s:countonly = 0 " 3 "script" " 4 "style" " 5 comment start +" 6 conditional comment start " -1 closing tag " -2 "/pre" " -3 "/script" " -4 "/style" " -5 comment end +" -6 conditional comment end let s:indent_tags = {} -let s:endtags = [0,0,0,0,0,0] " long enough for the highest index +let s:endtags = [0,0,0,0,0,0,0] " long enough for the highest index "}}} " Add a list of tag names for a pair of to "tags". @@ -257,6 +259,7 @@ call s:AddBlockTag('pre', 2) call s:AddBlockTag('script', 3) call s:AddBlockTag('style', 4) call s:AddBlockTag('') +call s:AddBlockTag('') "}}} " Return non-zero when "tagname" is an opening tag, not being a block tag, for @@ -291,7 +294,7 @@ func! s:CountITags(text) let s:nextrel = 0 " relative indent steps for next line [unit &sw]: let s:block = 0 " assume starting outside of a block let s:countonly = 1 " don't change state - call substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|', '\=s:CheckTag(submatch(0))', 'g') + call substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|\|', '\=s:CheckTag(submatch(0))', 'g') let s:countonly = 0 endfunc "}}} @@ -303,7 +306,7 @@ func! s:CountTagsAndState(text) let s:nextrel = 0 " relative indent steps for next line [unit &sw]: let s:block = b:hi_newstate.block - let tmp = substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|', '\=s:CheckTag(submatch(0))', 'g') + let tmp = substitute(a:text, '<\zs/\=\w\+\(-\w\+\)*\>\|\|', '\=s:CheckTag(submatch(0))', 'g') if s:block == 3 let b:hi_newstate.scripttype = s:GetScriptType(matchstr(tmp, '\C.*\zs[^>]*')) endif @@ -425,7 +428,7 @@ func! s:FreshState(lnum) " State: " lnum last indented line == prevnonblank(a:lnum - 1) " block = 0 a:lnum located within special tag: 0:none, 2:
,
-  "			3: