diff --git a/7.4.308 b/7.4.308 new file mode 100644 index 0000000..f3d6a3c --- /dev/null +++ b/7.4.308 @@ -0,0 +1,47 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.308 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.308 +Problem: When using ":diffsplit" on an empty file the cursor is displayed + on the command line. +Solution: Limit the value of w_topfill. +Files: src/diff.c + + +*** ../vim-7.4.307/src/diff.c 2013-09-20 20:13:48.000000000 +0200 +--- src/diff.c 2014-05-28 11:30:11.724008432 +0200 +*************** +*** 622,627 **** +--- 622,628 ---- + wp->w_topfill = (n < 0 ? 0 : n); + else if (n > 0 && n > wp->w_topfill) + wp->w_topfill = n; ++ check_topfill(wp, FALSE); + } + } + } +*** ../vim-7.4.307/src/version.c 2014-05-22 21:22:15.361995652 +0200 +--- src/version.c 2014-05-28 11:34:01.064010440 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 308, + /**/ + +-- +msdn.microsoft.com: +ERROR_SUCCESS 0 (0x0) The operation completed successfully. +I have always suspected that for Microsoft success is an error. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.309 b/7.4.309 new file mode 100644 index 0000000..82c9e0b --- /dev/null +++ b/7.4.309 @@ -0,0 +1,88 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.309 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.309 +Problem: When increasing the size of the lower window, the upper window + jumps back to the top. (Ron Aaron) +Solution: Change setting the topline. (Nobuhiro Takasaki) +Files: src/window.c + + +*** ../vim-7.4.308/src/window.c 2014-05-22 15:17:24.706440568 +0200 +--- src/window.c 2014-05-28 13:24:40.308068558 +0200 +*************** +*** 5710,5717 **** + --wp->w_wrow; + } + } + } +! else + { + while (sline > 0 && lnum > 1) + { +--- 5710,5718 ---- + --wp->w_wrow; + } + } ++ set_topline(wp, lnum); + } +! else if (sline > 0) + { + while (sline > 0 && lnum > 1) + { +*************** +*** 5748,5761 **** + lnum++; + wp->w_wrow -= line_size + sline; + } +! else if (sline >= 0) + { + /* First line of file reached, use that as topline. */ + lnum = 1; + wp->w_wrow -= sline; + } + } +- set_topline(wp, lnum); + } + + if (wp == curwin) +--- 5749,5763 ---- + lnum++; + wp->w_wrow -= line_size + sline; + } +! else if (sline > 0) + { + /* First line of file reached, use that as topline. */ + lnum = 1; + wp->w_wrow -= sline; + } ++ ++ set_topline(wp, lnum); + } + } + + if (wp == curwin) +*** ../vim-7.4.308/src/version.c 2014-05-28 11:35:33.428011248 +0200 +--- src/version.c 2014-05-28 13:33:54.244073407 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 309, + /**/ + +-- +Don't be humble ... you're not that great. + -- Golda Meir + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.310 b/7.4.310 new file mode 100644 index 0000000..2d25f0f --- /dev/null +++ b/7.4.310 @@ -0,0 +1,373 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.310 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.310 +Problem: getpos()/setpos() don't include curswant. +Solution: Add a fifth number when getting/setting the cursor. +Files: src/eval.c, src/testdir/test_eval.in, src/testdir/test_eval.ok, + runtime/doc/eval.txt + + +*** ../vim-7.4.309/src/eval.c 2014-05-22 18:59:54.506169240 +0200 +--- src/eval.c 2014-05-28 14:23:37.608099523 +0200 +*************** +*** 764,770 **** + static void f_writefile __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_xor __ARGS((typval_T *argvars, typval_T *rettv)); + +! static int list2fpos __ARGS((typval_T *arg, pos_T *posp, int *fnump)); + static pos_T *var2fpos __ARGS((typval_T *varp, int dollar_lnum, int *fnum)); + static int get_env_len __ARGS((char_u **arg)); + static int get_id_len __ARGS((char_u **arg)); +--- 764,770 ---- + static void f_writefile __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_xor __ARGS((typval_T *argvars, typval_T *rettv)); + +! static int list2fpos __ARGS((typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp)); + static pos_T *var2fpos __ARGS((typval_T *varp, int dollar_lnum, int *fnum)); + static int get_env_len __ARGS((char_u **arg)); + static int get_id_len __ARGS((char_u **arg)); +*************** +*** 9799,9812 **** + if (argvars[1].v_type == VAR_UNKNOWN) + { + pos_T pos; + +! if (list2fpos(argvars, &pos, NULL) == FAIL) + return; + line = pos.lnum; + col = pos.col; + #ifdef FEAT_VIRTUALEDIT + coladd = pos.coladd; + #endif + } + else + { +--- 9799,9815 ---- + if (argvars[1].v_type == VAR_UNKNOWN) + { + pos_T pos; ++ colnr_T curswant = -1; + +! if (list2fpos(argvars, &pos, NULL, &curswant) == FAIL) + return; + line = pos.lnum; + col = pos.col; + #ifdef FEAT_VIRTUALEDIT + coladd = pos.coladd; + #endif ++ if (curswant >= 0) ++ curwin->w_curswant = curswant - 1; + } + else + { +*************** +*** 11770,11775 **** +--- 11773,11780 ---- + (fp != NULL) ? (varnumber_T)fp->coladd : + #endif + (varnumber_T)0); ++ if (fp == &curwin->w_cursor) ++ list_append_number(l, (varnumber_T)curwin->w_curswant + 1); + } + else + rettv->vval.v_number = FALSE; +*************** +*** 16751,16762 **** + pos_T pos; + int fnum; + char_u *name; + + rettv->vval.v_number = -1; + name = get_tv_string_chk(argvars); + if (name != NULL) + { +! if (list2fpos(&argvars[1], &pos, &fnum) == OK) + { + if (--pos.col < 0) + pos.col = 0; +--- 16756,16768 ---- + pos_T pos; + int fnum; + char_u *name; ++ colnr_T curswant = -1; + + rettv->vval.v_number = -1; + name = get_tv_string_chk(argvars); + if (name != NULL) + { +! if (list2fpos(&argvars[1], &pos, &fnum, &curswant) == OK) + { + if (--pos.col < 0) + pos.col = 0; +*************** +*** 16766,16771 **** +--- 16772,16779 ---- + if (fnum == curbuf->b_fnum) + { + curwin->w_cursor = pos; ++ if (curswant >= 0) ++ curwin->w_curswant = curswant - 1; + check_cursor(); + rettv->vval.v_number = 0; + } +*************** +*** 19532,19552 **** + * validity. + */ + static int +! list2fpos(arg, posp, fnump) + typval_T *arg; + pos_T *posp; + int *fnump; + { + list_T *l = arg->vval.v_list; + long i = 0; + long n; + +! /* List must be: [fnum, lnum, col, coladd], where "fnum" is only there +! * when "fnump" isn't NULL and "coladd" is optional. */ + if (arg->v_type != VAR_LIST + || l == NULL + || l->lv_len < (fnump == NULL ? 2 : 3) +! || l->lv_len > (fnump == NULL ? 3 : 4)) + return FAIL; + + if (fnump != NULL) +--- 19540,19561 ---- + * validity. + */ + static int +! list2fpos(arg, posp, fnump, curswantp) + typval_T *arg; + pos_T *posp; + int *fnump; ++ colnr_T *curswantp; + { + list_T *l = arg->vval.v_list; + long i = 0; + long n; + +! /* List must be: [fnum, lnum, col, coladd, curswant], where "fnum" is only +! * there when "fnump" isn't NULL; "coladd" and "curswant" are optional. */ + if (arg->v_type != VAR_LIST + || l == NULL + || l->lv_len < (fnump == NULL ? 2 : 3) +! || l->lv_len > (fnump == NULL ? 4 : 5)) + return FAIL; + + if (fnump != NULL) +*************** +*** 19570,19582 **** + posp->col = n; + + #ifdef FEAT_VIRTUALEDIT +! n = list_find_nr(l, i, NULL); + if (n < 0) + posp->coladd = 0; + else + posp->coladd = n; + #endif + + return OK; + } + +--- 19579,19594 ---- + posp->col = n; + + #ifdef FEAT_VIRTUALEDIT +! n = list_find_nr(l, i, NULL); /* off */ + if (n < 0) + posp->coladd = 0; + else + posp->coladd = n; + #endif + ++ if (curswantp != NULL) ++ *curswantp = list_find_nr(l, i + 1, NULL); /* curswant */ ++ + return OK; + } + +*** ../vim-7.4.309/src/testdir/test_eval.in 2014-04-29 17:41:18.351689927 +0200 +--- src/testdir/test_eval.in 2014-05-28 14:22:31.780098947 +0200 +*************** +*** 190,198 **** +--- 190,207 ---- + :$put =v:exception + :endtry + :" ++ :$put ='{{{1 setpos/getpos' ++ /^012345678 ++ 6l:let sp = getpos('.') ++ 0:call setpos('.', sp) ++ jyl:$put ++ :" + :/^start:/+1,$wq! test.out + :" vim: et ts=4 isk-=\: fmr=???,??? + :call getchar() + ENDTEST + ++ 012345678 ++ 012345678 ++ + start: +*** ../vim-7.4.309/src/testdir/test_eval.ok 2014-04-29 17:41:18.351689927 +0200 +--- src/testdir/test_eval.ok 2014-05-28 14:19:31.836097372 +0200 +*************** +*** 346,348 **** +--- 346,350 ---- + Bar exists: 1 + func Bar exists: 1 + Vim(call):E116: Invalid arguments for function append ++ {{{1 setpos/getpos ++ 6 +*** ../vim-7.4.309/runtime/doc/eval.txt 2014-05-07 18:35:25.661216052 +0200 +--- runtime/doc/eval.txt 2014-05-28 14:04:40.928089573 +0200 +*************** +*** 2587,2595 **** + cursor({list}) + Positions the cursor at the column (byte count) {col} in the + line {lnum}. The first column is one. + When there is one argument {list} this is used as a |List| +! with two or three items {lnum}, {col} and {off}. This is like +! the return value of |getpos()|, but without the first item. + Does not change the jumplist. + If {lnum} is greater than the number of lines in the buffer, + the cursor will be positioned at the last line in the buffer. +--- 2587,2600 ---- + cursor({list}) + Positions the cursor at the column (byte count) {col} in the + line {lnum}. The first column is one. ++ + When there is one argument {list} this is used as a |List| +! with two, three or four item: +! [{lnum}, {col}, {off}] +! [{lnum}, {col}, {off}, {curswant}] +! This is like the return value of |getpos()|, but without the +! first item. +! + Does not change the jumplist. + If {lnum} is greater than the number of lines in the buffer, + the cursor will be positioned at the last line in the buffer. +*************** +*** 4475,4482 **** + *getpos()* + getpos({expr}) Get the position for {expr}. For possible values of {expr} + see |line()|. +! The result is a |List| with four numbers: + [bufnum, lnum, col, off] + "bufnum" is zero, unless a mark like '0 or 'A is used, then it + is the buffer number of the mark. + "lnum" and "col" are the position in the buffer. The first +--- 4490,4498 ---- + *getpos()* + getpos({expr}) Get the position for {expr}. For possible values of {expr} + see |line()|. +! The result is a |List| with four or five numbers: + [bufnum, lnum, col, off] ++ [bufnum, lnum, col, off, curswant] + "bufnum" is zero, unless a mark like '0 or 'A is used, then it + is the buffer number of the mark. + "lnum" and "col" are the position in the buffer. The first +*************** +*** 4485,4490 **** +--- 4501,4511 ---- + it is the offset in screen columns from the start of the + character. E.g., a position within a or after the last + character. ++ The "curswant" number is only added for getpos('.'), it is the ++ preferred column when moving the cursor vertically. ++ Note that for '< and '> Visual mode matters: when it is "V" ++ (visual line mode) the column of '< is zero and the column of ++ '> is a large number. + This can be used to save and restore the cursor position: > + let save_cursor = getpos(".") + MoveTheCursorAround +*************** +*** 5289,5296 **** + . the cursor + 'x mark x + +! {list} must be a |List| with four numbers: + [bufnum, lnum, col, off] + + "bufnum" is the buffer number. Zero can be used for the + current buffer. Setting the cursor is only possible for +--- 5310,5318 ---- + . the cursor + 'x mark x + +! {list} must be a |List| with four or five numbers: + [bufnum, lnum, col, off] ++ [bufnum, lnum, col, off, curswant] + + "bufnum" is the buffer number. Zero can be used for the + current buffer. Setting the cursor is only possible for +*************** +*** 5308,5320 **** + character. E.g., a position within a or after the last + character. + + Returns 0 when the position could be set, -1 otherwise. + An error message is given if {expr} is invalid. + + Also see |getpos()| + + This does not restore the preferred column for moving +! vertically. See |winrestview()| for that. + + + setqflist({list} [, {action}]) *setqflist()* +--- 5330,5355 ---- + character. E.g., a position within a or after the last + character. + ++ The "curswant" number is only used when setting the cursor ++ position. It sets the preferred column for when moving the ++ cursor vertically. When the "curswant" number is missing the ++ preferred column is not set. When it is present and setting a ++ mark position it is not used. ++ ++ Note that for '< and '> changing the line number may result in ++ the marks to be effectively be swapped, so that '< is always ++ before '>. ++ + Returns 0 when the position could be set, -1 otherwise. + An error message is given if {expr} is invalid. + + Also see |getpos()| + + This does not restore the preferred column for moving +! vertically; if you set the cursor position with this, |j| and +! |k| motions will jump to previous columns! Use |cursor()| to +! also set the preferred column. Also see the "curswant" key in +! |winrestview()|. + + + setqflist({list} [, {action}]) *setqflist()* +*** ../vim-7.4.309/src/version.c 2014-05-28 13:42:59.884078184 +0200 +--- src/version.c 2014-05-28 14:27:20.132101471 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 310, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +218. Your spouse hands you a gift wrapped magnet with your PC's name + on it and you accuse him or her of genocide. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.311 b/7.4.311 new file mode 100644 index 0000000..0009788 --- /dev/null +++ b/7.4.311 @@ -0,0 +1,127 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.311 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.311 +Problem: Can't use winrestview to only restore part of the view. +Solution: Handle missing items in the dict. (Christian Brabandt) +Files: src/eval.c, runtime/doc/eval.txt + + +*** ../vim-7.4.310/src/eval.c 2014-05-28 14:32:47.156104334 +0200 +--- src/eval.c 2014-05-28 16:42:25.196172421 +0200 +*************** +*** 19231,19250 **** + EMSG(_(e_invarg)); + else + { +! curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); +! curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); + #ifdef FEAT_VIRTUALEDIT +! curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); + #endif +! curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); +! curwin->w_set_curswant = FALSE; + +! set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); + #ifdef FEAT_DIFF +! curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); + #endif +! curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); +! curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); + + check_cursor(); + win_new_height(curwin, curwin->w_height); +--- 19231,19260 ---- + EMSG(_(e_invarg)); + else + { +! if (dict_find(dict, (char_u *)"lnum", -1) != NULL) +! curwin->w_cursor.lnum = get_dict_number(dict, (char_u *)"lnum"); +! if (dict_find(dict, (char_u *)"col", -1) != NULL) +! curwin->w_cursor.col = get_dict_number(dict, (char_u *)"col"); + #ifdef FEAT_VIRTUALEDIT +! if (dict_find(dict, (char_u *)"coladd", -1) != NULL) +! curwin->w_cursor.coladd = get_dict_number(dict, (char_u *)"coladd"); + #endif +! if (dict_find(dict, (char_u *)"curswant", -1) != NULL) +! { +! curwin->w_curswant = get_dict_number(dict, (char_u *)"curswant"); +! curwin->w_set_curswant = FALSE; +! } + +! if (dict_find(dict, (char_u *)"topline", -1) != NULL) +! set_topline(curwin, get_dict_number(dict, (char_u *)"topline")); + #ifdef FEAT_DIFF +! if (dict_find(dict, (char_u *)"topfill", -1) != NULL) +! curwin->w_topfill = get_dict_number(dict, (char_u *)"topfill"); + #endif +! if (dict_find(dict, (char_u *)"leftcol", -1) != NULL) +! curwin->w_leftcol = get_dict_number(dict, (char_u *)"leftcol"); +! if (dict_find(dict, (char_u *)"skipcol", -1) != NULL) +! curwin->w_skipcol = get_dict_number(dict, (char_u *)"skipcol"); + + check_cursor(); + win_new_height(curwin, curwin->w_height); +*** ../vim-7.4.310/runtime/doc/eval.txt 2014-05-28 14:32:47.164104334 +0200 +--- runtime/doc/eval.txt 2014-05-28 16:42:25.192172421 +0200 +*************** +*** 6404,6409 **** +--- 6414,6429 ---- + winrestview({dict}) + Uses the |Dictionary| returned by |winsaveview()| to restore + the view of the current window. ++ Note: The {dict} does not have to contain all values, that are ++ returned by |winsaveview()|. If values are missing, those ++ settings won't be restored. So you can use: > ++ :call winrestview({'curswant': 4}) ++ < ++ This will only set the curswant value (the column the cursor ++ wants to move on vertical movements) of the cursor to column 5 ++ (yes, that is 5), while all other settings will remain the ++ same. This is useful, if you set the cursor position manually. ++ + If you have changed the values the result is unpredictable. + If the window size changed the result won't be the same. + +*************** +*** 6418,6424 **** + not opened when moving around. + The return value includes: + lnum cursor line number +! col cursor column + coladd cursor column offset for 'virtualedit' + curswant column for vertical movement + topline first line in the window +--- 6438,6446 ---- + not opened when moving around. + The return value includes: + lnum cursor line number +! col cursor column (Note: the first column +! zero, as opposed to what getpos() +! returns) + coladd cursor column offset for 'virtualedit' + curswant column for vertical movement + topline first line in the window +*** ../vim-7.4.310/src/version.c 2014-05-28 14:32:47.164104334 +0200 +--- src/version.c 2014-05-28 16:45:19.200173944 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 311, + /**/ + +-- +Your fault: core dumped + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.312 b/7.4.312 new file mode 100644 index 0000000..14bc1c1 --- /dev/null +++ b/7.4.312 @@ -0,0 +1,194 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.312 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.312 +Problem: Cannot figure out what argument list is being used for a window. +Solution: Add the arglistid() function. (Marcin Szamotulski) +Files: runtime/doc/eval.txt, runtime/doc/usr_41.txt, src/eval.c, + src/ex_docmd.c, src/globals.h, src/structs.h, src/main.c + + +*** ../vim-7.4.311/runtime/doc/eval.txt 2014-05-28 16:47:11.396174926 +0200 +--- runtime/doc/eval.txt 2014-05-28 18:00:06.248213223 +0200 +*************** +*** 1716,1721 **** +--- 1716,1723 ---- + append( {lnum}, {list}) Number append lines {list} below line {lnum} + argc() Number number of files in the argument list + argidx() Number current index in the argument list ++ arglistid( [{winnr}, [ {tabnr}]]) ++ Number argument list id + argv( {nr}) String {nr} entry of the argument list + argv( ) List the argument list + asin( {expr}) Float arc sine of {expr} +*************** +*** 2103,2108 **** +--- 2105,2122 ---- + argidx() The result is the current index in the argument list. 0 is + the first file. argc() - 1 is the last one. See |arglist|. + ++ *arglistid()* ++ arglistid([{winnr}, [ {tabnr} ]]) ++ Return the argument list ID. This is a number which ++ identifies the argument list being used. Zero is used for the ++ global argument list. ++ Return zero if the arguments are invalid. ++ ++ Without arguments use the current window. ++ With {winnr} only use this window in the current tab page. ++ With {winnr} and {tabnr} use the window in the specified tab ++ page. ++ + *argv()* + argv([{nr}]) The result is the {nr}th file in the argument list of the + current window. See |arglist|. "argv(0)" is the first one. +*** ../vim-7.4.311/runtime/doc/usr_41.txt 2014-03-25 18:23:27.054087691 +0100 +--- runtime/doc/usr_41.txt 2014-05-28 18:07:43.096217222 +0200 +*************** +*** 770,775 **** +--- 772,778 ---- + Buffers, windows and the argument list: + argc() number of entries in the argument list + argidx() current position in the argument list ++ arglistid() get id of the argument list + argv() get one entry from the argument list + bufexists() check if a buffer exists + buflisted() check if a buffer exists and is listed +*** ../vim-7.4.311/src/eval.c 2014-05-28 16:47:11.392174926 +0200 +--- src/eval.c 2014-05-28 18:11:10.264219035 +0200 +*************** +*** 463,468 **** +--- 463,469 ---- + static void f_append __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_argc __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_argidx __ARGS((typval_T *argvars, typval_T *rettv)); ++ static void f_arglistid __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_argv __ARGS((typval_T *argvars, typval_T *rettv)); + #ifdef FEAT_FLOAT + static void f_asin __ARGS((typval_T *argvars, typval_T *rettv)); +*************** +*** 7875,7880 **** +--- 7876,7882 ---- + {"append", 2, 2, f_append}, + {"argc", 0, 0, f_argc}, + {"argidx", 0, 0, f_argidx}, ++ {"arglistid", 0, 2, f_arglistid}, + {"argv", 0, 1, f_argv}, + #ifdef FEAT_FLOAT + {"asin", 1, 1, f_asin}, /* WJMc */ +*************** +*** 8859,8864 **** +--- 8861,8901 ---- + } + + /* ++ * "arglistid()" function ++ */ ++ static void ++ f_arglistid(argvars, rettv) ++ typval_T *argvars UNUSED; ++ typval_T *rettv; ++ { ++ win_T *wp; ++ tabpage_T *tp = NULL; ++ long n; ++ ++ rettv->vval.v_number = -1; ++ if (argvars[0].v_type != VAR_UNKNOWN) ++ { ++ if (argvars[1].v_type != VAR_UNKNOWN) ++ { ++ n = get_tv_number(&argvars[1]); ++ if (n >= 0) ++ tp = find_tabpage(n); ++ } ++ else ++ tp = curtab; ++ ++ if (tp != NULL) ++ { ++ wp = find_win_by_nr(&argvars[0], tp); ++ if (wp != NULL) ++ rettv->vval.v_number = wp->w_alist->id; ++ } ++ } ++ else ++ rettv->vval.v_number = curwin->w_alist->id; ++ } ++ ++ /* + * "argv(nr)" function + */ + static void +*** ../vim-7.4.311/src/ex_docmd.c 2014-05-07 21:14:42.913299714 +0200 +--- src/ex_docmd.c 2014-05-28 18:10:01.696218435 +0200 +*************** +*** 7211,7216 **** +--- 7211,7217 ---- + else + { + curwin->w_alist->al_refcount = 1; ++ curwin->w_alist->id = ++max_alist_id; + alist_init(curwin->w_alist); + } + } +*** ../vim-7.4.311/src/globals.h 2014-05-22 18:14:27.570224664 +0200 +--- src/globals.h 2014-05-28 17:56:53.392211534 +0200 +*************** +*** 601,606 **** +--- 601,607 ---- + * to this when the window is using the global argument list. + */ + EXTERN alist_T global_alist; /* global argument list */ ++ EXTERN int max_alist_id INIT(= 0); /* the previous argument list id */ + EXTERN int arg_had_last INIT(= FALSE); /* accessed last file in + global_alist */ + +*** ../vim-7.4.311/src/structs.h 2014-05-13 20:19:53.573808877 +0200 +--- src/structs.h 2014-05-28 17:54:18.312210177 +0200 +*************** +*** 675,680 **** +--- 675,681 ---- + { + garray_T al_ga; /* growarray with the array of file names */ + int al_refcount; /* number of windows using this arglist */ ++ int id; /* id of this arglist */ + } alist_T; + + /* +*** ../vim-7.4.311/src/main.c 2014-04-01 19:55:46.252787300 +0200 +--- src/main.c 2014-05-28 18:09:32.040218175 +0200 +*************** +*** 322,327 **** +--- 322,328 ---- + init_yank(); /* init yank buffers */ + + alist_init(&global_alist); /* Init the argument list to empty. */ ++ global_alist.id = 0; + + /* + * Set the default values for the options. +*** ../vim-7.4.311/src/version.c 2014-05-28 16:47:11.396174926 +0200 +--- src/version.c 2014-05-28 17:25:32.644195071 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 312, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +222. You send more than 20 personal e-mails a day. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.313 b/7.4.313 new file mode 100644 index 0000000..39468e0 --- /dev/null +++ b/7.4.313 @@ -0,0 +1,320 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.313 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.313 (after 7.4.310) +Problem: Changing the return value of getpos() causes an error. (Jie Zhu) +Solution: Revert getpos() and add getcurpos(). +Files: src/eval.c, src/testdir/test_eval.in, src/testdir/test_eval.ok, + runtime/doc/eval.txt + + +*** ../vim-7.4.312/src/eval.c 2014-05-28 18:22:37.876225054 +0200 +--- src/eval.c 2014-05-28 20:11:55.364282457 +0200 +*************** +*** 560,565 **** +--- 560,566 ---- + static void f_getline __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getmatches __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getpid __ARGS((typval_T *argvars, typval_T *rettv)); ++ static void f_getcurpos __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getpos __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getqflist __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getreg __ARGS((typval_T *argvars, typval_T *rettv)); +*************** +*** 7967,7972 **** +--- 7968,7974 ---- + {"getcmdline", 0, 0, f_getcmdline}, + {"getcmdpos", 0, 0, f_getcmdpos}, + {"getcmdtype", 0, 0, f_getcmdtype}, ++ {"getcurpos", 0, 0, f_getcurpos}, + {"getcwd", 0, 0, f_getcwd}, + {"getfontname", 0, 1, f_getfontname}, + {"getfperm", 1, 1, f_getfperm}, +*************** +*** 11780,11785 **** +--- 11782,11800 ---- + rettv->vval.v_number = mch_get_pid(); + } + ++ static void getpos_both __ARGS((typval_T *argvars, typval_T *rettv, int getcurpos)); ++ ++ /* ++ * "getcurpos()" function ++ */ ++ static void ++ f_getcurpos(argvars, rettv) ++ typval_T *argvars; ++ typval_T *rettv; ++ { ++ getpos_both(argvars, rettv, TRUE); ++ } ++ + /* + * "getpos(string)" function + */ +*************** +*** 11788,11793 **** +--- 11803,11817 ---- + typval_T *argvars; + typval_T *rettv; + { ++ getpos_both(argvars, rettv, FALSE); ++ } ++ ++ static void ++ getpos_both(argvars, rettv, getcurpos) ++ typval_T *argvars; ++ typval_T *rettv; ++ int getcurpos; ++ { + pos_T *fp; + list_T *l; + int fnum = -1; +*************** +*** 11795,11801 **** + if (rettv_list_alloc(rettv) == OK) + { + l = rettv->vval.v_list; +! fp = var2fpos(&argvars[0], TRUE, &fnum); + if (fnum != -1) + list_append_number(l, (varnumber_T)fnum); + else +--- 11819,11828 ---- + if (rettv_list_alloc(rettv) == OK) + { + l = rettv->vval.v_list; +! if (getcurpos) +! fp = &curwin->w_cursor; +! else +! fp = var2fpos(&argvars[0], TRUE, &fnum); + if (fnum != -1) + list_append_number(l, (varnumber_T)fnum); + else +*************** +*** 11810,11816 **** + (fp != NULL) ? (varnumber_T)fp->coladd : + #endif + (varnumber_T)0); +! if (fp == &curwin->w_cursor) + list_append_number(l, (varnumber_T)curwin->w_curswant + 1); + } + else +--- 11837,11843 ---- + (fp != NULL) ? (varnumber_T)fp->coladd : + #endif + (varnumber_T)0); +! if (getcurpos) + list_append_number(l, (varnumber_T)curwin->w_curswant + 1); + } + else +*** ../vim-7.4.312/src/testdir/test_eval.in 2014-05-28 14:32:47.160104334 +0200 +--- src/testdir/test_eval.in 2014-05-28 20:14:27.048283785 +0200 +*************** +*** 190,198 **** + :$put =v:exception + :endtry + :" +! :$put ='{{{1 setpos/getpos' + /^012345678 +! 6l:let sp = getpos('.') + 0:call setpos('.', sp) + jyl:$put + :" +--- 190,198 ---- + :$put =v:exception + :endtry + :" +! :$put ='{{{1 getcurpos/setpos' + /^012345678 +! 6l:let sp = getcurpos() + 0:call setpos('.', sp) + jyl:$put + :" +*** ../vim-7.4.312/src/testdir/test_eval.ok 2014-05-28 14:32:47.160104334 +0200 +--- src/testdir/test_eval.ok 2014-05-28 20:14:43.316283927 +0200 +*************** +*** 346,350 **** + Bar exists: 1 + func Bar exists: 1 + Vim(call):E116: Invalid arguments for function append +! {{{1 setpos/getpos + 6 +--- 346,350 ---- + Bar exists: 1 + func Bar exists: 1 + Vim(call):E116: Invalid arguments for function append +! {{{1 getcurpos/setpos + 6 +*** ../vim-7.4.312/runtime/doc/eval.txt 2014-05-28 18:22:37.872225054 +0200 +--- runtime/doc/eval.txt 2014-05-28 20:27:57.092290876 +0200 +*************** +*** 1808,1817 **** + getcmdline() String return the current command-line + getcmdpos() Number return cursor position in command-line + getcmdtype() String return the current command-line type + getcwd() String the current working directory + getfperm( {fname}) String file permissions of file {fname} + getfsize( {fname}) Number size in bytes of file {fname} +- getfontname( [{name}]) String name of font being used + getftime( {fname}) Number last modification time of file + getftype( {fname}) String description of type of file {fname} + getline( {lnum}) String line {lnum} of current buffer +--- 1808,1818 ---- + getcmdline() String return the current command-line + getcmdpos() Number return cursor position in command-line + getcmdtype() String return the current command-line type ++ getcurpos() List position of the cursor + getcwd() String the current working directory ++ getfontname( [{name}]) String name of font being used + getfperm( {fname}) String file permissions of file {fname} + getfsize( {fname}) Number size in bytes of file {fname} + getftime( {fname}) Number last modification time of file + getftype( {fname}) String description of type of file {fname} + getline( {lnum}) String line {lnum} of current buffer +*************** +*** 2606,2613 **** + with two, three or four item: + [{lnum}, {col}, {off}] + [{lnum}, {col}, {off}, {curswant}] +! This is like the return value of |getpos()|, but without the +! first item. + + Does not change the jumplist. + If {lnum} is greater than the number of lines in the buffer, +--- 2607,2614 ---- + with two, three or four item: + [{lnum}, {col}, {off}] + [{lnum}, {col}, {off}, {curswant}] +! This is like the return value of |getpos()| or |getcurpos|, +! but without the first item. + + Does not change the jumplist. + If {lnum} is greater than the number of lines in the buffer, +*************** +*** 2617,2622 **** +--- 2618,2625 ---- + the cursor will be positioned at the last character in the + line. + If {col} is zero, the cursor will stay in the current column. ++ If {curswant} is given it is used to set the preferred column ++ for vertical movment. Otherwise {col} is used. + When 'virtualedit' is used {off} specifies the offset in + screen columns from the start of the character. E.g., a + position within a or after the last character. +*************** +*** 3339,3344 **** +--- 3347,3363 ---- + Returns an empty string otherwise. + Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|. + ++ *getcurpos()* ++ getcurpos() Get the position of the cursor. This is like getpos('.'), but ++ includes an extra item in the list: ++ [bufnum, lnum, col, off, curswant] ++ The "curswant" number is the preferred column when moving the ++ cursor vertically. ++ This can be used to save and restore the cursor position: > ++ let save_cursor = getcurpos() ++ MoveTheCursorAround ++ call setpos('.', save_cursor) ++ + *getcwd()* + getcwd() The result is a String, which is the name of the current + working directory. +*************** +*** 4493,4502 **** + + *getpos()* + getpos({expr}) Get the position for {expr}. For possible values of {expr} +! see |line()|. +! The result is a |List| with four or five numbers: + [bufnum, lnum, col, off] +- [bufnum, lnum, col, off, curswant] + "bufnum" is zero, unless a mark like '0 or 'A is used, then it + is the buffer number of the mark. + "lnum" and "col" are the position in the buffer. The first +--- 4517,4526 ---- + + *getpos()* + getpos({expr}) Get the position for {expr}. For possible values of {expr} +! see |line()|. For getting the cursor position see +! |getcurpos()|. +! The result is a |List| with four numbers: + [bufnum, lnum, col, off] + "bufnum" is zero, unless a mark like '0 or 'A is used, then it + is the buffer number of the mark. + "lnum" and "col" are the position in the buffer. The first +*************** +*** 4505,4520 **** + it is the offset in screen columns from the start of the + character. E.g., a position within a or after the last + character. +- The "curswant" number is only added for getpos('.'), it is the +- preferred column when moving the cursor vertically. + Note that for '< and '> Visual mode matters: when it is "V" + (visual line mode) the column of '< is zero and the column of + '> is a large number. +! This can be used to save and restore the cursor position: > +! let save_cursor = getpos(".") +! MoveTheCursorAround +! call setpos('.', save_cursor) +! < Also see |setpos()|. + + or({expr}, {expr}) *or()* + Bitwise OR on the two arguments. The arguments are converted +--- 4529,4542 ---- + it is the offset in screen columns from the start of the + character. E.g., a position within a or after the last + character. + Note that for '< and '> Visual mode matters: when it is "V" + (visual line mode) the column of '< is zero and the column of + '> is a large number. +! This can be used to save and restore the position of a mark: > +! let save_a_mark = getpos("'a") +! ... +! call setpos(''a', save_a_mark +! < Also see |getcurpos()| and |setpos()|. + + or({expr}, {expr}) *or()* + Bitwise OR on the two arguments. The arguments are converted +*************** +*** 5347,5353 **** + Returns 0 when the position could be set, -1 otherwise. + An error message is given if {expr} is invalid. + +! Also see |getpos()| + + This does not restore the preferred column for moving + vertically; if you set the cursor position with this, |j| and +--- 5369,5375 ---- + Returns 0 when the position could be set, -1 otherwise. + An error message is given if {expr} is invalid. + +! Also see |getpos()| and |getcurpos()|. + + This does not restore the preferred column for moving + vertically; if you set the cursor position with this, |j| and +*** ../vim-7.4.312/src/version.c 2014-05-28 18:22:37.880225054 +0200 +--- src/version.c 2014-05-28 20:15:52.164284530 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 313, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +225. You sign up for free subscriptions for all the computer magazines + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.314 b/7.4.314 new file mode 100644 index 0000000..9308e38 --- /dev/null +++ b/7.4.314 @@ -0,0 +1,178 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.314 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.314 +Problem: Completion messages can get in the way of a plugin. +Solution: Add 'c' flag to 'shortmess' option. (Shougo Matsu) +Files: runtime/doc/options.txt, src/edit.c, src/option.h, src/screen.c + + +*** ../vim-7.4.313/runtime/doc/options.txt 2014-03-12 18:55:52.096906804 +0100 +--- runtime/doc/options.txt 2014-05-28 20:55:14.640305211 +0200 +*************** +*** 6252,6257 **** +--- 6254,6262 ---- + A don't give the "ATTENTION" message when an existing swap file + is found. + I don't give the intro message when starting Vim |:intro|. ++ c don't give |ins-completion-menu| messages. For example, ++ "-- XXX completion (YYY)", "match 1 of 2", "The only match", ++ "Pattern not found", "Back at original", etc. + + This gives you the opportunity to avoid that a change between buffers + requires you to hit , but still gives as useful a message as +*** ../vim-7.4.313/src/edit.c 2014-04-29 14:44:31.515875819 +0200 +--- src/edit.c 2014-05-28 21:33:57.588325545 +0200 +*************** +*** 3854,3860 **** + ins_compl_free(); + compl_started = FALSE; + compl_matches = 0; +! msg_clr_cmdline(); /* necessary for "noshowmode" */ + ctrl_x_mode = 0; + compl_enter_selects = FALSE; + if (edit_submode != NULL) +--- 3854,3861 ---- + ins_compl_free(); + compl_started = FALSE; + compl_matches = 0; +! if (!shortmess(SHM_COMPLETIONMENU)) +! msg_clr_cmdline(); /* necessary for "noshowmode" */ + ctrl_x_mode = 0; + compl_enter_selects = FALSE; + if (edit_submode != NULL) +*************** +*** 5285,5291 **** + { + ctrl_x_mode = 0; + edit_submode = NULL; +! msg_clr_cmdline(); + return FAIL; + } + +--- 5286,5293 ---- + { + ctrl_x_mode = 0; + edit_submode = NULL; +! if (!shortmess(SHM_COMPLETIONMENU)) +! msg_clr_cmdline(); + return FAIL; + } + +*************** +*** 5544,5558 **** + + /* Show a message about what (completion) mode we're in. */ + showmode(); +! if (edit_submode_extra != NULL) + { +! if (!p_smd) +! msg_attr(edit_submode_extra, +! edit_submode_highl < HLF_COUNT +! ? hl_attr(edit_submode_highl) : 0); + } +- else +- msg_clr_cmdline(); /* necessary for "noshowmode" */ + + /* Show the popup menu, unless we got interrupted. */ + if (!compl_interrupted) +--- 5546,5563 ---- + + /* Show a message about what (completion) mode we're in. */ + showmode(); +! if (!shortmess(SHM_COMPLETIONMENU)) + { +! if (edit_submode_extra != NULL) +! { +! if (!p_smd) +! msg_attr(edit_submode_extra, +! edit_submode_highl < HLF_COUNT +! ? hl_attr(edit_submode_highl) : 0); +! } +! else +! msg_clr_cmdline(); /* necessary for "noshowmode" */ + } + + /* Show the popup menu, unless we got interrupted. */ + if (!compl_interrupted) +*** ../vim-7.4.313/src/option.h 2014-03-23 15:12:29.943264337 +0100 +--- src/option.h 2014-05-28 21:34:25.244325787 +0200 +*************** +*** 212,218 **** + #define SHM_SEARCH 's' /* no search hit bottom messages */ + #define SHM_ATTENTION 'A' /* no ATTENTION messages */ + #define SHM_INTRO 'I' /* intro messages */ +! #define SHM_ALL "rmfixlnwaWtToOsAI" /* all possible flags for 'shm' */ + + /* characters for p_go: */ + #define GO_ASEL 'a' /* autoselect */ +--- 212,219 ---- + #define SHM_SEARCH 's' /* no search hit bottom messages */ + #define SHM_ATTENTION 'A' /* no ATTENTION messages */ + #define SHM_INTRO 'I' /* intro messages */ +! #define SHM_COMPLETIONMENU 'c' /* completion menu messages */ +! #define SHM_ALL "rmfixlnwaWtToOsAIc" /* all possible flags for 'shm' */ + + /* characters for p_go: */ + #define GO_ASEL 'a' /* autoselect */ +*** ../vim-7.4.313/src/screen.c 2014-05-22 16:05:16.338382204 +0200 +--- src/screen.c 2014-05-28 20:53:20.488304211 +0200 +*************** +*** 42,48 **** + * + * The part of the buffer that is displayed in a window is set with: + * - w_topline (first buffer line in window) +! * - w_topfill (filler line above the first line) + * - w_leftcol (leftmost window cell in window), + * - w_skipcol (skipped window cells of first line) + * +--- 42,48 ---- + * + * The part of the buffer that is displayed in a window is set with: + * - w_topline (first buffer line in window) +! * - w_topfill (filler lines above the first line) + * - w_leftcol (leftmost window cell in window), + * - w_skipcol (skipped window cells of first line) + * +*************** +*** 9683,9689 **** + } + #endif + #ifdef FEAT_INS_EXPAND +! if (edit_submode != NULL) /* CTRL-X in Insert mode */ + { + /* These messages can get long, avoid a wrap in a narrow + * window. Prefer showing edit_submode_extra. */ +--- 9683,9690 ---- + } + #endif + #ifdef FEAT_INS_EXPAND +! /* CTRL-X in Insert mode */ +! if (edit_submode != NULL && !shortmess(SHM_COMPLETIONMENU)) + { + /* These messages can get long, avoid a wrap in a narrow + * window. Prefer showing edit_submode_extra. */ +*** ../vim-7.4.313/src/version.c 2014-05-28 20:31:37.504292805 +0200 +--- src/version.c 2014-05-28 20:54:27.664304800 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 314, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +227. You sleep next to your monitor. Or on top of it. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.315 b/7.4.315 new file mode 100644 index 0000000..ab52ec5 --- /dev/null +++ b/7.4.315 @@ -0,0 +1,229 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.315 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.315 (after 7.4.309) +Problem: Fixes for computation of topline not tested. +Solution: Add test. (Hirohito Higashi) +Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, + src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms, src/testdir/Makefile, + src/testdir/test107.in, src/testdir/test107.ok + + +*** ../vim-7.4.314/src/testdir/Make_amiga.mak 2014-04-29 12:15:22.852032651 +0200 +--- src/testdir/Make_amiga.mak 2014-05-28 13:13:32.108062709 +0200 +*************** +*** 35,41 **** + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test97.out test98.out \ + test99.out test100.out test101.out test102.out test103.out \ +! test104.out test105.out test106.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +--- 35,41 ---- + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test97.out test98.out \ + test99.out test100.out test101.out test102.out test103.out \ +! test104.out test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +*************** +*** 161,166 **** +--- 161,167 ---- + test104.out: test104.in + test105.out: test105.in + test106.out: test106.in ++ test107.out: test107.in + test_autoformat_join.out: test_autoformat_join.in + test_eval.out: test_eval.in + test_options.out: test_options.in +*** ../vim-7.4.314/src/testdir/Make_dos.mak 2014-04-29 12:15:22.852032651 +0200 +--- src/testdir/Make_dos.mak 2014-05-28 13:13:44.344062816 +0200 +*************** +*** 34,40 **** + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test98.out test99.out \ + test100.out test101.out test102.out test103.out test104.out \ +! test105.out test106.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +--- 34,40 ---- + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test98.out test99.out \ + test100.out test101.out test102.out test103.out test104.out \ +! test105.out test106.out test107.out\ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +*** ../vim-7.4.314/src/testdir/Make_ming.mak 2014-04-29 12:15:22.852032651 +0200 +--- src/testdir/Make_ming.mak 2014-05-28 13:13:52.656062889 +0200 +*************** +*** 54,60 **** + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test98.out test99.out \ + test100.out test101.out test102.out test103.out test104.out \ +! test105.out test106.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +--- 54,60 ---- + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test98.out test99.out \ + test100.out test101.out test102.out test103.out test104.out \ +! test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +*** ../vim-7.4.314/src/testdir/Make_os2.mak 2014-04-29 12:15:22.852032651 +0200 +--- src/testdir/Make_os2.mak 2014-05-28 13:14:03.616062985 +0200 +*************** +*** 36,42 **** + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test98.out test99.out \ + test100.out test101.out test102.out test103.out test104.out \ +! test105.out test106.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +--- 36,42 ---- + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test98.out test99.out \ + test100.out test101.out test102.out test103.out test104.out \ +! test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +*** ../vim-7.4.314/src/testdir/Make_vms.mms 2014-04-29 12:15:22.852032651 +0200 +--- src/testdir/Make_vms.mms 2014-05-28 13:14:09.724063038 +0200 +*************** +*** 4,10 **** + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2014 Mar 12 + # + # 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. +--- 4,10 ---- + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2014 May 28 + # + # 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. +*************** +*** 95,101 **** + test90.out test91.out test92.out test93.out test94.out \ + test95.out test96.out test98.out test99.out \ + test100.out test101.out test103.out test104.out \ +! test105.out test106.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +--- 95,101 ---- + test90.out test91.out test92.out test93.out test94.out \ + test95.out test96.out test98.out test99.out \ + test100.out test101.out test103.out test104.out \ +! test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +*** ../vim-7.4.314/src/testdir/Makefile 2014-05-22 13:12:25.650592983 +0200 +--- src/testdir/Makefile 2014-05-28 13:14:28.688063204 +0200 +*************** +*** 32,38 **** + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test97.out test98.out \ + test99.out test100.out test101.out test102.out test103.out \ +! test104.out test105.out test106.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +--- 32,38 ---- + test89.out test90.out test91.out test92.out test93.out \ + test94.out test95.out test96.out test97.out test98.out \ + test99.out test100.out test101.out test102.out test103.out \ +! test104.out test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_eval.out \ + test_options.out +*** ../vim-7.4.314/src/testdir/test107.in 2014-05-29 11:46:48.728773486 +0200 +--- src/testdir/test107.in 2014-05-29 11:40:20.096770084 +0200 +*************** +*** 0 **** +--- 1,38 ---- ++ Tests for adjusting window and contents vim: set ft=vim : ++ ++ STARTTEST ++ :so small.vim ++ :new ++ :call setline(1, range(1,256)) ++ :let r=[] ++ :func! GetScreenStr(row) ++ : let str = "" ++ : for c in range(1,3) ++ : let str .= nr2char(screenchar(a:row, c)) ++ : endfor ++ : return str ++ :endfunc ++ : ++ :exe ":norm! \t\=1Gzt\w\+" ++ :let s3=GetScreenStr(1) ++ :wincmd p ++ :call add(r, [line("w0"), s3]) ++ : ++ :exe ":norm! \t\=50Gzt\w\+" ++ :let s3=GetScreenStr(1) ++ :wincmd p ++ :call add(r, [line("w0"), s3]) ++ : ++ :exe ":norm! \t\=59Gzt\w\+" ++ :let s3=GetScreenStr(1) ++ ::wincmd p ++ :call add(r, [line("w0"), s3]) ++ : ++ :bwipeout! ++ :$put=r ++ :call garbagecollect(1) ++ :" ++ :/^start:/,$wq! test.out ++ ENDTEST ++ ++ start: +*** ../vim-7.4.314/src/testdir/test107.ok 2014-05-29 11:46:48.736773486 +0200 +--- src/testdir/test107.ok 2014-05-29 11:40:20.096770084 +0200 +*************** +*** 0 **** +--- 1,4 ---- ++ start: ++ [1, '1 '] ++ [50, '50 '] ++ [59, '59 '] +*** ../vim-7.4.314/src/version.c 2014-05-28 21:40:47.092329130 +0200 +--- src/version.c 2014-05-29 11:41:47.640770850 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 315, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +229. You spend so much time thinking what to add on this list. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.316 b/7.4.316 new file mode 100644 index 0000000..89b3b50 --- /dev/null +++ b/7.4.316 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.316 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.316 +Problem: Warning from 64-bit compiler. +Solution: Add type cast. (Mike Williams) +Files: src/ex_getln.c + + +*** ../vim-7.4.315/src/ex_getln.c 2014-05-07 18:35:25.665216052 +0200 +--- src/ex_getln.c 2014-05-29 14:32:53.584860716 +0200 +*************** +*** 5202,5208 **** + for (i = 0; i < num_p; ++i) + { + ((char_u **)ga->ga_data)[ga->ga_len] = +! vim_strnsave(p[i], STRLEN(p[i])); + ++ga->ga_len; + } + } +--- 5202,5208 ---- + for (i = 0; i < num_p; ++i) + { + ((char_u **)ga->ga_data)[ga->ga_len] = +! vim_strnsave(p[i], (int)STRLEN(p[i])); + ++ga->ga_len; + } + } +*** ../vim-7.4.315/src/version.c 2014-05-29 11:47:19.808773758 +0200 +--- src/version.c 2014-05-29 14:33:29.476861030 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 316, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +232. You start conversations with, "Have you gotten an ISDN line?" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.317 b/7.4.317 new file mode 100644 index 0000000..34ea336 --- /dev/null +++ b/7.4.317 @@ -0,0 +1,57 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.317 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.317 +Problem: Crash when starting gvim. Issue 230. +Solution: Check for a pointer to be NULL. (Christian Brabandt) +Files: src/window.c + + +*** ../vim-7.4.316/src/window.c 2014-05-28 13:42:59.884078184 +0200 +--- src/window.c 2014-06-12 11:36:53.619441640 +0200 +*************** +*** 4721,4728 **** + win_free_lsize(wp) + win_T *wp; + { +! vim_free(wp->w_lines); +! wp->w_lines = NULL; + } + + /* +--- 4721,4732 ---- + win_free_lsize(wp) + win_T *wp; + { +! /* TODO: why would wp be NULL here? */ +! if (wp != NULL) +! { +! vim_free(wp->w_lines); +! wp->w_lines = NULL; +! } + } + + /* +*** ../vim-7.4.316/src/version.c 2014-05-29 14:36:26.156862577 +0200 +--- src/version.c 2014-06-12 11:37:37.907443315 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 317, + /**/ + +-- +press CTRL-ALT-DEL for more information + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.318 b/7.4.318 new file mode 100644 index 0000000..3f82c53 --- /dev/null +++ b/7.4.318 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.318 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.318 +Problem: Check for whether a highlight group has settings ignores fg and bg + color settings. +Solution: Also check cterm and GUI color settings. (Christian Brabandt) +Files: src/syntax.c + + +*** ../vim-7.4.317/src/syntax.c 2014-03-23 15:12:29.939264336 +0100 +--- src/syntax.c 2014-06-12 12:16:13.851530931 +0200 +*************** +*** 8043,8050 **** +--- 8043,8056 ---- + { + return ( HL_TABLE()[idx].sg_term_attr != 0 + || HL_TABLE()[idx].sg_cterm_attr != 0 ++ || HL_TABLE()[idx].sg_cterm_fg != 0 ++ || HL_TABLE()[idx].sg_cterm_bg != 0 + #ifdef FEAT_GUI + || HL_TABLE()[idx].sg_gui_attr != 0 ++ || HL_TABLE()[idx].sg_gui_fg_name != NULL ++ || HL_TABLE()[idx].sg_gui_bg_name != NULL ++ || HL_TABLE()[idx].sg_gui_sp_name != NULL ++ || HL_TABLE()[idx].sg_font_name != NUL + #endif + || (check_link && (HL_TABLE()[idx].sg_set & SG_LINK))); + } +*** ../vim-7.4.317/src/version.c 2014-06-12 11:49:42.219470717 +0200 +--- src/version.c 2014-06-12 12:17:25.607533645 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 318, + /**/ + +-- +The software said it requires Windows 95 or better, so I installed Linux. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.319 b/7.4.319 new file mode 100644 index 0000000..9b7cfaa --- /dev/null +++ b/7.4.319 @@ -0,0 +1,55 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.319 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.319 +Problem: Crash when putting zero bytes on the clipboard. +Solution: Do not support the utf8_atom target when not using an Unicode + encoding. (Naofumi Honda) +Files: src/ui.c + + +*** ../vim-7.4.318/src/ui.c 2014-03-23 15:12:29.943264337 +0100 +--- src/ui.c 2014-06-12 13:25:21.791687853 +0200 +*************** +*** 2324,2330 **** + if ( *target != XA_STRING + #ifdef FEAT_MBYTE + && *target != vimenc_atom +! && *target != utf8_atom + #endif + && *target != vim_atom + && *target != text_atom +--- 2324,2330 ---- + if ( *target != XA_STRING + #ifdef FEAT_MBYTE + && *target != vimenc_atom +! && (*target != utf8_atom || !enc_utf8) + #endif + && *target != vim_atom + && *target != text_atom +*** ../vim-7.4.318/src/version.c 2014-06-12 12:20:50.195541385 +0200 +--- src/version.c 2014-06-12 13:26:09.147689645 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 319, + /**/ + +-- +FIRST HEAD: Oh! quick! get the sword out I want to cut his head off. +THIRD HEAD: Oh, cut your own head off. +SECOND HEAD: Yes - do us all a favour. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.320 b/7.4.320 new file mode 100644 index 0000000..92830aa --- /dev/null +++ b/7.4.320 @@ -0,0 +1,143 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.320 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.320 +Problem: Possible crash when an BufLeave autocommand deletes the buffer. +Solution: Check for the window pointer being valid. Postpone freeing the + window until autocommands are done. (Yasuhiro Matsumoto) +Files: src/buffer.c, src/fileio.c, src/globals.h, src/window.c + + +*** ../vim-7.4.319/src/buffer.c 2014-05-07 16:35:05.029152844 +0200 +--- src/buffer.c 2014-06-12 13:47:17.799737639 +0200 +*************** +*** 371,377 **** + unload_buf = TRUE; + #endif + +! if (win != NULL) + { + /* Set b_last_cursor when closing the last window for the buffer. + * Remember the last cursor position and window options of the buffer. +--- 371,381 ---- + unload_buf = TRUE; + #endif + +! if (win != NULL +! #ifdef FEAT_WINDOWS +! && win_valid(win) /* in case autocommands closed the window */ +! #endif +! ) + { + /* Set b_last_cursor when closing the last window for the buffer. + * Remember the last cursor position and window options of the buffer. +*** ../vim-7.4.319/src/fileio.c 2014-05-02 15:46:10.731268318 +0200 +--- src/fileio.c 2014-06-12 13:53:33.207751842 +0200 +*************** +*** 9549,9555 **** + + /* + * When stopping to execute autocommands, restore the search patterns and +! * the redo buffer. Free buffers in the au_pending_free_buf list. + */ + if (!autocmd_busy) + { +--- 9549,9556 ---- + + /* + * When stopping to execute autocommands, restore the search patterns and +! * the redo buffer. Free any buffers in the au_pending_free_buf list and +! * free any windows in the au_pending_free_win list. + */ + if (!autocmd_busy) + { +*************** +*** 9562,9567 **** +--- 9563,9574 ---- + vim_free(au_pending_free_buf); + au_pending_free_buf = b; + } ++ while (au_pending_free_win != NULL) ++ { ++ win_T *w = au_pending_free_win->w_next; ++ vim_free(au_pending_free_win); ++ au_pending_free_win = w; ++ } + } + + /* +*** ../vim-7.4.319/src/globals.h 2014-05-28 18:22:37.876225054 +0200 +--- src/globals.h 2014-06-12 13:54:29.163753959 +0200 +*************** +*** 387,396 **** + * which one is preferred, au_new_curbuf is set to it */ + EXTERN buf_T *au_new_curbuf INIT(= NULL); + +! /* When deleting the buffer and autocmd_busy is TRUE, do not free the buffer +! * but link it in the list starting with au_pending_free_buf, using b_next. +! * Free the buffer when autocmd_busy is set to FALSE. */ + EXTERN buf_T *au_pending_free_buf INIT(= NULL); + #endif + + #ifdef FEAT_MOUSE +--- 387,398 ---- + * which one is preferred, au_new_curbuf is set to it */ + EXTERN buf_T *au_new_curbuf INIT(= NULL); + +! /* When deleting a buffer/window and autocmd_busy is TRUE, do not free the +! * buffer/window. but link it in the list starting with +! * au_pending_free_buf/ap_pending_free_win, using b_next/w_next. +! * Free the buffer/window when autocmd_busy is being set to FALSE. */ + EXTERN buf_T *au_pending_free_buf INIT(= NULL); ++ EXTERN win_T *au_pending_free_win INIT(= NULL); + #endif + + #ifdef FEAT_MOUSE +*** ../vim-7.4.319/src/window.c 2014-06-12 11:49:42.219470717 +0200 +--- src/window.c 2014-06-12 13:51:54.939748124 +0200 +*************** +*** 4597,4603 **** + if (wp != aucmd_win) + #endif + win_remove(wp, tp); +! vim_free(wp); + + #ifdef FEAT_AUTOCMD + unblock_autocmds(); +--- 4597,4609 ---- + if (wp != aucmd_win) + #endif + win_remove(wp, tp); +! if (autocmd_busy) +! { +! wp->w_next = au_pending_free_win; +! au_pending_free_win = wp; +! } +! else +! vim_free(wp); + + #ifdef FEAT_AUTOCMD + unblock_autocmds(); +*** ../vim-7.4.319/src/version.c 2014-06-12 13:28:26.771694851 +0200 +--- src/version.c 2014-06-12 13:40:23.507721966 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 320, + /**/ + +-- +Life would be so much easier if we could just look at the source code. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.321 b/7.4.321 new file mode 100644 index 0000000..eaac413 --- /dev/null +++ b/7.4.321 @@ -0,0 +1,71 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.321 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.321 +Problem: Can't build with strawberry perl 5.20 + mingw-w64-4.9.0. +Solution: Define save_strlen. (Ken Takata) +Files: src/if_perl.xs + + +*** ../vim-7.4.320/src/if_perl.xs 2014-03-12 17:08:01.508807656 +0100 +--- src/if_perl.xs 2014-06-12 16:02:25.584044368 +0200 +*************** +*** 191,196 **** +--- 191,199 ---- + # define Perl_pop_scope dll_Perl_pop_scope + # define Perl_push_scope dll_Perl_push_scope + # define Perl_save_int dll_Perl_save_int ++ # if (PERL_REVISION == 5) && (PERL_VERSION >= 20) ++ # define Perl_save_strlen dll_Perl_save_strlen ++ # endif + # define Perl_stack_grow dll_Perl_stack_grow + # define Perl_set_context dll_Perl_set_context + # if (PERL_REVISION == 5) && (PERL_VERSION >= 14) +*************** +*** 311,316 **** +--- 314,322 ---- + static void (*Perl_pop_scope)(pTHX); + static void (*Perl_push_scope)(pTHX); + static void (*Perl_save_int)(pTHX_ int*); ++ #if (PERL_REVISION == 5) && (PERL_VERSION >= 20) ++ static void (*Perl_save_strlen)(pTHX_ STRLEN* ptr); ++ #endif + static SV** (*Perl_stack_grow)(pTHX_ SV**, SV**p, int); + static SV** (*Perl_set_context)(void*); + #if (PERL_REVISION == 5) && (PERL_VERSION >= 14) +*************** +*** 440,445 **** +--- 446,454 ---- + {"Perl_pop_scope", (PERL_PROC*)&Perl_pop_scope}, + {"Perl_push_scope", (PERL_PROC*)&Perl_push_scope}, + {"Perl_save_int", (PERL_PROC*)&Perl_save_int}, ++ #if (PERL_REVISION == 5) && (PERL_VERSION >= 20) ++ {"Perl_save_strlen", (PERL_PROC*)&Perl_save_strlen}, ++ #endif + {"Perl_stack_grow", (PERL_PROC*)&Perl_stack_grow}, + {"Perl_set_context", (PERL_PROC*)&Perl_set_context}, + #if (PERL_REVISION == 5) && (PERL_VERSION >= 14) +*** ../vim-7.4.320/src/version.c 2014-06-12 14:01:27.583769788 +0200 +--- src/version.c 2014-06-12 16:02:37.156044806 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 321, + /**/ + +-- +Microsoft's definition of a boolean: TRUE, FALSE, MAYBE +"Embrace and extend"...? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.322 b/7.4.322 new file mode 100644 index 0000000..6c12b61 --- /dev/null +++ b/7.4.322 @@ -0,0 +1,92 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.322 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.322 +Problem: Using "msgfmt" is hard coded, cannot use "gmsgfmt". +Solution: Use the msgfmt command found by configure. (Danek Duvall) +Files: src/config.mk.in, src/po/Makefile + + +*** ../vim-7.4.321/src/config.mk.in 2010-11-03 22:26:24.000000000 +0100 +--- src/config.mk.in 2014-06-12 17:41:12.892268607 +0200 +*************** +*** 164,169 **** +--- 164,171 ---- + ### If the *.po files are to be translated to *.mo files. + MAKEMO = @MAKEMO@ + ++ MSGFMT = @MSGFMT@ ++ + # Make sure that "make first" will run "make all" once configure has done its + # work. This is needed when using the Makefile in the top directory. + first: all +*** ../vim-7.4.321/src/po/Makefile 2013-06-23 13:26:12.000000000 +0200 +--- src/po/Makefile 2014-06-12 17:45:19.116277922 +0200 +*************** +*** 1,5 **** +--- 1,8 ---- + # Makefile for the Vim message translations. + ++ # Include stuff found by configure. ++ include ../auto/config.mk ++ + # TODO make this configurable + # Note: ja.sjis, *.cp1250 and zh_CN.cp936 are only for MS-Windows, they are + # not installed on Unix +*************** +*** 133,139 **** + # tools 0.10.37, which use a slightly different .po file format that is not + # compatible with Solaris (and old gettext implementations) unless these are + # set. gettext 0.10.36 will not work! +! MSGFMT = OLD_PO_FILE_INPUT=yes msgfmt -v + XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes xgettext + MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes msgmerge + +--- 136,142 ---- + # tools 0.10.37, which use a slightly different .po file format that is not + # compatible with Solaris (and old gettext implementations) unless these are + # set. gettext 0.10.36 will not work! +! MSGFMTCMD = OLD_PO_FILE_INPUT=yes $(MSGFMT) -v + XGETTEXT = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes xgettext + MSGMERGE = OLD_PO_FILE_INPUT=yes OLD_PO_FILE_OUTPUT=yes msgmerge + +*************** +*** 142,148 **** + .PHONY: all install uninstall prefixcheck converted check clean checkclean distclean update-po $(LANGUAGES) $(CONVERTED) + + .po.mo: +! $(MSGFMT) -o $@ $< + + .po.ck: + $(VIM) -u NONE -e -X -S check.vim -c "if error == 0 | q | endif" -c cq $< +--- 145,151 ---- + .PHONY: all install uninstall prefixcheck converted check clean checkclean distclean update-po $(LANGUAGES) $(CONVERTED) + + .po.mo: +! $(MSGFMTCMD) -o $@ $< + + .po.ck: + $(VIM) -u NONE -e -X -S check.vim -c "if error == 0 | q | endif" -c cq $< +*** ../vim-7.4.321/src/version.c 2014-06-12 16:03:24.268046589 +0200 +--- src/version.c 2014-06-12 17:42:27.584271433 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 322, + /**/ + +-- +If I tell you "you have a beautiful body", would you hold it against me? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.323 b/7.4.323 new file mode 100644 index 0000000..3faac9c --- /dev/null +++ b/7.4.323 @@ -0,0 +1,96 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.323 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.323 +Problem: Substitute() with zero width pattern breaks multi-byte character. +Solution: Take multi-byte character size into account. (Yukihiro Nakadaira) +Files: src/eval.c src/testdir/test69.in, src/testdir/test69.ok + + +*** ../vim-7.4.322/src/eval.c 2014-05-28 20:31:37.496292805 +0200 +--- src/eval.c 2014-06-12 18:34:22.928389291 +0200 +*************** +*** 24848,24855 **** + if (zero_width == regmatch.startp[0]) + { + /* avoid getting stuck on a match with an empty string */ +! *((char_u *)ga.ga_data + ga.ga_len) = *tail++; +! ++ga.ga_len; + continue; + } + zero_width = regmatch.startp[0]; +--- 24848,24858 ---- + if (zero_width == regmatch.startp[0]) + { + /* avoid getting stuck on a match with an empty string */ +! i = MB_PTR2LEN(tail); +! mch_memmove((char_u *)ga.ga_data + ga.ga_len, tail, +! (size_t)i); +! ga.ga_len += i; +! tail += i; + continue; + } + zero_width = regmatch.startp[0]; +*** ../vim-7.4.322/src/testdir/test69.in 2014-02-22 23:49:30.268896843 +0100 +--- src/testdir/test69.in 2014-06-12 18:32:43.108385514 +0200 +*************** +*** 180,185 **** +--- 180,192 ---- + byteidxcomp + + STARTTEST ++ /^substitute ++ :let y = substitute('123', '\zs', 'a', 'g') | put =y ++ ENDTEST ++ ++ substitute ++ ++ STARTTEST + :g/^STARTTEST/.,/^ENDTEST/d + :1;/^Results/,$wq! test.out + ENDTEST +*** ../vim-7.4.322/src/testdir/test69.ok 2014-02-22 23:49:30.268896843 +0100 +--- src/testdir/test69.ok 2014-06-12 18:32:43.108385514 +0200 +*************** +*** 160,162 **** +--- 160,166 ---- + [0, 1, 3, 4, -1] + [0, 1, 2, 4, 5, -1] + ++ ++ substitute ++ a1a2a3a ++ +*** ../vim-7.4.322/src/version.c 2014-06-12 18:03:24.940319000 +0200 +--- src/version.c 2014-06-12 18:32:08.356384200 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 323, + /**/ + +-- + When danger reared its ugly head, + He bravely turned his tail and fled + Yes, Brave Sir Robin turned about + And gallantly he chickened out + Bravely taking to his feet + He beat a very brave retreat + Bravest of the brave Sir Robin + Petrified of being dead + Soiled his pants then brave Sir Robin + Turned away and fled. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.324 b/7.4.324 new file mode 100644 index 0000000..7418d06 --- /dev/null +++ b/7.4.324 @@ -0,0 +1,190 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.324 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.324 +Problem: In Ex mode, cyrillic characters are not handled. (Stas Malavin) +Solution: Support multi-byte characters in Ex mode. (Yukihiro Nakadaira) +Files: src/ex_getln.c + + +*** ../vim-7.4.323/src/ex_getln.c 2014-05-29 14:36:26.156862577 +0200 +--- src/ex_getln.c 2014-06-12 19:33:10.440522741 +0200 +*************** +*** 2188,2193 **** +--- 2188,2194 ---- + int vcol = 0; + char_u *p; + int prev_char; ++ int len; + + /* Switch cursor on now. This avoids that it happens after the "\n", which + * confuses the system function that computes tabstops. */ +*************** +*** 2264,2270 **** + { + if (line_ga.ga_len > 0) + { +! --line_ga.ga_len; + goto redraw; + } + continue; +--- 2265,2281 ---- + { + if (line_ga.ga_len > 0) + { +! #ifdef FEAT_MBYTE +! if (has_mbyte) +! { +! p = (char_u *)line_ga.ga_data; +! p[line_ga.ga_len] = NUL; +! len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1; +! line_ga.ga_len -= len; +! } +! else +! #endif +! --line_ga.ga_len; + goto redraw; + } + continue; +*************** +*** 2280,2286 **** + + if (c1 == Ctrl_T) + { +! long sw = get_sw_value(curbuf); + + p = (char_u *)line_ga.ga_data; + p[line_ga.ga_len] = NUL; +--- 2291,2297 ---- + + if (c1 == Ctrl_T) + { +! long sw = get_sw_value(curbuf); + + p = (char_u *)line_ga.ga_data; + p[line_ga.ga_len] = NUL; +*************** +*** 2300,2307 **** + /* redraw the line */ + msg_col = startcol; + vcol = 0; +! for (p = (char_u *)line_ga.ga_data; +! p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p) + { + if (*p == TAB) + { +--- 2311,2319 ---- + /* redraw the line */ + msg_col = startcol; + vcol = 0; +! p = (char_u *)line_ga.ga_data; +! p[line_ga.ga_len] = NUL; +! while (p < (char_u *)line_ga.ga_data + line_ga.ga_len) + { + if (*p == TAB) + { +*************** +*** 2309,2319 **** + { + msg_putchar(' '); + } while (++vcol % 8); + } + else + { +! msg_outtrans_len(p, 1); +! vcol += char2cells(*p); + } + } + msg_clr_eos(); +--- 2321,2334 ---- + { + msg_putchar(' '); + } while (++vcol % 8); ++ ++p; + } + else + { +! len = MB_PTR2LEN(p); +! msg_outtrans_len(p, len); +! vcol += ptr2cells(p); +! p += len; + } + } + msg_clr_eos(); +*************** +*** 2362,2368 **** + + if (IS_SPECIAL(c1)) + c1 = '?'; +! ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1; + if (c1 == '\n') + msg_putchar('\n'); + else if (c1 == TAB) +--- 2377,2392 ---- + + if (IS_SPECIAL(c1)) + c1 = '?'; +! #ifdef FEAT_MBYTE +! if (has_mbyte) +! len = (*mb_char2bytes)(c1, +! (char_u *)line_ga.ga_data + line_ga.ga_len); +! else +! #endif +! { +! len = 1; +! ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1; +! } + if (c1 == '\n') + msg_putchar('\n'); + else if (c1 == TAB) +*************** +*** 2376,2385 **** + else + { + msg_outtrans_len( +! ((char_u *)line_ga.ga_data) + line_ga.ga_len, 1); + vcol += char2cells(c1); + } +! ++line_ga.ga_len; + escaped = FALSE; + + windgoto(msg_row, msg_col); +--- 2400,2409 ---- + else + { + msg_outtrans_len( +! ((char_u *)line_ga.ga_data) + line_ga.ga_len, len); + vcol += char2cells(c1); + } +! line_ga.ga_len += len; + escaped = FALSE; + + windgoto(msg_row, msg_col); +*** ../vim-7.4.323/src/version.c 2014-06-12 18:39:16.828400409 +0200 +--- src/version.c 2014-06-12 19:37:40.296532950 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 324, + /**/ + +-- +ZOOT: I'm afraid our life must seem very dull and quiet compared to yours. + We are but eightscore young blondes, all between sixteen and + nineteen-and-a-half, cut off in this castle, with no one to protect us. + Oooh. It is a lonely life ... bathing ... dressing ... undressing ... + making exciting underwear.... + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.325 b/7.4.325 new file mode 100644 index 0000000..5482a1d --- /dev/null +++ b/7.4.325 @@ -0,0 +1,62 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.325 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.325 +Problem: When starting the gui and changing the window size the status line + may not be drawn correctly. +Solution: Catch new_win_height() being called recursively. (Christian + Brabandt) +Files: src/window.c + + +*** ../vim-7.4.324/src/window.c 2014-06-12 14:01:27.579769788 +0200 +--- src/window.c 2014-06-13 20:04:59.051863582 +0200 +*************** +*** 5660,5666 **** + if (wp->w_height > 0) + { + if (wp == curwin) +! validate_cursor(); /* w_wrow needs to be valid */ + if (wp->w_wrow != wp->w_prev_fraction_row) + set_fraction(wp); + } +--- 5660,5671 ---- + if (wp->w_height > 0) + { + if (wp == curwin) +! /* w_wrow needs to be valid. When setting 'laststatus' this may +! * call win_new_height() recursively. */ +! validate_cursor(); +! if (wp->w_height != prev_height) +! return; /* Recursive call already changed the size, bail out here +! to avoid the following to mess things up. */ + if (wp->w_wrow != wp->w_prev_fraction_row) + set_fraction(wp); + } +*** ../vim-7.4.324/src/version.c 2014-06-12 19:44:45.324549030 +0200 +--- src/version.c 2014-06-13 20:06:12.947866378 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 325, + /**/ + +-- +DINGO: And after the spanking ... the oral sex. +GALAHAD: Oh, dear! Well, I... +GIRLS: The oral sex ... The oral sex. +GALAHAD: Well, I suppose I could stay a BIT longer. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.326 b/7.4.326 new file mode 100644 index 0000000..da62b68 --- /dev/null +++ b/7.4.326 @@ -0,0 +1,51 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.326 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.326 +Problem: Can't build Tiny version. (Elimar Riesebieter) +Solution: Add #ifdef. +Files: src/window.c + + +*** ../vim-7.4.325/src/window.c 2014-06-13 20:08:41.295871990 +0200 +--- src/window.c 2014-06-14 12:51:00.010147123 +0200 +*************** +*** 4597,4608 **** +--- 4597,4610 ---- + if (wp != aucmd_win) + #endif + win_remove(wp, tp); ++ #ifdef FEAT_AUTOCMD + if (autocmd_busy) + { + wp->w_next = au_pending_free_win; + au_pending_free_win = wp; + } + else ++ #endif + vim_free(wp); + + #ifdef FEAT_AUTOCMD +*** ../vim-7.4.325/src/version.c 2014-06-13 20:08:41.295871990 +0200 +--- src/version.c 2014-06-14 12:53:05.134151857 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 326, + /**/ + +-- +You cannot propel yourself forward by patting yourself on the back. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.327 b/7.4.327 new file mode 100644 index 0000000..a797dd7 --- /dev/null +++ b/7.4.327 @@ -0,0 +1,163 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.327 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.327 +Problem: When 'verbose' is set to display the return value of a function, + may get E724 repeatedly. +Solution: Do not give an error for verbose messages. Abort conversion to + string after an error. +Files: src/eval.c + + +*** ../vim-7.4.326/src/eval.c 2014-06-12 18:39:16.828400409 +0200 +--- src/eval.c 2014-06-17 12:48:12.083946675 +0200 +*************** +*** 134,139 **** +--- 134,142 ---- + #define COPYID_INC 2 + #define COPYID_MASK (~0x1) + ++ /* Abort conversion to string after a recursion error. */ ++ static int did_echo_string_emsg = FALSE; ++ + /* + * Array to hold the hashtab with variables local to each sourced script. + * Each item holds a variable (nameless) that points to the dict_T. +*************** +*** 6686,6691 **** +--- 6689,6696 ---- + } + + line_breakcheck(); ++ if (did_echo_string_emsg) /* recursion error, bail out */ ++ break; + } + + /* Allocate result buffer with its total size, avoid re-allocation and +*************** +*** 7460,7467 **** + if (s != NULL) + ga_concat(&ga, s); + vim_free(tofree); +! if (s == NULL) + break; + } + } + if (todo > 0) +--- 7465,7474 ---- + if (s != NULL) + ga_concat(&ga, s); + vim_free(tofree); +! if (s == NULL || did_echo_string_emsg) + break; ++ line_breakcheck(); ++ + } + } + if (todo > 0) +*************** +*** 7619,7627 **** + + if (recurse >= DICT_MAXNEST) + { +! EMSG(_("E724: variable nested too deep for displaying")); + *tofree = NULL; +! return NULL; + } + ++recurse; + +--- 7626,7641 ---- + + if (recurse >= DICT_MAXNEST) + { +! if (!did_echo_string_emsg) +! { +! /* Only give this message once for a recursive call to avoid +! * flooding the user with errors. And stop iterating over lists +! * and dicts. */ +! did_echo_string_emsg = TRUE; +! EMSG(_("E724: variable nested too deep for displaying")); +! } + *tofree = NULL; +! return (char_u *)"{E724}"; + } + ++recurse; + +*************** +*** 7689,7695 **** + *tofree = NULL; + } + +! --recurse; + return r; + } + +--- 7703,7710 ---- + *tofree = NULL; + } + +! if (--recurse == 0) +! did_echo_string_emsg = FALSE; + return r; + } + +*************** +*** 23303,23309 **** +--- 23318,23327 ---- + msg_outnum((long)argvars[i].vval.v_number); + else + { ++ /* Do not want errors such as E724 here. */ ++ ++emsg_off; + s = tv2string(&argvars[i], &tofree, numbuf2, 0); ++ --emsg_off; + if (s != NULL) + { + if (vim_strsize(s) > MSG_BUF_CLEN) +*************** +*** 23395,23402 **** + + /* The value may be very long. Skip the middle part, so that we + * have some idea how it starts and ends. smsg() would always +! * truncate it at the end. */ + s = tv2string(fc->rettv, &tofree, numbuf2, 0); + if (s != NULL) + { + if (vim_strsize(s) > MSG_BUF_CLEN) +--- 23413,23422 ---- + + /* The value may be very long. Skip the middle part, so that we + * have some idea how it starts and ends. smsg() would always +! * truncate it at the end. Don't want errors such as E724 here. */ +! ++emsg_off; + s = tv2string(fc->rettv, &tofree, numbuf2, 0); ++ --emsg_off; + if (s != NULL) + { + if (vim_strsize(s) > MSG_BUF_CLEN) +*** ../vim-7.4.326/src/version.c 2014-06-14 12:53:27.394152699 +0200 +--- src/version.c 2014-06-17 12:41:45.019932032 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 327, + /**/ + +-- +TALL KNIGHT: We shall say Ni! again to you if you do not appease us. +ARTHUR: All right! What do you want? +TALL KNIGHT: We want ... a shrubbery! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.328 b/7.4.328 new file mode 100644 index 0000000..d1f8c49 --- /dev/null +++ b/7.4.328 @@ -0,0 +1,82 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.328 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.328 +Problem: Selection of inner block is inconsistent. +Solution: Skip indent not only for '}' but all parens. (Tom McDonald) +Files: src/search.c + + +*** ../vim-7.4.327/src/search.c 2014-03-23 15:12:29.935264336 +0100 +--- src/search.c 2014-06-17 12:37:49.075923106 +0200 +*************** +*** 3608,3628 **** + + /* + * Try to exclude the '(', '{', ')', '}', etc. when "include" is FALSE. +! * If the ending '}' is only preceded by indent, skip that indent. +! * But only if the resulting area is not smaller than what we started with. + */ + while (!include) + { + incl(&start_pos); + sol = (curwin->w_cursor.col == 0); + decl(&curwin->w_cursor); +! if (what == '{') +! while (inindent(1)) +! { +! sol = TRUE; +! if (decl(&curwin->w_cursor) != 0) +! break; +! } + /* + * In Visual mode, when the resulting area is not bigger than what we + * started with, extend it to the next block, and then exclude again. +--- 3608,3629 ---- + + /* + * Try to exclude the '(', '{', ')', '}', etc. when "include" is FALSE. +! * If the ending '}', ')' or ']' is only preceded by indent, skip that +! * indent. But only if the resulting area is not smaller than what we +! * started with. + */ + while (!include) + { + incl(&start_pos); + sol = (curwin->w_cursor.col == 0); + decl(&curwin->w_cursor); +! while (inindent(1)) +! { +! sol = TRUE; +! if (decl(&curwin->w_cursor) != 0) +! break; +! } +! + /* + * In Visual mode, when the resulting area is not bigger than what we + * started with, extend it to the next block, and then exclude again. +*** ../vim-7.4.327/src/version.c 2014-06-17 12:51:13.207953527 +0200 +--- src/version.c 2014-06-17 12:52:35.279956632 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 328, + /**/ + +-- +FATHER: One day, lad, all this will be yours ... +PRINCE: What - the curtains? + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.329 b/7.4.329 new file mode 100644 index 0000000..0fd9bad --- /dev/null +++ b/7.4.329 @@ -0,0 +1,55 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.329 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.329 +Problem: When moving the cursor and then switching to another window the + previous window isn't scrolled. (Yukihiro Nakadaira) +Solution: Call update_topline() before leaving the window. (Christian + Brabandt) +Files: src/window.c + + +*** ../vim-7.4.328/src/window.c 2014-06-14 12:53:27.394152699 +0200 +--- src/window.c 2014-06-17 13:44:48.812075178 +0200 +*************** +*** 4250,4255 **** +--- 4250,4260 ---- + /* sync undo before leaving the current buffer */ + if (undo_sync && curbuf != wp->w_buffer) + u_sync(FALSE); ++ ++ /* Might need to scroll the old window before switching, e.g., when the ++ * cursor was moved. */ ++ update_topline(); ++ + /* may have to copy the buffer options when 'cpo' contains 'S' */ + if (wp->w_buffer != curbuf) + buf_copy_options(wp->w_buffer, BCO_ENTER | BCO_NOHELP); +*** ../vim-7.4.328/src/version.c 2014-06-17 13:50:06.148087184 +0200 +--- src/version.c 2014-06-17 13:51:09.960089598 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 329, + /**/ + +-- +FATHER: Make sure the Prince doesn't leave this room until I come and + get him. +FIRST GUARD: Not ... to leave the room ... even if you come and get him. +FATHER: No. Until I come and get him. +SECOND GUARD: Hic. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.330 b/7.4.330 new file mode 100644 index 0000000..360d20c --- /dev/null +++ b/7.4.330 @@ -0,0 +1,1131 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.330 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.330 +Problem: Using a regexp pattern to highlight a specific position can be + slow. +Solution: Add matchaddpos() to highlight specific positions efficiently. + (Alexey Radkov) +Files: runtime/doc/eval.txt, runtime/doc/usr_41.txt, + runtime/plugin/matchparen.vim, src/eval.c, src/ex_docmd.c, + src/proto/window.pro, src/screen.c, src/structs.h, + src/testdir/test63.in, src/testdir/test63.ok, src/window.c + + +*** ../vim-7.4.329/runtime/doc/eval.txt 2014-05-28 20:31:37.500292805 +0200 +--- runtime/doc/eval.txt 2014-06-17 16:31:35.572453748 +0200 +*************** +*** 1887,1892 **** +--- 1887,1894 ---- + Number position where {pat} matches in {expr} + matchadd( {group}, {pattern}[, {priority}[, {id}]]) + Number highlight {pattern} with {group} ++ matchaddpos( {group}, {list}[, {priority}[, {id}]]) ++ Number highlight positions with {group} + matcharg( {nr}) List arguments of |:match| + matchdelete( {id}) Number delete match identified by {id} + matchend( {expr}, {pat}[, {start}[, {count}]]) +*************** +*** 4342,4347 **** +--- 4382,4422 ---- + available from |getmatches()|. All matches can be deleted in + one operation by |clearmatches()|. + ++ matchaddpos({group}, {pos}[, {priority}[, {id}]]) *matchaddpos()* ++ Same as |matchadd()|, but requires a list of positions {pos} ++ instead of a pattern. This command is faster than |matchadd()| ++ because it does not require to handle regular expressions and ++ sets buffer line boundaries to redraw screen. It is supposed ++ to be used when fast match additions and deletions are ++ required, for example to highlight matching parentheses. ++ ++ The list {pos} can contain one of these items: ++ - A number. This while line will be highlighted. The first ++ line has number 1. ++ - A list with one number, e.g., [23]. The whole line with this ++ number will be highlighted. ++ - A list with two numbers, e.g., [23, 11]. The first number is ++ the line number, the second one the column number (first ++ column is 1). The character at this position will be ++ highlighted. ++ - A list with three numbers, e.g., [23, 11, 3]. As above, but ++ the third number gives the length of the highlight in screen ++ cells. ++ ++ The maximum number of positions is 8. ++ ++ Example: > ++ :highlight MyGroup ctermbg=green guibg=green ++ :let m = matchaddpos("MyGroup", [[23, 24], 34]) ++ < Deletion of the pattern: > ++ :call matchdelete(m) ++ ++ < Matches added by |matchaddpos()| are returned by ++ |getmatches()| with an entry "pos1", "pos2", etc., with the ++ value a list like the {pos} item. ++ These matches cannot be set via |setmatches()|, however they ++ can still be deleted by |clearmatches()|. ++ + matcharg({nr}) *matcharg()* + Selects the {nr} match item, as set with a |:match|, + |:2match| or |:3match| command. +*** ../vim-7.4.329/runtime/doc/usr_41.txt 2014-05-28 18:22:37.872225054 +0200 +--- runtime/doc/usr_41.txt 2014-06-17 14:06:44.836124965 +0200 +*************** +*** 824,829 **** +--- 827,833 ---- + synconcealed() get info about concealing + diff_hlID() get highlight ID for diff mode at a position + matchadd() define a pattern to highlight (a "match") ++ matchaddpos() define a list of positions to highlight + matcharg() get info about |:match| arguments + matchdelete() delete a match defined by |matchadd()| or a + |:match| command +*** ../vim-7.4.329/runtime/plugin/matchparen.vim 2013-05-08 05:15:53.000000000 +0200 +--- runtime/plugin/matchparen.vim 2014-06-17 14:14:45.712143158 +0200 +*************** +*** 1,6 **** + " Vim plugin for showing matching parens + " Maintainer: Bram Moolenaar +! " Last Change: 2013 May 08 + + " Exit quickly when: + " - this plugin was already loaded (or disabled) +--- 1,6 ---- + " Vim plugin for showing matching parens + " Maintainer: Bram Moolenaar +! " Last Change: 2014 Jun 17 + + " Exit quickly when: + " - this plugin was already loaded (or disabled) +*************** +*** 39,45 **** + function! s:Highlight_Matching_Pair() + " Remove any previous match. + if exists('w:paren_hl_on') && w:paren_hl_on +! 3match none + let w:paren_hl_on = 0 + endif + +--- 39,45 ---- + function! s:Highlight_Matching_Pair() + " Remove any previous match. + if exists('w:paren_hl_on') && w:paren_hl_on +! silent! call matchdelete(3) + let w:paren_hl_on = 0 + endif + +*************** +*** 152,165 **** + + " If a match is found setup match highlighting. + if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom +! exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . +! \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' + let w:paren_hl_on = 1 + endif + endfunction + + " Define commands that will disable and enable the plugin. +! command! NoMatchParen windo 3match none | unlet! g:loaded_matchparen | + \ au! matchparen + command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved + +--- 152,169 ---- + + " If a match is found setup match highlighting. + if m_lnum > 0 && m_lnum >= stoplinetop && m_lnum <= stoplinebottom +! if exists('*matchaddpos') +! call matchaddpos('MatchParen', [[c_lnum, c_col - before], [m_lnum, m_col]], 10, 3) +! else +! exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . +! \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' +! endif + let w:paren_hl_on = 1 + endif + endfunction + + " Define commands that will disable and enable the plugin. +! command! NoMatchParen windo silent! call matchdelete(3) | unlet! g:loaded_matchparen | + \ au! matchparen + command! DoMatchParen runtime plugin/matchparen.vim | windo doau CursorMoved + +*** ../vim-7.4.329/src/eval.c 2014-06-17 12:51:13.207953527 +0200 +--- src/eval.c 2014-06-17 17:02:25.388523729 +0200 +*************** +*** 622,627 **** +--- 622,628 ---- + static void f_mapcheck __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_match __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_matchadd __ARGS((typval_T *argvars, typval_T *rettv)); ++ static void f_matchaddpos __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_matcharg __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_matchdelete __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_matchend __ARGS((typval_T *argvars, typval_T *rettv)); +*************** +*** 8054,8059 **** +--- 8055,8061 ---- + {"mapcheck", 1, 3, f_mapcheck}, + {"match", 2, 4, f_match}, + {"matchadd", 2, 4, f_matchadd}, ++ {"matchaddpos", 2, 4, f_matchaddpos}, + {"matcharg", 1, 1, f_matcharg}, + {"matchdelete", 1, 1, f_matchdelete}, + {"matchend", 2, 4, f_matchend}, +*************** +*** 11767,11772 **** +--- 11769,11775 ---- + #ifdef FEAT_SEARCH_EXTRA + dict_T *dict; + matchitem_T *cur = curwin->w_match_head; ++ int i; + + if (rettv_list_alloc(rettv) == OK) + { +*************** +*** 11775,11782 **** + dict = dict_alloc(); + if (dict == NULL) + return; + dict_add_nr_str(dict, "group", 0L, syn_id2name(cur->hlg_id)); +- dict_add_nr_str(dict, "pattern", 0L, cur->pattern); + dict_add_nr_str(dict, "priority", (long)cur->priority, NULL); + dict_add_nr_str(dict, "id", (long)cur->id, NULL); + list_append_dict(rettv->vval.v_list, dict); +--- 11778,11813 ---- + dict = dict_alloc(); + if (dict == NULL) + return; ++ if (cur->match.regprog == NULL) ++ { ++ /* match added with matchaddpos() */ ++ for (i = 0; i < MAXPOSMATCH; ++i) ++ { ++ llpos_T *llpos; ++ char buf[6]; ++ list_T *l; ++ ++ llpos = &cur->pos.pos[i]; ++ if (llpos->lnum == 0) ++ break; ++ l = list_alloc(); ++ if (l == NULL) ++ break; ++ list_append_number(l, (varnumber_T)llpos->lnum); ++ if (llpos->col > 0) ++ { ++ list_append_number(l, (varnumber_T)llpos->col); ++ list_append_number(l, (varnumber_T)llpos->len); ++ } ++ sprintf(buf, "pos%d", i + 1); ++ dict_add_list(dict, buf, l); ++ } ++ } ++ else ++ { ++ dict_add_nr_str(dict, "pattern", 0L, cur->pattern); ++ } + dict_add_nr_str(dict, "group", 0L, syn_id2name(cur->hlg_id)); + dict_add_nr_str(dict, "priority", (long)cur->priority, NULL); + dict_add_nr_str(dict, "id", (long)cur->id, NULL); + list_append_dict(rettv->vval.v_list, dict); +*************** +*** 14313,14319 **** + return; + } + +! rettv->vval.v_number = match_add(curwin, grp, pat, prio, id); + #endif + } + +--- 14344,14401 ---- + return; + } + +! rettv->vval.v_number = match_add(curwin, grp, pat, prio, id, NULL); +! #endif +! } +! +! /* +! * "matchaddpos()" function +! */ +! static void +! f_matchaddpos(argvars, rettv) +! typval_T *argvars UNUSED; +! typval_T *rettv UNUSED; +! { +! #ifdef FEAT_SEARCH_EXTRA +! char_u buf[NUMBUFLEN]; +! char_u *group; +! int prio = 10; +! int id = -1; +! int error = FALSE; +! list_T *l; +! +! rettv->vval.v_number = -1; +! +! group = get_tv_string_buf_chk(&argvars[0], buf); +! if (group == NULL) +! return; +! +! if (argvars[1].v_type != VAR_LIST) +! { +! EMSG2(_(e_listarg), "matchaddpos()"); +! return; +! } +! l = argvars[1].vval.v_list; +! if (l == NULL) +! return; +! +! if (argvars[2].v_type != VAR_UNKNOWN) +! { +! prio = get_tv_number_chk(&argvars[2], &error); +! if (argvars[3].v_type != VAR_UNKNOWN) +! id = get_tv_number_chk(&argvars[3], &error); +! } +! if (error == TRUE) +! return; +! +! /* id == 3 is ok because matchaddpos() is supposed to substitute :3match */ +! if (id == 1 || id == 2) +! { +! EMSGN("E798: ID is reserved for \":match\": %ld", id); +! return; +! } +! +! rettv->vval.v_number = match_add(curwin, group, NULL, prio, id, l); + #endif + } + +*************** +*** 16816,16822 **** + match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE), + get_dict_string(d, (char_u *)"pattern", FALSE), + (int)get_dict_number(d, (char_u *)"priority"), +! (int)get_dict_number(d, (char_u *)"id")); + li = li->li_next; + } + rettv->vval.v_number = 0; +--- 16898,16904 ---- + match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE), + get_dict_string(d, (char_u *)"pattern", FALSE), + (int)get_dict_number(d, (char_u *)"priority"), +! (int)get_dict_number(d, (char_u *)"id"), NULL); + li = li->li_next; + } + rettv->vval.v_number = 0; +*** ../vim-7.4.329/src/ex_docmd.c 2014-05-28 18:22:37.876225054 +0200 +--- src/ex_docmd.c 2014-06-17 14:06:44.844124966 +0200 +*************** +*** 11489,11495 **** + + c = *end; + *end = NUL; +! match_add(curwin, g, p + 1, 10, id); + vim_free(g); + *end = c; + } +--- 11489,11495 ---- + + c = *end; + *end = NUL; +! match_add(curwin, g, p + 1, 10, id, NULL); + vim_free(g); + *end = c; + } +*** ../vim-7.4.329/src/proto/window.pro 2013-08-14 17:11:14.000000000 +0200 +--- src/proto/window.pro 2014-06-17 14:06:44.844124966 +0200 +*************** +*** 75,81 **** + void switch_buffer __ARGS((buf_T **save_curbuf, buf_T *buf)); + void restore_buffer __ARGS((buf_T *save_curbuf)); + int win_hasvertsplit __ARGS((void)); +! int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id)); + int match_delete __ARGS((win_T *wp, int id, int perr)); + void clear_matches __ARGS((win_T *wp)); + matchitem_T *get_match __ARGS((win_T *wp, int id)); +--- 75,81 ---- + void switch_buffer __ARGS((buf_T **save_curbuf, buf_T *buf)); + void restore_buffer __ARGS((buf_T *save_curbuf)); + int win_hasvertsplit __ARGS((void)); +! int match_add __ARGS((win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos)); + int match_delete __ARGS((win_T *wp, int id, int perr)); + void clear_matches __ARGS((win_T *wp)); + matchitem_T *get_match __ARGS((win_T *wp, int id)); +*** ../vim-7.4.329/src/screen.c 2014-05-28 21:40:47.092329130 +0200 +--- src/screen.c 2014-06-17 17:04:08.064527614 +0200 +*************** +*** 144,150 **** + static void end_search_hl __ARGS((void)); + static void init_search_hl __ARGS((win_T *wp)); + static void prepare_search_hl __ARGS((win_T *wp, linenr_T lnum)); +! static void next_search_hl __ARGS((win_T *win, match_T *shl, linenr_T lnum, colnr_T mincol)); + #endif + static void screen_start_highlight __ARGS((int attr)); + static void screen_char __ARGS((unsigned off, int row, int col)); +--- 144,151 ---- + static void end_search_hl __ARGS((void)); + static void init_search_hl __ARGS((win_T *wp)); + static void prepare_search_hl __ARGS((win_T *wp, linenr_T lnum)); +! static void next_search_hl __ARGS((win_T *win, match_T *shl, linenr_T lnum, colnr_T mincol, matchitem_T *cur)); +! static int next_search_hl_pos __ARGS((match_T *shl, linenr_T lnum, posmatch_T *pos, colnr_T mincol)); + #endif + static void screen_start_highlight __ARGS((int attr)); + static void screen_char __ARGS((unsigned off, int row, int col)); +*************** +*** 2929,2934 **** +--- 2930,2937 ---- + match_T *shl; /* points to search_hl or a match */ + int shl_flag; /* flag to indicate whether search_hl + has been processed or not */ ++ int pos_inprogress; /* marks that position match search is ++ in progress */ + int prevcol_hl_flag; /* flag to indicate whether prevcol + equals startcol of search_hl or one + of the matches */ +*************** +*** 3439,3482 **** + shl->startcol = MAXCOL; + shl->endcol = MAXCOL; + shl->attr_cur = 0; +! if (shl->rm.regprog != NULL) +! { +! v = (long)(ptr - line); +! next_search_hl(wp, shl, lnum, (colnr_T)v); +! +! /* Need to get the line again, a multi-line regexp may have made it +! * invalid. */ +! line = ml_get_buf(wp->w_buffer, lnum, FALSE); +! ptr = line + v; + +! if (shl->lnum != 0 && shl->lnum <= lnum) + { +- if (shl->lnum == lnum) +- shl->startcol = shl->rm.startpos[0].col; +- else +- shl->startcol = 0; +- if (lnum == shl->lnum + shl->rm.endpos[0].lnum +- - shl->rm.startpos[0].lnum) +- shl->endcol = shl->rm.endpos[0].col; +- else +- shl->endcol = MAXCOL; +- /* Highlight one character for an empty match. */ +- if (shl->startcol == shl->endcol) +- { + #ifdef FEAT_MBYTE +! if (has_mbyte && line[shl->endcol] != NUL) +! shl->endcol += (*mb_ptr2len)(line + shl->endcol); +! else + #endif +! ++shl->endcol; +! } +! if ((long)shl->startcol < v) /* match at leftcol */ +! { +! shl->attr_cur = shl->attr; +! search_attr = shl->attr; +! } +! area_highlighting = TRUE; + } + } + if (shl != &search_hl && cur != NULL) + cur = cur->next; +--- 3442,3484 ---- + shl->startcol = MAXCOL; + shl->endcol = MAXCOL; + shl->attr_cur = 0; +! v = (long)(ptr - line); +! if (cur != NULL) +! cur->pos.cur = 0; +! next_search_hl(wp, shl, lnum, (colnr_T)v, cur); +! +! /* Need to get the line again, a multi-line regexp may have made it +! * invalid. */ +! line = ml_get_buf(wp->w_buffer, lnum, FALSE); +! ptr = line + v; + +! if (shl->lnum != 0 && shl->lnum <= lnum) +! { +! if (shl->lnum == lnum) +! shl->startcol = shl->rm.startpos[0].col; +! else +! shl->startcol = 0; +! if (lnum == shl->lnum + shl->rm.endpos[0].lnum +! - shl->rm.startpos[0].lnum) +! shl->endcol = shl->rm.endpos[0].col; +! else +! shl->endcol = MAXCOL; +! /* Highlight one character for an empty match. */ +! if (shl->startcol == shl->endcol) + { + #ifdef FEAT_MBYTE +! if (has_mbyte && line[shl->endcol] != NUL) +! shl->endcol += (*mb_ptr2len)(line + shl->endcol); +! else + #endif +! ++shl->endcol; + } ++ if ((long)shl->startcol < v) /* match at leftcol */ ++ { ++ shl->attr_cur = shl->attr; ++ search_attr = shl->attr; ++ } ++ area_highlighting = TRUE; + } + if (shl != &search_hl && cur != NULL) + cur = cur->next; +*************** +*** 3488,3494 **** + * when Visual mode is active, because it's not clear what is selected + * then. */ + if (wp->w_p_cul && lnum == wp->w_cursor.lnum +! && !(wp == curwin && VIsual_active)) + { + line_attr = hl_attr(HLF_CUL); + area_highlighting = TRUE; +--- 3490,3496 ---- + * when Visual mode is active, because it's not clear what is selected + * then. */ + if (wp->w_p_cul && lnum == wp->w_cursor.lnum +! && !(wp == curwin && VIsual_active)) + { + line_attr = hl_attr(HLF_CUL); + area_highlighting = TRUE; +*************** +*** 3792,3798 **** + } + else + shl = &cur->hl; +! while (shl->rm.regprog != NULL) + { + if (shl->startcol != MAXCOL + && v >= (long)shl->startcol +--- 3794,3804 ---- + } + else + shl = &cur->hl; +! if (cur != NULL) +! cur->pos.cur = 0; +! pos_inprogress = TRUE; +! while (shl->rm.regprog != NULL +! || (cur != NULL && pos_inprogress)) + { + if (shl->startcol != MAXCOL + && v >= (long)shl->startcol +*************** +*** 3803,3810 **** + else if (v == (long)shl->endcol) + { + shl->attr_cur = 0; +! +! next_search_hl(wp, shl, lnum, (colnr_T)v); + + /* Need to get the line again, a multi-line regexp + * may have made it invalid. */ +--- 3809,3817 ---- + else if (v == (long)shl->endcol) + { + shl->attr_cur = 0; +! next_search_hl(wp, shl, lnum, (colnr_T)v, cur); +! pos_inprogress = cur == NULL || cur->pos.cur == 0 +! ? FALSE : TRUE; + + /* Need to get the line again, a multi-line regexp + * may have made it invalid. */ +*************** +*** 7277,7282 **** +--- 7284,7291 ---- + match_T *shl; /* points to search_hl or a match */ + int shl_flag; /* flag to indicate whether search_hl + has been processed or not */ ++ int pos_inprogress; /* marks that position match search is ++ in progress */ + int n; + + /* +*************** +*** 7311,7320 **** + shl->first_lnum = wp->w_topline; + # endif + } + n = 0; +! while (shl->first_lnum < lnum && shl->rm.regprog != NULL) + { +! next_search_hl(wp, shl, shl->first_lnum, (colnr_T)n); + if (shl->lnum != 0) + { + shl->first_lnum = shl->lnum +--- 7320,7335 ---- + shl->first_lnum = wp->w_topline; + # endif + } ++ if (cur != NULL) ++ cur->pos.cur = 0; ++ pos_inprogress = TRUE; + n = 0; +! while (shl->first_lnum < lnum && (shl->rm.regprog != NULL +! || (cur != NULL && pos_inprogress))) + { +! next_search_hl(wp, shl, shl->first_lnum, (colnr_T)n, cur); +! pos_inprogress = cur == NULL || cur->pos.cur == 0 +! ? FALSE : TRUE; + if (shl->lnum != 0) + { + shl->first_lnum = shl->lnum +*************** +*** 7343,7353 **** + * Careful: Any pointers for buffer lines will become invalid. + */ + static void +! next_search_hl(win, shl, lnum, mincol) +! win_T *win; +! match_T *shl; /* points to search_hl or a match */ +! linenr_T lnum; +! colnr_T mincol; /* minimal column for a match */ + { + linenr_T l; + colnr_T matchcol; +--- 7358,7369 ---- + * Careful: Any pointers for buffer lines will become invalid. + */ + static void +! next_search_hl(win, shl, lnum, mincol, cur) +! win_T *win; +! match_T *shl; /* points to search_hl or a match */ +! linenr_T lnum; +! colnr_T mincol; /* minimal column for a match */ +! matchitem_T *cur; /* to retrieve match postions if any */ + { + linenr_T l; + colnr_T matchcol; +*************** +*** 7415,7440 **** + matchcol = shl->rm.endpos[0].col; + + shl->lnum = lnum; +! nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum, matchcol, + #ifdef FEAT_RELTIME +! &(shl->tm) + #else +! NULL + #endif +! ); +! if (called_emsg || got_int) +! { +! /* Error while handling regexp: stop using this regexp. */ +! if (shl == &search_hl) + { +! /* don't free regprog in the match list, it's a copy */ +! vim_regfree(shl->rm.regprog); +! SET_NO_HLSEARCH(TRUE); + } +! shl->rm.regprog = NULL; +! shl->lnum = 0; +! got_int = FALSE; /* avoid the "Type :quit to exit Vim" message */ +! break; + } + if (nmatched == 0) + { +--- 7431,7465 ---- + matchcol = shl->rm.endpos[0].col; + + shl->lnum = lnum; +! if (shl->rm.regprog != NULL) +! { +! nmatched = vim_regexec_multi(&shl->rm, win, shl->buf, lnum, +! matchcol, + #ifdef FEAT_RELTIME +! &(shl->tm) + #else +! NULL + #endif +! ); +! if (called_emsg || got_int) + { +! /* Error while handling regexp: stop using this regexp. */ +! if (shl == &search_hl) +! { +! /* don't free regprog in the match list, it's a copy */ +! vim_regfree(shl->rm.regprog); +! SET_NO_HLSEARCH(TRUE); +! } +! shl->rm.regprog = NULL; +! shl->lnum = 0; +! got_int = FALSE; /* avoid the "Type :quit to exit Vim" +! message */ +! break; + } +! } +! else if (cur != NULL) +! { +! nmatched = next_search_hl_pos(shl, lnum, &(cur->pos), matchcol); + } + if (nmatched == 0) + { +*************** +*** 7453,7458 **** +--- 7478,7539 ---- + } + #endif + ++ static int ++ next_search_hl_pos(shl, lnum, posmatch, mincol) ++ match_T *shl; /* points to a match */ ++ linenr_T lnum; ++ posmatch_T *posmatch; /* match positions */ ++ colnr_T mincol; /* minimal column for a match */ ++ { ++ int i; ++ int bot = -1; ++ ++ shl->lnum = 0; ++ for (i = posmatch->cur; i < MAXPOSMATCH; i++) ++ { ++ if (posmatch->pos[i].lnum == 0) ++ break; ++ if (posmatch->pos[i].col < mincol) ++ continue; ++ if (posmatch->pos[i].lnum == lnum) ++ { ++ if (shl->lnum == lnum) ++ { ++ /* partially sort positions by column numbers ++ * on the same line */ ++ if (posmatch->pos[i].col < posmatch->pos[bot].col) ++ { ++ llpos_T tmp = posmatch->pos[i]; ++ ++ posmatch->pos[i] = posmatch->pos[bot]; ++ posmatch->pos[bot] = tmp; ++ } ++ } ++ else ++ { ++ bot = i; ++ shl->lnum = lnum; ++ } ++ } ++ } ++ posmatch->cur = 0; ++ if (shl->lnum == lnum) ++ { ++ colnr_T start = posmatch->pos[bot].col == 0 ++ ? 0 : posmatch->pos[bot].col - 1; ++ colnr_T end = posmatch->pos[bot].col == 0 ++ ? MAXCOL : start + posmatch->pos[bot].len; ++ ++ shl->rm.startpos[0].lnum = 0; ++ shl->rm.startpos[0].col = start; ++ shl->rm.endpos[0].lnum = 0; ++ shl->rm.endpos[0].col = end; ++ posmatch->cur = bot + 1; ++ return TRUE; ++ } ++ return FALSE; ++ } ++ + static void + screen_start_highlight(attr) + int attr; +*** ../vim-7.4.329/src/structs.h 2014-05-28 18:22:37.876225054 +0200 +--- src/structs.h 2014-06-17 17:00:55.524520330 +0200 +*************** +*** 1927,1932 **** +--- 1927,1958 ---- + #endif + } match_T; + ++ /* number of positions supported by matchaddpos() */ ++ #define MAXPOSMATCH 8 ++ ++ /* ++ * Same as lpos_T, but with additional field len. ++ */ ++ typedef struct ++ { ++ linenr_T lnum; /* line number */ ++ colnr_T col; /* column number */ ++ int len; /* length: 0 - to the end of line */ ++ } llpos_T; ++ ++ /* ++ * posmatch_T provides an array for storing match items for matchaddpos() ++ * function. ++ */ ++ typedef struct posmatch posmatch_T; ++ struct posmatch ++ { ++ llpos_T pos[MAXPOSMATCH]; /* array of positions */ ++ int cur; /* internal position counter */ ++ linenr_T toplnum; /* top buffer line */ ++ linenr_T botlnum; /* bottom buffer line */ ++ }; ++ + /* + * matchitem_T provides a linked list for storing match items for ":match" and + * the match functions. +*************** +*** 1940,1945 **** +--- 1966,1972 ---- + char_u *pattern; /* pattern to highlight */ + int hlg_id; /* highlight group ID */ + regmmatch_T match; /* regexp program for pattern */ ++ posmatch_T pos; /* position matches */ + match_T hl; /* struct for doing the actual highlighting */ + }; + +*** ../vim-7.4.329/src/testdir/test63.in 2010-05-15 13:04:10.000000000 +0200 +--- src/testdir/test63.in 2014-06-17 16:29:36.056449227 +0200 +*************** +*** 1,5 **** + Test for ":match", ":2match", ":3match", "clearmatches()", "getmatches()", +! "matchadd()", "matcharg()", "matchdelete()", and "setmatches()". + + STARTTEST + :so small.vim +--- 1,5 ---- + Test for ":match", ":2match", ":3match", "clearmatches()", "getmatches()", +! "matchadd()", "matchaddpos", "matcharg()", "matchdelete()", and "setmatches()". + + STARTTEST + :so small.vim +*************** +*** 147,155 **** + :unlet rf1 + :unlet rf2 + :unlet rf3 +! :highlight clear MyGroup1 +! :highlight clear MyGroup2 +! :highlight clear MyGroup3 + G"rp + :/^Results/,$wq! test.out + ENDTEST +--- 147,172 ---- + :unlet rf1 + :unlet rf2 + :unlet rf3 +! :" --- Check that "matchaddpos()" positions matches correctly +! :let @r .= "*** Test 11:\n" +! :set nolazyredraw +! :call setline(1, 'abcdefghijklmnopq') +! :call matchaddpos("MyGroup1", [[1, 5], [1, 8, 3]], 10, 3) +! :1 +! :redraw! +! :let v1 = screenattr(1, 1) +! :let v5 = screenattr(1, 5) +! :let v6 = screenattr(1, 6) +! :let v8 = screenattr(1, 8) +! :let v10 = screenattr(1, 10) +! :let v11 = screenattr(1, 11) +! :let @r .= string(getmatches())."\n" +! :if v1 != v5 && v6 == v1 && v8 == v5 && v10 == v5 && v11 == v1 +! : let @r .= "OK\n" +! :else +! : let @r .= "FAILED\n" +! :endif +! :call clearmatches() + G"rp + :/^Results/,$wq! test.out + ENDTEST +*** ../vim-7.4.329/src/testdir/test63.ok 2010-05-15 13:04:10.000000000 +0200 +--- src/testdir/test63.ok 2014-06-17 17:32:57.036593023 +0200 +*************** +*** 9,11 **** +--- 9,14 ---- + *** Test 8: OK + *** Test 9: OK + *** Test 10: OK ++ *** Test 11: ++ [{'group': 'MyGroup1', 'id': 3, 'priority': 10, 'pos1': [1, 5, 1], 'pos2': [1, 8, 3]}] ++ OK +*** ../vim-7.4.329/src/window.c 2014-06-17 13:52:35.868092848 +0200 +--- src/window.c 2014-06-17 17:04:51.060529240 +0200 +*************** +*** 6751,6770 **** + * Return ID of added match, -1 on failure. + */ + int +! match_add(wp, grp, pat, prio, id) + win_T *wp; + char_u *grp; + char_u *pat; + int prio; + int id; + { +! matchitem_T *cur; +! matchitem_T *prev; +! matchitem_T *m; + int hlg_id; +! regprog_T *regprog; + +! if (*grp == NUL || *pat == NUL) + return -1; + if (id < -1 || id == 0) + { +--- 6751,6772 ---- + * Return ID of added match, -1 on failure. + */ + int +! match_add(wp, grp, pat, prio, id, pos_list) + win_T *wp; + char_u *grp; + char_u *pat; + int prio; + int id; ++ list_T *pos_list; + { +! matchitem_T *cur; +! matchitem_T *prev; +! matchitem_T *m; + int hlg_id; +! regprog_T *regprog = NULL; +! int rtype = SOME_VALID; + +! if (*grp == NUL || (pat != NULL && *pat == NUL)) + return -1; + if (id < -1 || id == 0) + { +*************** +*** 6789,6795 **** + EMSG2(_(e_nogroup), grp); + return -1; + } +! if ((regprog = vim_regcomp(pat, RE_MAGIC)) == NULL) + { + EMSG2(_(e_invarg2), pat); + return -1; +--- 6791,6797 ---- + EMSG2(_(e_nogroup), grp); + return -1; + } +! if (pat != NULL && (regprog = vim_regcomp(pat, RE_MAGIC)) == NULL) + { + EMSG2(_(e_invarg2), pat); + return -1; +*************** +*** 6810,6821 **** + m = (matchitem_T *)alloc(sizeof(matchitem_T)); + m->id = id; + m->priority = prio; +! m->pattern = vim_strsave(pat); + m->hlg_id = hlg_id; + m->match.regprog = regprog; + m->match.rmm_ic = FALSE; + m->match.rmm_maxcol = 0; + + /* Insert new match. The match list is in ascending order with regard to + * the match priorities. */ + cur = wp->w_match_head; +--- 6812,6922 ---- + m = (matchitem_T *)alloc(sizeof(matchitem_T)); + m->id = id; + m->priority = prio; +! m->pattern = pat == NULL ? NULL : vim_strsave(pat); +! m->pos.cur = 0; + m->hlg_id = hlg_id; + m->match.regprog = regprog; + m->match.rmm_ic = FALSE; + m->match.rmm_maxcol = 0; + ++ /* Set up position matches */ ++ if (pos_list != NULL) ++ { ++ linenr_T toplnum = 0; ++ linenr_T botlnum = 0; ++ listitem_T *li; ++ int i; ++ ++ for (i = 0, li = pos_list->lv_first; i < MAXPOSMATCH; ++ i++, li = li->li_next) ++ { ++ linenr_T lnum = 0; ++ colnr_T col = 0; ++ int len = 1; ++ list_T *subl; ++ listitem_T *subli; ++ int error; ++ ++ if (li == NULL) ++ { ++ m->pos.pos[i].lnum = 0; ++ break; ++ } ++ if (li->li_tv.v_type == VAR_LIST) ++ { ++ subl = li->li_tv.vval.v_list; ++ if (subl == NULL) ++ goto fail; ++ subli = subl->lv_first; ++ if (subli == NULL) ++ goto fail; ++ lnum = get_tv_number_chk(&subli->li_tv, &error); ++ if (error == TRUE) ++ goto fail; ++ m->pos.pos[i].lnum = lnum; ++ if (lnum == 0) ++ { ++ --i; ++ continue; ++ } ++ subli = subli->li_next; ++ if (subli != NULL) ++ { ++ col = get_tv_number_chk(&subli->li_tv, &error); ++ if (error == TRUE) ++ goto fail; ++ subli = subli->li_next; ++ if (subli != NULL) ++ { ++ len = get_tv_number_chk(&subli->li_tv, &error); ++ if (error == TRUE) ++ goto fail; ++ } ++ } ++ m->pos.pos[i].col = col; ++ m->pos.pos[i].len = len; ++ } ++ else if (li->li_tv.v_type == VAR_NUMBER) ++ { ++ if (li->li_tv.vval.v_number == 0) ++ continue; ++ m->pos.pos[i].lnum = li->li_tv.vval.v_number; ++ m->pos.pos[i].col = 0; ++ m->pos.pos[i].len = 0; ++ } ++ else ++ { ++ EMSG(_("List or number required")); ++ goto fail; ++ } ++ if (toplnum == 0 || lnum < toplnum) ++ toplnum = lnum; ++ if (botlnum == 0 || lnum > botlnum) ++ botlnum = lnum; ++ } ++ ++ /* Calculate top and bottom lines for redrawing area */ ++ if (toplnum != 0) ++ { ++ if (wp->w_buffer->b_mod_set) ++ { ++ if (wp->w_buffer->b_mod_top > toplnum) ++ wp->w_buffer->b_mod_top = toplnum; ++ if (wp->w_buffer->b_mod_bot < botlnum) ++ wp->w_buffer->b_mod_bot = botlnum; ++ } ++ else ++ { ++ wp->w_buffer->b_mod_top = toplnum; ++ wp->w_buffer->b_mod_bot = botlnum; ++ } ++ m->pos.toplnum = toplnum; ++ m->pos.botlnum = botlnum; ++ wp->w_buffer->b_mod_set = TRUE; ++ rtype = VALID; ++ } ++ } ++ + /* Insert new match. The match list is in ascending order with regard to + * the match priorities. */ + cur = wp->w_match_head; +*************** +*** 6831,6838 **** + prev->next = m; + m->next = cur; + +! redraw_later(SOME_VALID); + return id; + } + + /* +--- 6932,6943 ---- + prev->next = m; + m->next = cur; + +! redraw_later(rtype); + return id; ++ ++ fail: ++ vim_free(m); ++ return -1; + } + + /* +*************** +*** 6845,6852 **** + int id; + int perr; + { +! matchitem_T *cur = wp->w_match_head; +! matchitem_T *prev = cur; + + if (id < 1) + { +--- 6950,6958 ---- + int id; + int perr; + { +! matchitem_T *cur = wp->w_match_head; +! matchitem_T *prev = cur; +! int rtype = SOME_VALID; + + if (id < 1) + { +*************** +*** 6872,6879 **** + prev->next = cur->next; + vim_regfree(cur->match.regprog); + vim_free(cur->pattern); + vim_free(cur); +! redraw_later(SOME_VALID); + return 0; + } + +--- 6978,7002 ---- + prev->next = cur->next; + vim_regfree(cur->match.regprog); + vim_free(cur->pattern); ++ if (cur->pos.toplnum != 0) ++ { ++ if (wp->w_buffer->b_mod_set) ++ { ++ if (wp->w_buffer->b_mod_top > cur->pos.toplnum) ++ wp->w_buffer->b_mod_top = cur->pos.toplnum; ++ if (wp->w_buffer->b_mod_bot < cur->pos.botlnum) ++ wp->w_buffer->b_mod_bot = cur->pos.botlnum; ++ } ++ else ++ { ++ wp->w_buffer->b_mod_top = cur->pos.toplnum; ++ wp->w_buffer->b_mod_bot = cur->pos.botlnum; ++ } ++ wp->w_buffer->b_mod_set = TRUE; ++ rtype = VALID; ++ } + vim_free(cur); +! redraw_later(rtype); + return 0; + } + +*** ../vim-7.4.329/src/version.c 2014-06-17 13:52:35.868092848 +0200 +--- src/version.c 2014-06-17 14:11:53.764136653 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 330, + /**/ + +-- +I'd like to meet the man who invented sex and see what he's working on now. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.331 b/7.4.331 new file mode 100644 index 0000000..d8d526d --- /dev/null +++ b/7.4.331 @@ -0,0 +1,47 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.331 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.331 +Problem: Relative numbering not updated after a linewise yank. Issue 235. +Solution: Redraw after the yank. (Christian Brabandt) +Files: src/ops.c + + +*** ../vim-7.4.330/src/ops.c 2014-04-29 15:55:39.443801021 +0200 +--- src/ops.c 2014-06-17 18:14:36.584687585 +0200 +*************** +*** 3150,3155 **** +--- 3150,3157 ---- + vim_free(y_current->y_array); + y_current = curr; + } ++ if (curwin->w_p_rnu) ++ redraw_later(SOME_VALID); /* cursor moved to start */ + if (mess) /* Display message about yank? */ + { + if (yanktype == MCHAR +*** ../vim-7.4.330/src/version.c 2014-06-17 17:48:21.784628008 +0200 +--- src/version.c 2014-06-17 18:13:35.824685286 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 331, + /**/ + +-- +CONCORDE: Message for you, sir. + He falls forward revealing the arrow with the note. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.332 b/7.4.332 new file mode 100644 index 0000000..94e04d2 --- /dev/null +++ b/7.4.332 @@ -0,0 +1,118 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.332 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.332 +Problem: GTK: When a sign icon doesn't fit exactly there can be ugly gaps. +Solution: Scale the sign to fit when the aspect ratio is not too far off. + (Christian Brabandt) +Files: src/gui_gtk_x11.c + + +*** ../vim-7.4.331/src/gui_gtk_x11.c 2014-05-13 20:19:53.573808877 +0200 +--- src/gui_gtk_x11.c 2014-06-17 18:44:39.900755807 +0200 +*************** +*** 5965,5991 **** + * Decide whether we need to scale. Allow one pixel of border + * width to be cut off, in order to avoid excessive scaling for + * tiny differences in font size. + */ + need_scale = (width > SIGN_WIDTH + 2 +! || height > SIGN_HEIGHT + 2 + || (width < 3 * SIGN_WIDTH / 4 + && height < 3 * SIGN_HEIGHT / 4)); + if (need_scale) + { +! double aspect; + + /* Keep the original aspect ratio */ + aspect = (double)height / (double)width; + width = (double)SIGN_WIDTH * SIGN_ASPECT / aspect; + width = MIN(width, SIGN_WIDTH); +! height = (double)width * aspect; + +! /* This doesn't seem to be worth caching, and doing so +! * would complicate the code quite a bit. */ +! sign = gdk_pixbuf_scale_simple(sign, width, height, +! GDK_INTERP_BILINEAR); +! if (sign == NULL) +! return; /* out of memory */ + } + + /* The origin is the upper-left corner of the pixmap. Therefore +--- 5965,6012 ---- + * Decide whether we need to scale. Allow one pixel of border + * width to be cut off, in order to avoid excessive scaling for + * tiny differences in font size. ++ * Do scale to fit the height to avoid gaps because of linespacing. + */ + need_scale = (width > SIGN_WIDTH + 2 +! || height != SIGN_HEIGHT + || (width < 3 * SIGN_WIDTH / 4 + && height < 3 * SIGN_HEIGHT / 4)); + if (need_scale) + { +! double aspect; +! int w = width; +! int h = height; + + /* Keep the original aspect ratio */ + aspect = (double)height / (double)width; + width = (double)SIGN_WIDTH * SIGN_ASPECT / aspect; + width = MIN(width, SIGN_WIDTH); +! if (((double)(MAX(height, SIGN_HEIGHT)) / +! (double)(MIN(height, SIGN_HEIGHT))) < 1.15) +! { +! /* Change the aspect ratio by at most 15% to fill the +! * available space completly. */ +! height = (double)SIGN_HEIGHT * SIGN_ASPECT / aspect; +! height = MIN(height, SIGN_HEIGHT); +! } +! else +! height = (double)width * aspect; + +! if (w == width && h == height) +! { +! /* no change in dimensions; don't decrease reference counter +! * (below) */ +! need_scale = FALSE; +! } +! else +! { +! /* This doesn't seem to be worth caching, and doing so would +! * complicate the code quite a bit. */ +! sign = gdk_pixbuf_scale_simple(sign, width, height, +! GDK_INTERP_BILINEAR); +! if (sign == NULL) +! return; /* out of memory */ +! } + } + + /* The origin is the upper-left corner of the pixmap. Therefore +*** ../vim-7.4.331/src/version.c 2014-06-17 18:16:08.420691059 +0200 +--- src/version.c 2014-06-17 18:46:49.784760721 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 332, + /**/ + +-- + "To whoever finds this note - + I have been imprisoned by my father who wishes me to marry + against my will. Please please please please come and rescue me. + I am in the tall tower of Swamp Castle." + SIR LAUNCELOT's eyes light up with holy inspiration. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.333 b/7.4.333 new file mode 100644 index 0000000..d0b6171 --- /dev/null +++ b/7.4.333 @@ -0,0 +1,72 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.333 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.333 +Problem: Compiler warning for unused function. +Solution: Put the function inside the #ifdef. +Files: src/screen.c + + +*** ../vim-7.4.332/src/screen.c 2014-06-17 17:48:21.784628008 +0200 +--- src/screen.c 2014-06-17 23:16:24.121372619 +0200 +*************** +*** 139,145 **** + static void redraw_custom_statusline __ARGS((win_T *wp)); + #endif + #ifdef FEAT_SEARCH_EXTRA +! #define SEARCH_HL_PRIORITY 0 + static void start_search_hl __ARGS((void)); + static void end_search_hl __ARGS((void)); + static void init_search_hl __ARGS((win_T *wp)); +--- 139,145 ---- + static void redraw_custom_statusline __ARGS((win_T *wp)); + #endif + #ifdef FEAT_SEARCH_EXTRA +! # define SEARCH_HL_PRIORITY 0 + static void start_search_hl __ARGS((void)); + static void end_search_hl __ARGS((void)); + static void init_search_hl __ARGS((win_T *wp)); +*************** +*** 7476,7482 **** + } + } + } +- #endif + + static int + next_search_hl_pos(shl, lnum, posmatch, mincol) +--- 7476,7481 ---- +*************** +*** 7533,7538 **** +--- 7532,7538 ---- + } + return FALSE; + } ++ #endif + + static void + screen_start_highlight(attr) +*** ../vim-7.4.332/src/version.c 2014-06-17 18:46:57.880761027 +0200 +--- src/version.c 2014-06-17 23:17:14.949374542 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 333, + /**/ + +-- +You had connectors? Eeee, when I were a lad we 'ad to carry the +bits between the computer and the terminal with a spoon... + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.334 b/7.4.334 new file mode 100644 index 0000000..4f72bb2 --- /dev/null +++ b/7.4.334 @@ -0,0 +1,112 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.334 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.334 (after 7.4.330) +Problem: Unitialized variables, causing some problems. +Solution: Initialize the variables. (Dominique Pelle) +Files: src/screen.c, src/window.c + + +*** ../vim-7.4.333/src/screen.c 2014-06-17 23:17:56.489376113 +0200 +--- src/screen.c 2014-06-18 21:16:23.560368846 +0200 +*************** +*** 7363,7369 **** + match_T *shl; /* points to search_hl or a match */ + linenr_T lnum; + colnr_T mincol; /* minimal column for a match */ +! matchitem_T *cur; /* to retrieve match postions if any */ + { + linenr_T l; + colnr_T matchcol; +--- 7363,7369 ---- + match_T *shl; /* points to search_hl or a match */ + linenr_T lnum; + colnr_T mincol; /* minimal column for a match */ +! matchitem_T *cur; /* to retrieve match positions if any */ + { + linenr_T l; + colnr_T matchcol; +*************** +*** 7458,7466 **** + } + } + else if (cur != NULL) +- { + nmatched = next_search_hl_pos(shl, lnum, &(cur->pos), matchcol); +! } + if (nmatched == 0) + { + shl->lnum = 0; /* no match found */ +--- 7458,7466 ---- + } + } + else if (cur != NULL) + nmatched = next_search_hl_pos(shl, lnum, &(cur->pos), matchcol); +! else +! nmatched = 0; + if (nmatched == 0) + { + shl->lnum = 0; /* no match found */ +*** ../vim-7.4.333/src/window.c 2014-06-17 17:48:21.784628008 +0200 +--- src/window.c 2014-06-18 21:12:15.232359452 +0200 +*************** +*** 6809,6815 **** + } + + /* Build new match. */ +! m = (matchitem_T *)alloc(sizeof(matchitem_T)); + m->id = id; + m->priority = prio; + m->pattern = pat == NULL ? NULL : vim_strsave(pat); +--- 6809,6815 ---- + } + + /* Build new match. */ +! m = (matchitem_T *)alloc_clear(sizeof(matchitem_T)); + m->id = id; + m->priority = prio; + m->pattern = pat == NULL ? NULL : vim_strsave(pat); +*************** +*** 6835,6841 **** + int len = 1; + list_T *subl; + listitem_T *subli; +! int error; + + if (li == NULL) + { +--- 6835,6841 ---- + int len = 1; + list_T *subl; + listitem_T *subli; +! int error = FALSE; + + if (li == NULL) + { +*** ../vim-7.4.333/src/version.c 2014-06-17 23:17:56.493376113 +0200 +--- src/version.c 2014-06-18 21:14:16.516364040 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 334, + /**/ + +-- +You were lucky. We lived for three months in a brown paper bag in a +septic tank. We used to have to get up at six o'clock in the morning, +clean the bag, eat a crust of stale bread, go to work down mill for +fourteen hours a day week in-week out. When we got home, our Dad +would thrash us to sleep with his belt! + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.335 b/7.4.335 new file mode 100644 index 0000000..ef41bc8 --- /dev/null +++ b/7.4.335 @@ -0,0 +1,108 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.335 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.335 +Problem: No digraph for the new rouble sign. +Solution: Add the digraphs =R and =P. +Files: src/digraph.c, runtime/doc/digraph.txt + + +*** ../vim-7.4.334/src/digraph.c 2012-01-10 21:57:16.000000000 +0100 +--- src/digraph.c 2014-06-18 21:36:46.148415099 +0200 +*************** +*** 1425,1430 **** +--- 1425,1432 ---- + {'W', '=', 0x20a9}, + {'=', 'e', 0x20ac}, /* euro */ + {'E', 'u', 0x20ac}, /* euro */ ++ {'=', 'R', 0x20bd}, /* rouble */ ++ {'=', 'P', 0x20bd}, /* rouble */ + {'o', 'C', 0x2103}, + {'c', 'o', 0x2105}, + {'o', 'F', 0x2109}, +*** ../vim-7.4.334/runtime/doc/digraph.txt 2013-08-10 13:24:52.000000000 +0200 +--- runtime/doc/digraph.txt 2014-06-18 21:35:21.684411903 +0200 +*************** +*** 147,153 **** + Two 2 Hook + Nine 9 Horn + +! Equals = Cyrillic + Asterisk * Greek + Percent sign % Greek/Cyrillic special + Plus + smalls: Arabic, capitals: Hebrew +--- 147,153 ---- + Two 2 Hook + Nine 9 Horn + +! Equals = Cyrillic (= used as second char) + Asterisk * Greek + Percent sign % Greek/Cyrillic special + Plus + smalls: Arabic, capitals: Hebrew +*************** +*** 170,175 **** +--- 170,180 ---- + used for the euro sign, while both of them are the character 164, 0xa4. For + compatibility with zsh Eu can also be used for the euro sign. + ++ ROUBLE ++ ++ The rouble sign was added in 2014 as 0x20bd. Vim supports the digraphs =R and ++ =P for this. Note that R= and P= are other characters. ++ + *digraph-table* + char digraph hex dec official name ~ + ^@ NU 0x00 0 NULL (NUL) +*************** +*** 966,971 **** +--- 971,978 ---- + ₧ Pt 20A7 8359 PESETA SIGN + ₩ W= 20A9 8361 WON SIGN + € Eu 20AC 8364 EURO SIGN ++ ₽ =R 20AC 8381 ROUBLE SIGN ++ ₽ =P 20AC 8381 ROUBLE SIGN + ℃ oC 2103 8451 DEGREE CELSIUS + ℅ co 2105 8453 CARE OF + ℉ oF 2109 8457 DEGREE FAHRENHEIT +*************** +*** 1077,1083 **** + ⊥ -T 22A5 8869 UP TACK + ⋅ .P 22C5 8901 DOT OPERATOR + ⋮ :3 22EE 8942 VERTICAL ELLIPSIS +! ⋯ .3 22EF 8943 MIDLINE HORIZONTAL ELLIPSIS + ⌂ Eh 2302 8962 HOUSE + ⌈ <7 2308 8968 LEFT CEILING + ⌉ >7 2309 8969 RIGHT CEILING +--- 1084,1090 ---- + ⊥ -T 22A5 8869 UP TACK + ⋅ .P 22C5 8901 DOT OPERATOR + ⋮ :3 22EE 8942 VERTICAL ELLIPSIS +! ⋯ .3 22EF 8943 MIDLINE HORIZONTAL ELLIPSIS + ⌂ Eh 2302 8962 HOUSE + ⌈ <7 2308 8968 LEFT CEILING + ⌉ >7 2309 8969 RIGHT CEILING +*** ../vim-7.4.334/src/version.c 2014-06-18 21:20:07.240377308 +0200 +--- src/version.c 2014-06-18 21:36:14.632413906 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 335, + /**/ + +-- +You got to work at a mill? Lucky! I got sent back to work in the +acid-mines for my daily crust of stale bread... which not even the +birds would eat. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.336 b/7.4.336 new file mode 100644 index 0000000..6e5fe3f --- /dev/null +++ b/7.4.336 @@ -0,0 +1,100 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.336 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.336 +Problem: Setting 'history' to a big value causes out-of-memory errors. +Solution: Limit the value to 10000. (Hirohito Higashi) +Files: runtime/doc/options.txt, src/option.c + + +*** ../vim-7.4.335/runtime/doc/options.txt 2014-05-28 21:40:47.088329130 +0200 +--- runtime/doc/options.txt 2014-06-25 11:44:16.985950668 +0200 +*************** +*** 3920,3931 **** + NOTE: This option is reset when 'compatible' is set. + + *'history'* *'hi'* +! 'history' 'hi' number (Vim default: 20, Vi default: 0) + global + {not in Vi} + A history of ":" commands, and a history of previous search patterns +! are remembered. This option decides how many entries may be stored in + each of these histories (see |cmdline-editing|). + NOTE: This option is set to the Vi default value when 'compatible' is + set and to the Vim default value when 'compatible' is reset. + +--- 3920,3932 ---- + NOTE: This option is reset when 'compatible' is set. + + *'history'* *'hi'* +! 'history' 'hi' number (Vim default: 50, Vi default: 0) + global + {not in Vi} + A history of ":" commands, and a history of previous search patterns +! is remembered. This option decides how many entries may be stored in + each of these histories (see |cmdline-editing|). ++ The maximum value is 10000. + NOTE: This option is set to the Vi default value when 'compatible' is + set and to the Vim default value when 'compatible' is reset. + +*** ../vim-7.4.335/src/option.c 2014-05-13 12:16:44.037555110 +0200 +--- src/option.c 2014-06-25 11:44:48.349951855 +0200 +*************** +*** 1392,1398 **** + SCRIPTID_INIT}, + {"history", "hi", P_NUM|P_VIM, + (char_u *)&p_hi, PV_NONE, +! {(char_u *)0L, (char_u *)20L} SCRIPTID_INIT}, + {"hkmap", "hk", P_BOOL|P_VI_DEF|P_VIM, + #ifdef FEAT_RIGHTLEFT + (char_u *)&p_hkmap, PV_NONE, +--- 1392,1398 ---- + SCRIPTID_INIT}, + {"history", "hi", P_NUM|P_VIM, + (char_u *)&p_hi, PV_NONE, +! {(char_u *)0L, (char_u *)50L} SCRIPTID_INIT}, + {"hkmap", "hk", P_BOOL|P_VI_DEF|P_VIM, + #ifdef FEAT_RIGHTLEFT + (char_u *)&p_hkmap, PV_NONE, +*************** +*** 8595,8600 **** +--- 8595,8605 ---- + errmsg = e_positive; + p_hi = 0; + } ++ else if (p_hi > 10000) ++ { ++ errmsg = e_invarg; ++ p_hi = 10000; ++ } + if (p_re < 0 || p_re > 2) + { + errmsg = e_invarg; +*** ../vim-7.4.335/src/version.c 2014-06-18 21:38:12.216418355 +0200 +--- src/version.c 2014-06-25 11:45:08.141952604 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 336, + /**/ + +-- +ARTHUR: Well, it doesn't matter. Will you go and tell your master that + Arthur from the Court of Camelot is here. +GUARD #1: Listen, in order to maintain air-speed velocity, a swallow + needs to beat its wings 43 times every second, right? +ARTHUR: Please! + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.337 b/7.4.337 new file mode 100644 index 0000000..80b8349 --- /dev/null +++ b/7.4.337 @@ -0,0 +1,51 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.337 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.337 +Problem: When there is an error preparing to edit the command line, the + command won't be executed. (Hirohito Higashi) +Solution: Reset did_emsg before editing. +Files: src/ex_getln.c + + +*** ../vim-7.4.336/src/ex_getln.c 2014-06-12 19:44:45.324549030 +0200 +--- src/ex_getln.c 2014-06-25 12:06:38.018001402 +0200 +*************** +*** 342,347 **** +--- 342,354 ---- + do_digraph(-1); /* init digraph typeahead */ + #endif + ++ /* If something above caused an error, reset the flags, we do want to type ++ * and execute commands. Display may be messed up a bit. */ ++ if (did_emsg) ++ redrawcmd(); ++ did_emsg = FALSE; ++ got_int = FALSE; ++ + /* + * Collect the command string, handling editing keys. + */ +*** ../vim-7.4.336/src/version.c 2014-06-25 11:48:40.733960646 +0200 +--- src/version.c 2014-06-25 12:24:39.442042313 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 337, + /**/ + +-- +Computers are not intelligent. They only think they are. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.338 b/7.4.338 new file mode 100644 index 0000000..f533693 --- /dev/null +++ b/7.4.338 @@ -0,0 +1,1830 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.338 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.338 +Problem: Cannot wrap lines taking indent into account. +Solution: Add the 'breakindent' option. (many authors, final improvements by + Christian Brabandt) +Files: runtime/doc/eval.txt, runtime/doc/options.txt, runtime/optwin.vim, + src/buffer.c, src/charset.c, src/edit.c, src/ex_getln.c, + src/getchar.c, src/misc1.c, src/misc2.c, src/ops.c, src/option.c, + src/option.h, src/proto/charset.pro, src/proto/misc1.pro, + src/proto/option.pro, src/screen.c, src/structs.h, + src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, + src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms, src/testdir/Makefile, + src/testdir/test_breakindent.in, src/testdir/test_breakindent.ok, + src/ui.c + + +*** ../vim-7.4.337/runtime/doc/eval.txt 2014-06-17 17:48:21.768628007 +0200 +--- runtime/doc/eval.txt 2014-06-25 12:57:00.986115765 +0200 +*************** +*** 6639,6646 **** + keymap Compiled with 'keymap' support. + langmap Compiled with 'langmap' support. + libcall Compiled with |libcall()| support. +! linebreak Compiled with 'linebreak', 'breakat' and 'showbreak' +! support. + lispindent Compiled with support for lisp indenting. + listcmds Compiled with commands for the buffer list |:files| + and the argument list |arglist|. +--- 6651,6658 ---- + keymap Compiled with 'keymap' support. + langmap Compiled with 'langmap' support. + libcall Compiled with |libcall()| support. +! linebreak Compiled with 'linebreak', 'breakat', 'showbreak' and +! 'breakindent' support. + lispindent Compiled with support for lisp indenting. + listcmds Compiled with commands for the buffer list |:files| + and the argument list |arglist|. +*** ../vim-7.4.337/runtime/doc/options.txt 2014-06-17 17:48:21.768628007 +0200 +--- runtime/doc/options.txt 2014-06-25 12:57:00.986115765 +0200 +*************** +*** 1200,1205 **** +--- 1200,1237 ---- + break if 'linebreak' is on. Only works for ASCII and also for 8-bit + characters when 'encoding' is an 8-bit encoding. + ++ *'breakindent'* *'bri'* ++ 'breakindent' 'bri' boolean (default off) ++ local to window ++ {not in Vi} ++ {not available when compiled without the |+linebreak| ++ feature} ++ Every wrapped line will continue visually indented (same amount of ++ space as the beginning of that line), thus preserving horizontal blocks ++ of text. ++ ++ *'breakindentopt'* *'briopt'* ++ 'breakindentopt' 'briopt' string (default empty) ++ local to window ++ {not in Vi} ++ {not available when compiled without the |+linebreak| ++ feature} ++ Settings for 'breakindent'. It can consist of the following optional ++ items and must be seperated by a comma: ++ min:{n} Minimum text width that will be kept after ++ applying 'breakindent', even if the resulting ++ text should normally be narrower. This prevents ++ text indented almost to the right window border ++ occupying lot of vertical space when broken. ++ shift:{n} After applying 'breakindent', wrapped line ++ beginning will be shift by given number of ++ characters. It permits dynamic French paragraph ++ indentation (negative) or emphasizing the line ++ continuation (positive). ++ sbr Display the 'showbreak' value before applying the ++ additional indent. ++ The default value for min is 20 and shift is 0. ++ + *'browsedir'* *'bsdir'* + 'browsedir' 'bsdir' string (default: "last") + global +*** ../vim-7.4.337/runtime/optwin.vim 2014-04-01 12:26:40.241157964 +0200 +--- runtime/optwin.vim 2014-06-25 12:57:00.990115765 +0200 +*************** +*** 324,329 **** +--- 324,335 ---- + call append("$", "linebreak\twrap long lines at a character in 'breakat'") + call append("$", "\t(local to window)") + call BinOptionL("lbr") ++ call append("$", "breakindent\tpreserve indentation in wrapped text") ++ call append("$", "\t(local to window)") ++ call BinOptionL("bri") ++ call append("$", "breakindentopt\tadjust breakindent behaviour") ++ call append("$", "\t(local to window)") ++ call OptionL("briopt") + call append("$", "breakat\twhich characters might cause a line break") + call OptionG("brk", &brk) + call append("$", "showbreak\tstring to put before wrapped screen lines") +*** ../vim-7.4.337/src/charset.c 2014-03-23 15:12:29.911264336 +0100 +--- src/charset.c 2014-06-25 13:23:05.842174966 +0200 +*************** +*** 867,875 **** + char_u *s; + { + colnr_T col = startcol; + + while (*s != NUL) +! col += lbr_chartabsize_adv(&s, col); + return (int)col; + } + +--- 867,876 ---- + char_u *s; + { + colnr_T col = startcol; ++ char_u *line = s; /* pointer to start of line, for breakindent */ + + while (*s != NUL) +! col += lbr_chartabsize_adv(line, &s, col); + return (int)col; + } + +*************** +*** 877,892 **** + * Like linetabsize(), but for a given window instead of the current one. + */ + int +! win_linetabsize(wp, p, len) + win_T *wp; +! char_u *p; + colnr_T len; + { + colnr_T col = 0; + char_u *s; + +! for (s = p; *s != NUL && (len == MAXCOL || s < p + len); mb_ptr_adv(s)) +! col += win_lbr_chartabsize(wp, s, col, NULL); + return (int)col; + } + +--- 878,894 ---- + * Like linetabsize(), but for a given window instead of the current one. + */ + int +! win_linetabsize(wp, line, len) + win_T *wp; +! char_u *line; + colnr_T len; + { + colnr_T col = 0; + char_u *s; + +! for (s = line; *s != NUL && (len == MAXCOL || s < line + len); +! mb_ptr_adv(s)) +! col += win_lbr_chartabsize(wp, line, s, col, NULL); + return (int)col; + } + +*************** +*** 1021,1032 **** + * like chartabsize(), but also check for line breaks on the screen + */ + int +! lbr_chartabsize(s, col) + unsigned char *s; + colnr_T col; + { + #ifdef FEAT_LINEBREAK +! if (!curwin->w_p_lbr && *p_sbr == NUL) + { + #endif + #ifdef FEAT_MBYTE +--- 1023,1035 ---- + * like chartabsize(), but also check for line breaks on the screen + */ + int +! lbr_chartabsize(line, s, col) +! char_u *line; /* start of the line */ + unsigned char *s; + colnr_T col; + { + #ifdef FEAT_LINEBREAK +! if (!curwin->w_p_lbr && *p_sbr == NUL && !curwin->w_p_bri) + { + #endif + #ifdef FEAT_MBYTE +*************** +*** 1036,1042 **** + RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, s, col) + #ifdef FEAT_LINEBREAK + } +! return win_lbr_chartabsize(curwin, s, col, NULL); + #endif + } + +--- 1039,1045 ---- + RET_WIN_BUF_CHARTABSIZE(curwin, curbuf, s, col) + #ifdef FEAT_LINEBREAK + } +! return win_lbr_chartabsize(curwin, line == NULL ? s : line, s, col, NULL); + #endif + } + +*************** +*** 1044,1056 **** + * Call lbr_chartabsize() and advance the pointer. + */ + int +! lbr_chartabsize_adv(s, col) + char_u **s; + colnr_T col; + { + int retval; + +! retval = lbr_chartabsize(*s, col); + mb_ptr_adv(*s); + return retval; + } +--- 1047,1060 ---- + * Call lbr_chartabsize() and advance the pointer. + */ + int +! lbr_chartabsize_adv(line, s, col) +! char_u *line; /* start of the line */ + char_u **s; + colnr_T col; + { + int retval; + +! retval = lbr_chartabsize(line, *s, col); + mb_ptr_adv(*s); + return retval; + } +*************** +*** 1063,1070 **** + * value, init to 0 before calling. + */ + int +! win_lbr_chartabsize(wp, s, col, headp) + win_T *wp; + char_u *s; + colnr_T col; + int *headp UNUSED; +--- 1067,1075 ---- + * value, init to 0 before calling. + */ + int +! win_lbr_chartabsize(wp, line, s, col, headp) + win_T *wp; ++ char_u *line; /* start of the line */ + char_u *s; + colnr_T col; + int *headp UNUSED; +*************** +*** 1086,1094 **** + int n; + + /* +! * No 'linebreak' and 'showbreak': return quickly. + */ +! if (!wp->w_p_lbr && *p_sbr == NUL) + #endif + { + #ifdef FEAT_MBYTE +--- 1091,1099 ---- + int n; + + /* +! * No 'linebreak', 'showbreak' and 'breakindent': return quickly. + */ +! if (!wp->w_p_lbr && !wp->w_p_bri && *p_sbr == NUL) + #endif + { + #ifdef FEAT_MBYTE +*************** +*** 1163,1173 **** + # endif + + /* +! * May have to add something for 'showbreak' string at start of line + * Set *headp to the size of what we add. + */ + added = 0; +! if (*p_sbr != NUL && wp->w_p_wrap && col != 0) + { + numberextra = win_col_off(wp); + col += numberextra + mb_added; +--- 1168,1179 ---- + # endif + + /* +! * May have to add something for 'breakindent' and/or 'showbreak' +! * string at start of line. + * Set *headp to the size of what we add. + */ + added = 0; +! if ((*p_sbr != NUL || wp->w_p_bri) && wp->w_p_wrap && col != 0) + { + numberextra = win_col_off(wp); + col += numberextra + mb_added; +*************** +*** 1180,1186 **** + } + if (col == 0 || col + size > (colnr_T)W_WIDTH(wp)) + { +! added = vim_strsize(p_sbr); + if (tab_corr) + size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts; + else +--- 1186,1197 ---- + } + if (col == 0 || col + size > (colnr_T)W_WIDTH(wp)) + { +! added = 0; +! if (*p_sbr != NUL) +! added += vim_strsize(p_sbr); +! if (wp->w_p_bri) +! added += get_breakindent_win(wp, line); +! + if (tab_corr) + size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts; + else +*************** +*** 1274,1286 **** + colnr_T vcol; + char_u *ptr; /* points to current char */ + char_u *posptr; /* points to char at pos->col */ + int incr; + int head; + int ts = wp->w_buffer->b_p_ts; + int c; + + vcol = 0; +! ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); + if (pos->col == MAXCOL) + posptr = NULL; /* continue until the NUL */ + else +--- 1285,1298 ---- + colnr_T vcol; + char_u *ptr; /* points to current char */ + char_u *posptr; /* points to char at pos->col */ ++ char_u *line; /* start of the line */ + int incr; + int head; + int ts = wp->w_buffer->b_p_ts; + int c; + + vcol = 0; +! line = ptr = ml_get_buf(wp->w_buffer, pos->lnum, FALSE); + if (pos->col == MAXCOL) + posptr = NULL; /* continue until the NUL */ + else +*************** +*** 1288,1299 **** + + /* + * This function is used very often, do some speed optimizations. +! * When 'list', 'linebreak' and 'showbreak' are not set use a simple loop. + * Also use this when 'list' is set but tabs take their normal size. + */ + if ((!wp->w_p_list || lcs_tab1 != NUL) + #ifdef FEAT_LINEBREAK +! && !wp->w_p_lbr && *p_sbr == NUL + #endif + ) + { +--- 1300,1312 ---- + + /* + * This function is used very often, do some speed optimizations. +! * When 'list', 'linebreak', 'showbreak' and 'breakindent' are not set +! * use a simple loop. + * Also use this when 'list' is set but tabs take their normal size. + */ + if ((!wp->w_p_list || lcs_tab1 != NUL) + #ifdef FEAT_LINEBREAK +! && !wp->w_p_lbr && *p_sbr == NUL && !wp->w_p_bri + #endif + ) + { +*************** +*** 1355,1361 **** + { + /* A tab gets expanded, depending on the current column */ + head = 0; +! incr = win_lbr_chartabsize(wp, ptr, vcol, &head); + /* make sure we don't go past the end of the line */ + if (*ptr == NUL) + { +--- 1368,1374 ---- + { + /* A tab gets expanded, depending on the current column */ + head = 0; +! incr = win_lbr_chartabsize(wp, line, ptr, vcol, &head); + /* make sure we don't go past the end of the line */ + if (*ptr == NUL) + { +*** ../vim-7.4.337/src/edit.c 2014-05-28 21:40:47.092329130 +0200 +--- src/edit.c 2014-06-25 13:16:43.278160493 +0200 +*************** +*** 1956,1962 **** + else + #endif + ++new_cursor_col; +! vcol += lbr_chartabsize(ptr + new_cursor_col, (colnr_T)vcol); + } + vcol = last_vcol; + +--- 1956,1962 ---- + else + #endif + ++new_cursor_col; +! vcol += lbr_chartabsize(ptr, ptr + new_cursor_col, (colnr_T)vcol); + } + vcol = last_vcol; + +*************** +*** 7126,7134 **** + for (;;) + { + coladvance(v - width); +! /* getviscol() is slow, skip it when 'showbreak' is empty and +! * there are no multi-byte characters */ +! if ((*p_sbr == NUL + # ifdef FEAT_MBYTE + && !has_mbyte + # endif +--- 7126,7135 ---- + for (;;) + { + coladvance(v - width); +! /* getviscol() is slow, skip it when 'showbreak' is empty, +! * 'breakindent' is not set and there are no multi-byte +! * characters */ +! if ((*p_sbr == NUL && !curwin->w_p_bri + # ifdef FEAT_MBYTE + && !has_mbyte + # endif +*************** +*** 9758,9768 **** + getvcol(curwin, &fpos, &vcol, NULL, NULL); + getvcol(curwin, cursor, &want_vcol, NULL, NULL); + +! /* Use as many TABs as possible. Beware of 'showbreak' and +! * 'linebreak' adding extra virtual columns. */ + while (vim_iswhite(*ptr)) + { +! i = lbr_chartabsize((char_u *)"\t", vcol); + if (vcol + i > want_vcol) + break; + if (*ptr != TAB) +--- 9759,9769 ---- + getvcol(curwin, &fpos, &vcol, NULL, NULL); + getvcol(curwin, cursor, &want_vcol, NULL, NULL); + +! /* Use as many TABs as possible. Beware of 'breakindent', 'showbreak' +! * and 'linebreak' adding extra virtual columns. */ + while (vim_iswhite(*ptr)) + { +! i = lbr_chartabsize(NULL, (char_u *)"\t", vcol); + if (vcol + i > want_vcol) + break; + if (*ptr != TAB) +*************** +*** 9784,9794 **** + if (change_col >= 0) + { + int repl_off = 0; + + /* Skip over the spaces we need. */ + while (vcol < want_vcol && *ptr == ' ') + { +! vcol += lbr_chartabsize(ptr, vcol); + ++ptr; + ++repl_off; + } +--- 9785,9796 ---- + if (change_col >= 0) + { + int repl_off = 0; ++ char_u *line = ptr; + + /* Skip over the spaces we need. */ + while (vcol < want_vcol && *ptr == ' ') + { +! vcol += lbr_chartabsize(line, ptr, vcol); + ++ptr; + ++repl_off; + } +*************** +*** 10029,10034 **** +--- 10031,10037 ---- + int c; + int temp; + char_u *ptr, *prev_ptr; ++ char_u *line; + + if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) + { +*************** +*** 10038,10050 **** + + /* try to advance to the cursor column */ + temp = 0; +! ptr = ml_get(lnum); + prev_ptr = ptr; + validate_virtcol(); + while ((colnr_T)temp < curwin->w_virtcol && *ptr != NUL) + { + prev_ptr = ptr; +! temp += lbr_chartabsize_adv(&ptr, (colnr_T)temp); + } + if ((colnr_T)temp > curwin->w_virtcol) + ptr = prev_ptr; +--- 10041,10053 ---- + + /* try to advance to the cursor column */ + temp = 0; +! line = ptr = ml_get(lnum); + prev_ptr = ptr; + validate_virtcol(); + while ((colnr_T)temp < curwin->w_virtcol && *ptr != NUL) + { + prev_ptr = ptr; +! temp += lbr_chartabsize_adv(line, &ptr, (colnr_T)temp); + } + if ((colnr_T)temp > curwin->w_virtcol) + ptr = prev_ptr; +*** ../vim-7.4.337/src/ex_getln.c 2014-06-25 12:26:42.230046959 +0200 +--- src/ex_getln.c 2014-06-25 12:57:00.998115765 +0200 +*************** +*** 2302,2311 **** + + p = (char_u *)line_ga.ga_data; + p[line_ga.ga_len] = NUL; +! indent = get_indent_str(p, 8); + indent += sw - indent % sw; + add_indent: +! while (get_indent_str(p, 8) < indent) + { + char_u *s = skipwhite(p); + +--- 2302,2311 ---- + + p = (char_u *)line_ga.ga_data; + p[line_ga.ga_len] = NUL; +! indent = get_indent_str(p, 8, FALSE); + indent += sw - indent % sw; + add_indent: +! while (get_indent_str(p, 8, FALSE) < indent) + { + char_u *s = skipwhite(p); + +*************** +*** 2357,2367 **** + else + { + p[line_ga.ga_len] = NUL; +! indent = get_indent_str(p, 8); + --indent; + indent -= indent % get_sw_value(curbuf); + } +! while (get_indent_str(p, 8) > indent) + { + char_u *s = skipwhite(p); + +--- 2357,2367 ---- + else + { + p[line_ga.ga_len] = NUL; +! indent = get_indent_str(p, 8, FALSE); + --indent; + indent -= indent % get_sw_value(curbuf); + } +! while (get_indent_str(p, 8, FALSE) > indent) + { + char_u *s = skipwhite(p); + +*** ../vim-7.4.337/src/getchar.c 2014-05-22 18:59:54.510169240 +0200 +--- src/getchar.c 2014-06-25 13:16:53.946160896 +0200 +*************** +*** 2675,2681 **** + { + if (!vim_iswhite(ptr[col])) + curwin->w_wcol = vcol; +! vcol += lbr_chartabsize(ptr + col, + (colnr_T)vcol); + #ifdef FEAT_MBYTE + if (has_mbyte) +--- 2675,2681 ---- + { + if (!vim_iswhite(ptr[col])) + curwin->w_wcol = vcol; +! vcol += lbr_chartabsize(ptr, ptr + col, + (colnr_T)vcol); + #ifdef FEAT_MBYTE + if (has_mbyte) +*** ../vim-7.4.337/src/misc1.c 2014-05-22 14:00:12.698534712 +0200 +--- src/misc1.c 2014-06-25 13:39:43.598212712 +0200 +*************** +*** 32,38 **** + int + get_indent() + { +! return get_indent_str(ml_get_curline(), (int)curbuf->b_p_ts); + } + + /* +--- 32,38 ---- + int + get_indent() + { +! return get_indent_str(ml_get_curline(), (int)curbuf->b_p_ts, FALSE); + } + + /* +*************** +*** 42,48 **** + get_indent_lnum(lnum) + linenr_T lnum; + { +! return get_indent_str(ml_get(lnum), (int)curbuf->b_p_ts); + } + + #if defined(FEAT_FOLDING) || defined(PROTO) +--- 42,48 ---- + get_indent_lnum(lnum) + linenr_T lnum; + { +! return get_indent_str(ml_get(lnum), (int)curbuf->b_p_ts, FALSE); + } + + #if defined(FEAT_FOLDING) || defined(PROTO) +*************** +*** 55,61 **** + buf_T *buf; + linenr_T lnum; + { +! return get_indent_str(ml_get_buf(buf, lnum, FALSE), (int)buf->b_p_ts); + } + #endif + +--- 55,61 ---- + buf_T *buf; + linenr_T lnum; + { +! return get_indent_str(ml_get_buf(buf, lnum, FALSE), (int)buf->b_p_ts, FALSE); + } + #endif + +*************** +*** 64,79 **** + * 'tabstop' at "ts" + */ + int +! get_indent_str(ptr, ts) + char_u *ptr; + int ts; + { + int count = 0; + + for ( ; *ptr; ++ptr) + { +! if (*ptr == TAB) /* count a tab for what it is worth */ +! count += ts - (count % ts); + else if (*ptr == ' ') + ++count; /* count a space for one */ + else +--- 64,86 ---- + * 'tabstop' at "ts" + */ + int +! get_indent_str(ptr, ts, list) + char_u *ptr; + int ts; ++ int list; /* if TRUE, count only screen size for tabs */ + { + int count = 0; + + for ( ; *ptr; ++ptr) + { +! if (*ptr == TAB) +! { +! if (!list || lcs_tab1) /* count a tab for what it is worth */ +! count += ts - (count % ts); +! else +! /* in list mode, when tab is not set, count screen char width for Tab: ^I */ +! count += ptr2cells(ptr); +! } + else if (*ptr == ' ') + ++count; /* count a space for one */ + else +*************** +*** 476,481 **** +--- 483,540 ---- + return (int)col; + } + ++ #if defined(FEAT_LINEBREAK) || defined(PROTO) ++ /* ++ * Return appropriate space number for breakindent, taking influencing ++ * parameters into account. Window must be specified, since it is not ++ * necessarily always the current one. ++ */ ++ int ++ get_breakindent_win(wp, line) ++ win_T *wp; ++ char_u *line; /* start of the line */ ++ { ++ static int prev_indent = 0; /* cached indent value */ ++ static long prev_ts = 0L; /* cached tabstop value */ ++ static char_u *prev_line = NULL; /* cached pointer to line */ ++ int bri = 0; ++ /* window width minus window margin space, i.e. what rests for text */ ++ const int eff_wwidth = W_WIDTH(wp) ++ - ((wp->w_p_nu || wp->w_p_rnu) ++ && (vim_strchr(p_cpo, CPO_NUMCOL) == NULL) ++ ? number_width(wp) + 1 : 0); ++ ++ /* used cached indent, unless pointer or 'tabstop' changed */ ++ if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts) ++ { ++ prev_line = line; ++ prev_ts = wp->w_buffer->b_p_ts; ++ prev_indent = get_indent_str(line, ++ (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift; ++ } ++ ++ /* indent minus the length of the showbreak string */ ++ bri = prev_indent; ++ if (wp->w_p_brisbr) ++ bri -= vim_strsize(p_sbr); ++ ++ /* Add offset for number column, if 'n' is in 'cpoptions' */ ++ bri += win_col_off2(wp); ++ ++ /* never indent past left window margin */ ++ if (bri < 0) ++ bri = 0; ++ /* always leave at least bri_min characters on the left, ++ * if text width is sufficient */ ++ else if (bri > eff_wwidth - wp->w_p_brimin) ++ bri = (eff_wwidth - wp->w_p_brimin < 0) ++ ? 0 : eff_wwidth - wp->w_p_brimin; ++ ++ return bri; ++ } ++ #endif ++ ++ + #if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT) + + static int cin_is_cinword __ARGS((char_u *line)); +*************** +*** 678,684 **** + /* + * count white space on current line + */ +! newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts); + if (newindent == 0 && !(flags & OPENLINE_COM_LIST)) + newindent = second_line_indent; /* for ^^D command in insert mode */ + +--- 737,743 ---- + /* + * count white space on current line + */ +! newindent = get_indent_str(saved_line, (int)curbuf->b_p_ts, FALSE); + if (newindent == 0 && !(flags & OPENLINE_COM_LIST)) + newindent = second_line_indent; /* for ^^D command in insert mode */ + +*************** +*** 1201,1207 **** + || do_si + #endif + ) +! newindent = get_indent_str(leader, (int)curbuf->b_p_ts); + + /* Add the indent offset */ + if (newindent + off < 0) +--- 1260,1266 ---- + || do_si + #endif + ) +! newindent = get_indent_str(leader, (int)curbuf->b_p_ts, FALSE); + + /* Add the indent offset */ + if (newindent + off < 0) +*************** +*** 1994,1999 **** +--- 2053,2059 ---- + char_u *s; + int lines = 0; + int width; ++ char_u *line; + + #ifdef FEAT_DIFF + /* Check for filler lines above this buffer line. When folded the result +*************** +*** 2009,2020 **** + return lines + 1; + #endif + +! s = ml_get_buf(wp->w_buffer, lnum, FALSE); + + col = 0; + while (*s != NUL && --column >= 0) + { +! col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL); + mb_ptr_adv(s); + } + +--- 2069,2080 ---- + return lines + 1; + #endif + +! line = s = ml_get_buf(wp->w_buffer, lnum, FALSE); + + col = 0; + while (*s != NUL && --column >= 0) + { +! col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL); + mb_ptr_adv(s); + } + +*************** +*** 2026,2032 **** + * 'ts') -- webb. + */ + if (*s == TAB && (State & NORMAL) && (!wp->w_p_list || lcs_tab1)) +! col += win_lbr_chartabsize(wp, s, (colnr_T)col, NULL) - 1; + + /* + * Add column offset for 'number', 'relativenumber', 'foldcolumn', etc. +--- 2086,2092 ---- + * 'ts') -- webb. + */ + if (*s == TAB && (State & NORMAL) && (!wp->w_p_list || lcs_tab1)) +! col += win_lbr_chartabsize(wp, line, s, (colnr_T)col, NULL) - 1; + + /* + * Add column offset for 'number', 'relativenumber', 'foldcolumn', etc. +*************** +*** 9002,9011 **** + amount = 2; + else + { + amount = 0; + while (*that && col) + { +! amount += lbr_chartabsize_adv(&that, (colnr_T)amount); + col--; + } + +--- 9062,9073 ---- + amount = 2; + else + { ++ char_u *line = that; ++ + amount = 0; + while (*that && col) + { +! amount += lbr_chartabsize_adv(line, &that, (colnr_T)amount); + col--; + } + +*************** +*** 9028,9034 **** + + while (vim_iswhite(*that)) + { +! amount += lbr_chartabsize(that, (colnr_T)amount); + ++that; + } + +--- 9090,9096 ---- + + while (vim_iswhite(*that)) + { +! amount += lbr_chartabsize(line, that, (colnr_T)amount); + ++that; + } + +*************** +*** 9066,9080 **** + && !quotecount) + --parencount; + if (*that == '\\' && *(that+1) != NUL) +! amount += lbr_chartabsize_adv(&that, +! (colnr_T)amount); +! amount += lbr_chartabsize_adv(&that, +! (colnr_T)amount); + } + } + while (vim_iswhite(*that)) + { +! amount += lbr_chartabsize(that, (colnr_T)amount); + that++; + } + if (!*that || *that == ';') +--- 9128,9143 ---- + && !quotecount) + --parencount; + if (*that == '\\' && *(that+1) != NUL) +! amount += lbr_chartabsize_adv( +! line, &that, (colnr_T)amount); +! amount += lbr_chartabsize_adv( +! line, &that, (colnr_T)amount); + } + } + while (vim_iswhite(*that)) + { +! amount += lbr_chartabsize( +! line, that, (colnr_T)amount); + that++; + } + if (!*that || *that == ';') +*** ../vim-7.4.337/src/misc2.c 2014-05-07 18:35:25.669216052 +0200 +--- src/misc2.c 2014-06-25 13:21:18.474170904 +0200 +*************** +*** 201,210 **** + { + /* Count a tab for what it's worth (if list mode not on) */ + #ifdef FEAT_LINEBREAK +! csize = win_lbr_chartabsize(curwin, ptr, col, &head); + mb_ptr_adv(ptr); + #else +! csize = lbr_chartabsize_adv(&ptr, col); + #endif + col += csize; + } +--- 201,210 ---- + { + /* Count a tab for what it's worth (if list mode not on) */ + #ifdef FEAT_LINEBREAK +! csize = win_lbr_chartabsize(curwin, line, ptr, col, &head); + mb_ptr_adv(ptr); + #else +! csize = lbr_chartabsize_adv(line, &ptr, col); + #endif + col += csize; + } +*************** +*** 2156,2162 **** + } + } + +! #if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264) + /* + * Append the text in "gap" below the cursor line and clear "gap". + */ +--- 2156,2163 ---- + } + } + +! #if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264) \ +! || defined(PROTO) + /* + * Append the text in "gap" below the cursor line and clear "gap". + */ +*** ../vim-7.4.337/src/ops.c 2014-06-17 18:16:08.420691059 +0200 +--- src/ops.c 2014-06-25 13:18:27.082164420 +0200 +*************** +*** 420,426 **** + } + for ( ; vim_iswhite(*bd.textstart); ) + { +! incr = lbr_chartabsize_adv(&bd.textstart, (colnr_T)(bd.start_vcol)); + total += incr; + bd.start_vcol += incr; + } +--- 420,428 ---- + } + for ( ; vim_iswhite(*bd.textstart); ) + { +! /* TODO: is passing bd.textstart for start of the line OK? */ +! incr = lbr_chartabsize_adv(bd.textstart, &bd.textstart, +! (colnr_T)(bd.start_vcol)); + total += incr; + bd.start_vcol += incr; + } +*************** +*** 480,486 **** + + while (vim_iswhite(*non_white)) + { +! incr = lbr_chartabsize_adv(&non_white, non_white_col); + non_white_col += incr; + } + +--- 482,488 ---- + + while (vim_iswhite(*non_white)) + { +! incr = lbr_chartabsize_adv(bd.textstart, &non_white, non_white_col); + non_white_col += incr; + } + +*************** +*** 505,511 **** + verbatim_copy_width -= bd.start_char_vcols; + while (verbatim_copy_width < destination_col) + { +! incr = lbr_chartabsize(verbatim_copy_end, verbatim_copy_width); + if (verbatim_copy_width + incr > destination_col) + break; + verbatim_copy_width += incr; +--- 507,517 ---- + verbatim_copy_width -= bd.start_char_vcols; + while (verbatim_copy_width < destination_col) + { +! char_u *line = verbatim_copy_end; +! +! /* TODO: is passing verbatim_copy_end for start of the line OK? */ +! incr = lbr_chartabsize(line, verbatim_copy_end, +! verbatim_copy_width); + if (verbatim_copy_width + incr > destination_col) + break; + verbatim_copy_width += incr; +*************** +*** 3617,3623 **** + for (ptr = oldp; vcol < col && *ptr; ) + { + /* Count a tab for what it's worth (if list mode not on) */ +! incr = lbr_chartabsize_adv(&ptr, (colnr_T)vcol); + vcol += incr; + } + bd.textcol = (colnr_T)(ptr - oldp); +--- 3623,3629 ---- + for (ptr = oldp; vcol < col && *ptr; ) + { + /* Count a tab for what it's worth (if list mode not on) */ +! incr = lbr_chartabsize_adv(oldp, &ptr, (colnr_T)vcol); + vcol += incr; + } + bd.textcol = (colnr_T)(ptr - oldp); +*************** +*** 3651,3657 **** + /* calculate number of spaces required to fill right side of block*/ + spaces = y_width + 1; + for (j = 0; j < yanklen; j++) +! spaces -= lbr_chartabsize(&y_array[i][j], 0); + if (spaces < 0) + spaces = 0; + +--- 3657,3663 ---- + /* calculate number of spaces required to fill right side of block*/ + spaces = y_width + 1; + for (j = 0; j < yanklen; j++) +! spaces -= lbr_chartabsize(NULL, &y_array[i][j], 0); + if (spaces < 0) + spaces = 0; + +*************** +*** 5203,5209 **** + while (bdp->start_vcol < oap->start_vcol && *pstart) + { + /* Count a tab for what it's worth (if list mode not on) */ +! incr = lbr_chartabsize(pstart, (colnr_T)bdp->start_vcol); + bdp->start_vcol += incr; + #ifdef FEAT_VISUALEXTRA + if (vim_iswhite(*pstart)) +--- 5209,5215 ---- + while (bdp->start_vcol < oap->start_vcol && *pstart) + { + /* Count a tab for what it's worth (if list mode not on) */ +! incr = lbr_chartabsize(line, pstart, (colnr_T)bdp->start_vcol); + bdp->start_vcol += incr; + #ifdef FEAT_VISUALEXTRA + if (vim_iswhite(*pstart)) +*************** +*** 5272,5278 **** + { + /* Count a tab for what it's worth (if list mode not on) */ + prev_pend = pend; +! incr = lbr_chartabsize_adv(&pend, (colnr_T)bdp->end_vcol); + bdp->end_vcol += incr; + } + if (bdp->end_vcol <= oap->end_vcol +--- 5278,5287 ---- + { + /* Count a tab for what it's worth (if list mode not on) */ + prev_pend = pend; +! /* TODO: is passing prev_pend for start of the line OK? +! * perhaps it should be "line". */ +! incr = lbr_chartabsize_adv(prev_pend, &pend, +! (colnr_T)bdp->end_vcol); + bdp->end_vcol += incr; + } + if (bdp->end_vcol <= oap->end_vcol +*************** +*** 6882,6888 **** + validate_virtcol(); + col_print(buf1, sizeof(buf1), (int)curwin->w_cursor.col + 1, + (int)curwin->w_virtcol + 1); +! col_print(buf2, sizeof(buf2), (int)STRLEN(p), linetabsize(p)); + + if (char_count_cursor == byte_count_cursor + && char_count == byte_count) +--- 6891,6898 ---- + validate_virtcol(); + col_print(buf1, sizeof(buf1), (int)curwin->w_cursor.col + 1, + (int)curwin->w_virtcol + 1); +! col_print(buf2, sizeof(buf2), (int)STRLEN(p), +! linetabsize(p)); + + if (char_count_cursor == byte_count_cursor + && char_count == byte_count) +*** ../vim-7.4.337/src/option.c 2014-06-25 11:48:40.733960646 +0200 +--- src/option.c 2014-06-25 14:31:41.630330672 +0200 +*************** +*** 188,193 **** +--- 188,197 ---- + #ifdef FEAT_ARABIC + # define PV_ARAB OPT_WIN(WV_ARAB) + #endif ++ #ifdef FEAT_LINEBREAK ++ # define PV_BRI OPT_WIN(WV_BRI) ++ # define PV_BRIOPT OPT_WIN(WV_BRIOPT) ++ #endif + #ifdef FEAT_DIFF + # define PV_DIFF OPT_WIN(WV_DIFF) + #endif +*************** +*** 648,653 **** +--- 652,675 ---- + {(char_u *)0L, (char_u *)0L} + #endif + SCRIPTID_INIT}, ++ {"breakindent", "bri", P_BOOL|P_VI_DEF|P_VIM|P_RWIN, ++ #ifdef FEAT_LINEBREAK ++ (char_u *)VAR_WIN, PV_BRI, ++ {(char_u *)FALSE, (char_u *)0L} ++ #else ++ (char_u *)NULL, PV_NONE, ++ {(char_u *)0L, (char_u *)0L} ++ #endif ++ SCRIPTID_INIT}, ++ {"breakindentopt", "briopt", P_STRING|P_ALLOCED|P_VI_DEF|P_RBUF|P_COMMA|P_NODUP, ++ #ifdef FEAT_LINEBREAK ++ (char_u *)VAR_WIN, PV_BRIOPT, ++ {(char_u *)"", (char_u *)NULL} ++ #else ++ (char_u *)NULL, PV_NONE, ++ {(char_u *)"", (char_u *)NULL} ++ #endif ++ SCRIPTID_INIT}, + {"browsedir", "bsdir",P_STRING|P_VI_DEF, + #ifdef FEAT_BROWSE + (char_u *)&p_bsdir, PV_NONE, +*************** +*** 5256,5261 **** +--- 5278,5286 ---- + /* set cedit_key */ + (void)check_cedit(); + #endif ++ #ifdef FEAT_LINEBREAK ++ briopt_check(); ++ #endif + } + + /* +*************** +*** 5709,5714 **** +--- 5734,5747 ---- + *p_pm == '.' ? p_pm + 1 : p_pm) == 0) + errmsg = (char_u *)N_("E589: 'backupext' and 'patchmode' are equal"); + } ++ #ifdef FEAT_LINEBREAK ++ /* 'breakindentopt' */ ++ else if (varp == &curwin->w_p_briopt) ++ { ++ if (briopt_check() == FAIL) ++ errmsg = e_invarg; ++ } ++ #endif + + /* + * 'isident', 'iskeyword', 'isprint or 'isfname' option: refill chartab[] +*************** +*** 10018,10023 **** +--- 10051,10058 ---- + case PV_WRAP: return (char_u *)&(curwin->w_p_wrap); + #ifdef FEAT_LINEBREAK + case PV_LBR: return (char_u *)&(curwin->w_p_lbr); ++ case PV_BRI: return (char_u *)&(curwin->w_p_bri); ++ case PV_BRIOPT: return (char_u *)&(curwin->w_p_briopt); + #endif + #ifdef FEAT_SCROLLBIND + case PV_SCBIND: return (char_u *)&(curwin->w_p_scb); +*************** +*** 10207,10212 **** +--- 10242,10249 ---- + #endif + #ifdef FEAT_LINEBREAK + to->wo_lbr = from->wo_lbr; ++ to->wo_bri = from->wo_bri; ++ to->wo_briopt = vim_strsave(from->wo_briopt); + #endif + #ifdef FEAT_SCROLLBIND + to->wo_scb = from->wo_scb; +*************** +*** 10294,10299 **** +--- 10331,10339 ---- + #ifdef FEAT_CONCEAL + check_string_option(&wop->wo_cocu); + #endif ++ #ifdef FEAT_LINEBREAK ++ check_string_option(&wop->wo_briopt); ++ #endif + } + + /* +*************** +*** 10313,10318 **** +--- 10353,10361 ---- + # endif + clear_string_option(&wop->wo_fmr); + #endif ++ #ifdef FEAT_LINEBREAK ++ clear_string_option(&wop->wo_briopt); ++ #endif + #ifdef FEAT_RIGHTLEFT + clear_string_option(&wop->wo_rlc); + #endif +*************** +*** 11927,11929 **** +--- 11970,12018 ---- + ++ptr; + } + } ++ ++ #if defined(FEAT_LINEBREAK) || defined(PROTO) ++ /* ++ * This is called when 'breakindentopt' is changed and when a window is ++ * initialized. ++ */ ++ int ++ briopt_check() ++ { ++ char_u *p; ++ int bri_shift = 0; ++ long bri_min = 20; ++ int bri_sbr = FALSE; ++ ++ p = curwin->w_p_briopt; ++ while (*p != NUL) ++ { ++ if (STRNCMP(p, "shift:", 6) == 0 ++ && ((p[6] == '-' && VIM_ISDIGIT(p[7])) || VIM_ISDIGIT(p[6]))) ++ { ++ p += 6; ++ bri_shift = getdigits(&p); ++ } ++ else if (STRNCMP(p, "min:", 4) == 0 && VIM_ISDIGIT(p[4])) ++ { ++ p += 4; ++ bri_min = getdigits(&p); ++ } ++ else if (STRNCMP(p, "sbr", 3) == 0) ++ { ++ p += 3; ++ bri_sbr = TRUE; ++ } ++ if (*p != ',' && *p != NUL) ++ return FAIL; ++ if (*p == ',') ++ ++p; ++ } ++ ++ curwin->w_p_brishift = bri_shift; ++ curwin->w_p_brimin = bri_min; ++ curwin->w_p_brisbr = bri_sbr; ++ ++ return OK; ++ } ++ #endif +*** ../vim-7.4.337/src/option.h 2014-05-28 21:40:47.092329130 +0200 +--- src/option.h 2014-06-25 12:57:01.002115765 +0200 +*************** +*** 1052,1057 **** +--- 1052,1061 ---- + #ifdef FEAT_CURSORBIND + , WV_CRBIND + #endif ++ #ifdef FEAT_LINEBREAK ++ , WV_BRI ++ , WV_BRIOPT ++ #endif + #ifdef FEAT_DIFF + , WV_DIFF + #endif +*** ../vim-7.4.337/src/proto/charset.pro 2013-08-10 13:37:07.000000000 +0200 +--- src/proto/charset.pro 2014-06-25 13:22:32.934173721 +0200 +*************** +*** 16,22 **** + int chartabsize __ARGS((char_u *p, colnr_T col)); + int linetabsize __ARGS((char_u *s)); + int linetabsize_col __ARGS((int startcol, char_u *s)); +! int win_linetabsize __ARGS((win_T *wp, char_u *p, colnr_T len)); + int vim_isIDc __ARGS((int c)); + int vim_iswordc __ARGS((int c)); + int vim_iswordc_buf __ARGS((int c, buf_T *buf)); +--- 16,22 ---- + int chartabsize __ARGS((char_u *p, colnr_T col)); + int linetabsize __ARGS((char_u *s)); + int linetabsize_col __ARGS((int startcol, char_u *s)); +! int win_linetabsize __ARGS((win_T *wp, char_u *line, colnr_T len)); + int vim_isIDc __ARGS((int c)); + int vim_iswordc __ARGS((int c)); + int vim_iswordc_buf __ARGS((int c, buf_T *buf)); +*************** +*** 26,34 **** + int vim_isfilec_or_wc __ARGS((int c)); + int vim_isprintc __ARGS((int c)); + int vim_isprintc_strict __ARGS((int c)); +! int lbr_chartabsize __ARGS((unsigned char *s, colnr_T col)); +! int lbr_chartabsize_adv __ARGS((char_u **s, colnr_T col)); +! int win_lbr_chartabsize __ARGS((win_T *wp, char_u *s, colnr_T col, int *headp)); + int in_win_border __ARGS((win_T *wp, colnr_T vcol)); + void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end)); + colnr_T getvcol_nolist __ARGS((pos_T *posp)); +--- 26,34 ---- + int vim_isfilec_or_wc __ARGS((int c)); + int vim_isprintc __ARGS((int c)); + int vim_isprintc_strict __ARGS((int c)); +! int lbr_chartabsize __ARGS((char_u *line, unsigned char *s, colnr_T col)); +! int lbr_chartabsize_adv __ARGS((char_u *line, char_u **s, colnr_T col)); +! int win_lbr_chartabsize __ARGS((win_T *wp, char_u *line, char_u *s, colnr_T col, int *headp)); + int in_win_border __ARGS((win_T *wp, colnr_T vcol)); + void getvcol __ARGS((win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end)); + colnr_T getvcol_nolist __ARGS((pos_T *posp)); +*** ../vim-7.4.337/src/proto/misc1.pro 2014-05-07 15:10:17.661108310 +0200 +--- src/proto/misc1.pro 2014-06-25 12:57:01.002115765 +0200 +*************** +*** 2,10 **** + int get_indent __ARGS((void)); + int get_indent_lnum __ARGS((linenr_T lnum)); + int get_indent_buf __ARGS((buf_T *buf, linenr_T lnum)); +! int get_indent_str __ARGS((char_u *ptr, int ts)); + int set_indent __ARGS((int size, int flags)); + int get_number_indent __ARGS((linenr_T lnum)); + int open_line __ARGS((int dir, int flags, int second_line_indent)); + int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int include_space)); + int get_last_leader_offset __ARGS((char_u *line, char_u **flags)); +--- 2,11 ---- + int get_indent __ARGS((void)); + int get_indent_lnum __ARGS((linenr_T lnum)); + int get_indent_buf __ARGS((buf_T *buf, linenr_T lnum)); +! int get_indent_str __ARGS((char_u *ptr, int ts, int list)); + int set_indent __ARGS((int size, int flags)); + int get_number_indent __ARGS((linenr_T lnum)); ++ int get_breakindent_win __ARGS((win_T *wp, char_u *ptr)); + int open_line __ARGS((int dir, int flags, int second_line_indent)); + int get_leader_len __ARGS((char_u *line, char_u **flags, int backward, int include_space)); + int get_last_leader_offset __ARGS((char_u *line, char_u **flags)); +*** ../vim-7.4.337/src/proto/option.pro 2014-01-14 16:54:53.000000000 +0100 +--- src/proto/option.pro 2014-06-25 14:16:04.882295233 +0200 +*************** +*** 63,66 **** +--- 63,67 ---- + long get_sw_value __ARGS((buf_T *buf)); + long get_sts_value __ARGS((void)); + void find_mps_values __ARGS((int *initc, int *findc, int *backwards, int switchit)); ++ int briopt_check __ARGS((void)); + /* vim: set ft=c : */ +*** ../vim-7.4.337/src/screen.c 2014-06-18 21:20:07.232377308 +0200 +--- src/screen.c 2014-06-25 13:43:39.930221653 +0200 +*************** +*** 2962,2971 **** + # define WL_SIGN WL_FOLD /* column for signs */ + #endif + #define WL_NR WL_SIGN + 1 /* line number */ + #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) +! # define WL_SBR WL_NR + 1 /* 'showbreak' or 'diff' */ + #else +! # define WL_SBR WL_NR + #endif + #define WL_LINE WL_SBR + 1 /* text in the line */ + int draw_state = WL_START; /* what to draw next */ +--- 2962,2976 ---- + # define WL_SIGN WL_FOLD /* column for signs */ + #endif + #define WL_NR WL_SIGN + 1 /* line number */ ++ #ifdef FEAT_LINEBREAK ++ # define WL_BRI WL_NR + 1 /* 'breakindent' */ ++ #else ++ # define WL_BRI WL_NR ++ #endif + #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) +! # define WL_SBR WL_BRI + 1 /* 'showbreak' or 'diff' */ + #else +! # define WL_SBR WL_BRI + #endif + #define WL_LINE WL_SBR + 1 /* text in the line */ + int draw_state = WL_START; /* what to draw next */ +*************** +*** 3301,3307 **** + #endif + while (vcol < v && *ptr != NUL) + { +! c = win_lbr_chartabsize(wp, ptr, (colnr_T)vcol, NULL); + vcol += c; + #ifdef FEAT_MBYTE + prev_ptr = ptr; +--- 3306,3312 ---- + #endif + while (vcol < v && *ptr != NUL) + { +! c = win_lbr_chartabsize(wp, line, ptr, (colnr_T)vcol, NULL); + vcol += c; + #ifdef FEAT_MBYTE + prev_ptr = ptr; +*************** +*** 3670,3675 **** +--- 3675,3718 ---- + } + } + ++ #ifdef FEAT_LINEBREAK ++ if (wp->w_p_brisbr && draw_state == WL_BRI - 1 ++ && n_extra == 0 && *p_sbr != NUL) ++ /* draw indent after showbreak value */ ++ draw_state = WL_BRI; ++ else if (wp->w_p_brisbr && draw_state == WL_SBR && n_extra == 0) ++ /* After the showbreak, draw the breakindent */ ++ draw_state = WL_BRI - 1; ++ ++ /* draw 'breakindent': indent wrapped text accordingly */ ++ if (draw_state == WL_BRI - 1 && n_extra == 0) ++ { ++ draw_state = WL_BRI; ++ # ifdef FEAT_DIFF ++ # endif ++ if (wp->w_p_bri && n_extra == 0 && row != startrow ++ #ifdef FEAT_DIFF ++ && filler_lines == 0 ++ #endif ++ ) ++ { ++ char_attr = 0; /* was: hl_attr(HLF_AT); */ ++ #ifdef FEAT_DIFF ++ if (diff_hlf != (hlf_T)0) ++ char_attr = hl_attr(diff_hlf); ++ #endif ++ p_extra = NUL; ++ c_extra = ' '; ++ n_extra = get_breakindent_win(wp, ++ ml_get_buf(wp->w_buffer, lnum, FALSE)); ++ /* Correct end of highlighted area for 'breakindent', ++ * required when 'linebreak' is also set. */ ++ if (tocol == vcol) ++ tocol += n_extra; ++ } ++ } ++ #endif ++ + #if defined(FEAT_LINEBREAK) || defined(FEAT_DIFF) + if (draw_state == WL_SBR - 1 && n_extra == 0) + { +*************** +*** 4382,4392 **** + if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr) + && !wp->w_p_list) + { +! n_extra = win_lbr_chartabsize(wp, ptr - ( + # ifdef FEAT_MBYTE + has_mbyte ? mb_l : + # endif +! 1), (colnr_T)vcol, NULL) - 1; + c_extra = ' '; + if (vim_iswhite(c)) + { +--- 4425,4438 ---- + if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr) + && !wp->w_p_list) + { +! char_u *p = ptr - ( + # ifdef FEAT_MBYTE + has_mbyte ? mb_l : + # endif +! 1); +! /* TODO: is passing p for start of the line OK? */ +! n_extra = win_lbr_chartabsize(wp, p, p, (colnr_T)vcol, +! NULL) - 1; + c_extra = ' '; + if (vim_iswhite(c)) + { +*************** +*** 8916,8923 **** + { + if (noinvcurs) + screen_stop_highlight(); +! if (row == screen_cur_row && (col > screen_cur_col) && +! *T_CRI != NUL) + term_cursor_right(col - screen_cur_col); + else + term_windgoto(row, col); +--- 8962,8969 ---- + { + if (noinvcurs) + screen_stop_highlight(); +! if (row == screen_cur_row && (col > screen_cur_col) +! && *T_CRI != NUL) + term_cursor_right(col - screen_cur_col); + else + term_windgoto(row, col); +*** ../vim-7.4.337/src/structs.h 2014-06-17 17:48:21.784628008 +0200 +--- src/structs.h 2014-06-25 12:57:01.006115766 +0200 +*************** +*** 134,139 **** +--- 134,145 ---- + int wo_arab; + # define w_p_arab w_onebuf_opt.wo_arab /* 'arabic' */ + #endif ++ #ifdef FEAT_LINEBREAK ++ int wo_bri; ++ # define w_p_bri w_onebuf_opt.wo_bri /* 'breakindent' */ ++ char_u *wo_briopt; ++ # define w_p_briopt w_onebuf_opt.wo_briopt /* 'breakindentopt' */ ++ #endif + #ifdef FEAT_DIFF + int wo_diff; + # define w_p_diff w_onebuf_opt.wo_diff /* 'diff' */ +*************** +*** 2189,2194 **** +--- 2195,2205 ---- + #ifdef FEAT_SYN_HL + int *w_p_cc_cols; /* array of columns to highlight or NULL */ + #endif ++ #ifdef FEAT_LINEBREAK ++ int w_p_brimin; /* minimum width for breakindent */ ++ int w_p_brishift; /* additional shift for breakindent */ ++ int w_p_brisbr; /* sbr in 'briopt' */ ++ #endif + + /* transform a pointer to a "onebuf" option into a "allbuf" option */ + #define GLOBAL_WO(p) ((char *)p + sizeof(winopt_T)) +*** ../vim-7.4.337/src/testdir/Make_amiga.mak 2014-05-29 11:47:19.804773758 +0200 +--- src/testdir/Make_amiga.mak 2014-06-25 12:57:01.006115766 +0200 +*************** +*** 37,42 **** +--- 37,43 ---- + test99.out test100.out test101.out test102.out test103.out \ + test104.out test105.out test106.out test107.out \ + test_autoformat_join.out \ ++ test_breakindent.out \ + test_eval.out \ + test_options.out + +*************** +*** 163,167 **** +--- 164,169 ---- + test106.out: test106.in + test107.out: test107.in + test_autoformat_join.out: test_autoformat_join.in ++ test_breakindent.out: test_breakindent.in + test_eval.out: test_eval.in + test_options.out: test_options.in +*** ../vim-7.4.337/src/testdir/Make_dos.mak 2014-05-29 11:47:19.804773758 +0200 +--- src/testdir/Make_dos.mak 2014-06-25 12:57:01.006115766 +0200 +*************** +*** 36,41 **** +--- 36,42 ---- + test100.out test101.out test102.out test103.out test104.out \ + test105.out test106.out test107.out\ + test_autoformat_join.out \ ++ test_breakindent.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.337/src/testdir/Make_ming.mak 2014-05-29 11:47:19.804773758 +0200 +--- src/testdir/Make_ming.mak 2014-06-25 12:57:01.006115766 +0200 +*************** +*** 56,61 **** +--- 56,62 ---- + test100.out test101.out test102.out test103.out test104.out \ + test105.out test106.out test107.out \ + test_autoformat_join.out \ ++ test_breakindent.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.337/src/testdir/Make_os2.mak 2014-05-29 11:47:19.804773758 +0200 +--- src/testdir/Make_os2.mak 2014-06-25 12:59:45.774121999 +0200 +*************** +*** 39,44 **** +--- 39,45 ---- + test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_eval.out \ ++ test_breakindent.out \ + test_options.out + + .SUFFIXES: .in .out +*** ../vim-7.4.337/src/testdir/Make_vms.mms 2014-05-29 11:47:19.804773758 +0200 +--- src/testdir/Make_vms.mms 2014-06-25 12:57:01.006115766 +0200 +*************** +*** 97,102 **** +--- 97,103 ---- + test100.out test101.out test103.out test104.out \ + test105.out test106.out test107.out \ + test_autoformat_join.out \ ++ test_breakindent.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.337/src/testdir/Makefile 2014-05-29 11:47:19.804773758 +0200 +--- src/testdir/Makefile 2014-06-25 12:57:01.006115766 +0200 +*************** +*** 34,39 **** +--- 34,40 ---- + test99.out test100.out test101.out test102.out test103.out \ + test104.out test105.out test106.out test107.out \ + test_autoformat_join.out \ ++ test_breakindent.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.337/src/testdir/test_breakindent.in 2014-06-25 14:36:28.690341532 +0200 +--- src/testdir/test_breakindent.in 2014-06-25 14:26:00.994317785 +0200 +*************** +*** 0 **** +--- 1,79 ---- ++ Test for breakindent ++ ++ STARTTEST ++ :so small.vim ++ :if !exists("+breakindent") | e! test.ok | w! test.out | qa! | endif ++ :10new|:vsp|:vert resize 20 ++ :put =\"\tabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP\" ++ :set ts=4 sw=4 sts=4 breakindent ++ :fu! ScreenChar(width) ++ : let c='' ++ : for i in range(1,a:width) ++ : let c.=nr2char(screenchar(line('.'), i)) ++ : endfor ++ : let c.="\n" ++ : for i in range(1,a:width) ++ : let c.=nr2char(screenchar(line('.')+1, i)) ++ : endfor ++ : let c.="\n" ++ : for i in range(1,a:width) ++ : let c.=nr2char(screenchar(line('.')+2, i)) ++ : endfor ++ : return c ++ :endfu ++ :fu DoRecordScreen() ++ : wincmd l ++ : $put =printf(\"\n%s\", g:test) ++ : $put =g:line1 ++ : wincmd p ++ :endfu ++ :let g:test="Test 1: Simple breakindent" ++ :let line1=ScreenChar(8) ++ :call DoRecordScreen() ++ :let g:test="Test 2: Simple breakindent + sbr=>>" ++ :set sbr=>> ++ :let line1=ScreenChar(8) ++ :call DoRecordScreen() ++ :let g:test ="Test 3: Simple breakindent + briopt:sbr" ++ :set briopt=sbr,min:0 sbr=++ ++ :let line1=ScreenChar(8) ++ :call DoRecordScreen() ++ :let g:test ="Test 4: Simple breakindent + min width: 18" ++ :set sbr= briopt=min:18 ++ :let line1=ScreenChar(8) ++ :call DoRecordScreen() ++ :let g:test =" Test 5: Simple breakindent + shift by 2" ++ :set briopt=shift:2,min:0 ++ :let line1=ScreenChar(8) ++ :call DoRecordScreen() ++ :let g:test=" Test 6: Simple breakindent + shift by -1" ++ :set briopt=shift:-1,min:0 ++ :let line1=ScreenChar(8) ++ :call DoRecordScreen() ++ :let g:test=" Test 7: breakindent + shift by +1 + nu + sbr=? briopt:sbr" ++ :set briopt=shift:1,sbr,min:0 nu sbr=? nuw=4 ++ :let line1=ScreenChar(10) ++ :call DoRecordScreen() ++ :let g:test=" Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr" ++ :set briopt=shift:1,sbr,min:0 nu sbr=# list ++ :let line1=ScreenChar(10) ++ :call DoRecordScreen() ++ :let g:test=" Test 9: breakindent + shift by +1 + 'nu' + sbr=# list" ++ :set briopt-=sbr ++ :let line1=ScreenChar(10) ++ :call DoRecordScreen() ++ :let g:test=" Test 10: breakindent + shift by +1 + 'nu' + sbr=~ cpo+=n" ++ :set cpo+=n sbr=~ nu nuw=4 nolist briopt=sbr,min:0 ++ :let line1=ScreenChar(10) ++ :call DoRecordScreen() ++ :wincmd p ++ :let g:test="\n Test 11: strdisplaywidth when breakindent is on" ++ :set cpo-=n sbr=>> nu nuw=4 nolist briopt= ts=4 ++ :let text=getline(2) "skip leading tab when calculating text width ++ :let width = strlen(text[1:])+indent(2)*4+strlen(&sbr)*3 " text wraps 3 times ++ :$put =g:test ++ :$put =printf(\"strdisplaywidth: %d == calculated: %d\", strdisplaywidth(text), width) ++ :%w! test.out ++ :qa! ++ ENDTEST ++ dummy text +*** ../vim-7.4.337/src/testdir/test_breakindent.ok 2014-06-25 14:36:28.698341532 +0200 +--- src/testdir/test_breakindent.ok 2014-06-25 12:57:01.006115766 +0200 +*************** +*** 0 **** +--- 1,55 ---- ++ ++ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP ++ ++ Test 1: Simple breakindent ++ abcd ++ qrst ++ GHIJ ++ ++ Test 2: Simple breakindent + sbr=>> ++ abcd ++ >>qr ++ >>EF ++ ++ Test 3: Simple breakindent + briopt:sbr ++ abcd ++ ++ qrst ++ ++ GHIJ ++ ++ Test 4: Simple breakindent + min width: 18 ++ abcd ++ qrstuv ++ IJKLMN ++ ++ Test 5: Simple breakindent + shift by 2 ++ abcd ++ qr ++ EF ++ ++ Test 6: Simple breakindent + shift by -1 ++ abcd ++ qrstu ++ HIJKL ++ ++ Test 7: breakindent + shift by +1 + nu + sbr=? briopt:sbr ++ 2 ab ++ ? m ++ ? x ++ ++ Test 8: breakindent + shift:1 + nu + sbr=# list briopt:sbr ++ 2 ^Iabcd ++ # opq ++ # BCD ++ ++ Test 9: breakindent + shift by +1 + 'nu' + sbr=# list ++ 2 ^Iabcd ++ #op ++ #AB ++ ++ Test 10: breakindent + shift by +1 + 'nu' + sbr=~ cpo+=n ++ 2 ab ++ ~ mn ++ ~ yz ++ ++ Test 11: strdisplaywidth when breakindent is on ++ strdisplaywidth: 46 == calculated: 64 +*** ../vim-7.4.337/src/ui.c 2014-06-12 13:28:26.771694851 +0200 +--- src/ui.c 2014-06-25 13:22:20.218173240 +0200 +*************** +*** 3162,3176 **** + /* try to advance to the specified column */ + int count = 0; + char_u *ptr; +! char_u *start; + +! start = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); + while (count < vcol && *ptr != NUL) + { +! count += win_lbr_chartabsize(wp, ptr, count, NULL); + mb_ptr_adv(ptr); + } +! return (int)(ptr - start); + } + #endif + +--- 3162,3176 ---- + /* try to advance to the specified column */ + int count = 0; + char_u *ptr; +! char_u *line; + +! line = ptr = ml_get_buf(wp->w_buffer, lnum, FALSE); + while (count < vcol && *ptr != NUL) + { +! count += win_lbr_chartabsize(wp, line, ptr, count, NULL); + mb_ptr_adv(ptr); + } +! return (int)(ptr - line); + } + #endif + +*** ../vim-7.4.337/src/version.c 2014-06-25 12:26:42.230046959 +0200 +--- src/version.c 2014-06-25 13:00:26.990123558 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 338, + /**/ + +-- +MORTICIAN: Bring out your dead! + [clang] + Bring out your dead! + [clang] + Bring out your dead! +CUSTOMER: Here's one -- nine pence. +DEAD PERSON: I'm not dead! + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.339 b/7.4.339 new file mode 100644 index 0000000..ffe2d16 --- /dev/null +++ b/7.4.339 @@ -0,0 +1,79 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.339 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.339 +Problem: Local function is available globally. +Solution: Add "static". +Files: src/option.c, src/proto/option.pro + + +*** ../vim-7.4.338/src/option.c 2014-06-25 14:39:35.110348584 +0200 +--- src/option.c 2014-06-25 14:42:33.986355351 +0200 +*************** +*** 3074,3079 **** +--- 3074,3080 ---- + static char_u *get_varp_scope __ARGS((struct vimoption *p, int opt_flags)); + static char_u *get_varp __ARGS((struct vimoption *)); + static void option_value2string __ARGS((struct vimoption *, int opt_flags)); ++ static void check_winopt __ARGS((winopt_T *wop)); + static int wc_use_keyname __ARGS((char_u *varp, long *wcp)); + #ifdef FEAT_LANGMAP + static void langmap_init __ARGS((void)); +*************** +*** 10305,10311 **** + /* + * Check for NULL pointers in a winopt_T and replace them with empty_option. + */ +! void + check_winopt(wop) + winopt_T *wop UNUSED; + { +--- 10306,10312 ---- + /* + * Check for NULL pointers in a winopt_T and replace them with empty_option. + */ +! static void + check_winopt(wop) + winopt_T *wop UNUSED; + { +*** ../vim-7.4.338/src/proto/option.pro 2014-06-25 14:39:35.110348584 +0200 +--- src/proto/option.pro 2014-06-25 14:42:38.702355530 +0200 +*************** +*** 40,46 **** + void win_copy_options __ARGS((win_T *wp_from, win_T *wp_to)); + void copy_winopt __ARGS((winopt_T *from, winopt_T *to)); + void check_win_options __ARGS((win_T *win)); +- void check_winopt __ARGS((winopt_T *wop)); + void clear_winopt __ARGS((winopt_T *wop)); + void buf_copy_options __ARGS((buf_T *buf, int flags)); + void reset_modifiable __ARGS((void)); +--- 40,45 ---- +*** ../vim-7.4.338/src/version.c 2014-06-25 14:39:35.114348584 +0200 +--- src/version.c 2014-06-25 14:43:41.502357905 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 339, + /**/ + +-- +MORTICIAN: What? +CUSTOMER: Nothing -- here's your nine pence. +DEAD PERSON: I'm not dead! +MORTICIAN: Here -- he says he's not dead! +CUSTOMER: Yes, he is. +DEAD PERSON: I'm not! + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.340 b/7.4.340 new file mode 100644 index 0000000..f469420 --- /dev/null +++ b/7.4.340 @@ -0,0 +1,97 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.340 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.340 +Problem: Error from sed about illegal bytes when installing Vim. +Solution: Prepend LC_ALL=C. (Itchyny) +Files: src/installman.sh + + +*** ../vim-7.4.339/src/installman.sh 2010-05-15 13:04:07.000000000 +0200 +--- src/installman.sh 2014-06-25 14:54:11.742381748 +0200 +*************** +*** 43,52 **** + fi + fi + + if test $what = "install"; then + # vim.1 + echo installing $destdir/$exename.1 +! sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/doc+$helpsubloc+ \ + -e s+$vimloc/print+$printsubloc+ \ + -e s+$vimloc/syntax+$synsubloc+ \ +--- 43,55 ---- + fi + fi + ++ # Note: setting LC_ALL to C is required to avoid illegal byte errors from sed ++ # on some systems. ++ + if test $what = "install"; then + # vim.1 + echo installing $destdir/$exename.1 +! LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/doc+$helpsubloc+ \ + -e s+$vimloc/print+$printsubloc+ \ + -e s+$vimloc/syntax+$synsubloc+ \ +*************** +*** 64,70 **** + + # vimtutor.1 + echo installing $destdir/$exename""tutor.1 +! sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/tutor+$tutorsubloc+ \ + $helpsource/vimtutor$langadd.1 > $destdir/$exename""tutor.1 + chmod $manmod $destdir/$exename""tutor.1 +--- 67,73 ---- + + # vimtutor.1 + echo installing $destdir/$exename""tutor.1 +! LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/tutor+$tutorsubloc+ \ + $helpsource/vimtutor$langadd.1 > $destdir/$exename""tutor.1 + chmod $manmod $destdir/$exename""tutor.1 +*************** +*** 76,82 **** + + # evim.1 + echo installing $destdir/$evimname.1 +! sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/evim.vim+$scriptloc/evim.vim+ \ + $helpsource/evim$langadd.1 > $destdir/$evimname.1 + chmod $manmod $destdir/$evimname.1 +--- 79,85 ---- + + # evim.1 + echo installing $destdir/$evimname.1 +! LC_ALL=C sed -e s+/usr/local/lib/vim+$vimloc+ \ + -e s+$vimloc/evim.vim+$scriptloc/evim.vim+ \ + $helpsource/evim$langadd.1 > $destdir/$evimname.1 + chmod $manmod $destdir/$evimname.1 +*** ../vim-7.4.339/src/version.c 2014-06-25 14:44:04.458358774 +0200 +--- src/version.c 2014-06-25 14:55:14.198384111 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 340, + /**/ + +-- +DEAD PERSON: I'm getting better! +CUSTOMER: No, you're not -- you'll be stone dead in a moment. +MORTICIAN: Oh, I can't take him like that -- it's against regulations. + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.341 b/7.4.341 new file mode 100644 index 0000000..061828a --- /dev/null +++ b/7.4.341 @@ -0,0 +1,178 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.341 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.341 +Problem: sort() doesn't handle numbers well. +Solution: Add an argument to specify sorting on numbers. (Christian Brabandt) +Files: runtime/doc/eval.txt, src/eval.c, src/testdir/test55.in, + src/testdir/test55.ok + + +*** ../vim-7.4.340/runtime/doc/eval.txt 2014-06-25 14:39:35.094348583 +0200 +--- runtime/doc/eval.txt 2014-06-25 17:05:50.606680574 +0200 +*************** +*** 5618,5628 **** + + If you want a list to remain unmodified make a copy first: > + :let sortedlist = sort(copy(mylist)) +- < Uses the string representation of each item to sort on. +- Numbers sort after Strings, |Lists| after Numbers. +- For sorting text in the current buffer use |:sort|. + +! When {func} is given and it is one then case is ignored. + When {func} is a |Funcref| or a function name, this function + is called to compare items. The function is invoked with two + items as argument and must return zero if they are equal, 1 or +--- 5628,5647 ---- + + If you want a list to remain unmodified make a copy first: > + :let sortedlist = sort(copy(mylist)) + +! < When {func} is omitted, is empty or zero, then sort() uses the +! string representation of each item to sort on. Numbers sort +! after Strings, |Lists| after Numbers. For sorting text in the +! current buffer use |:sort|. +! +! When {func} is given and it is is '1' or 'i' then case is +! ignored. +! +! When {func} is given and it is 'n' then all items will be +! sorted numerical (Implementation detail: This uses the +! strtod() function to parse numbers, Strings, Lists, Dicts and +! Funcrefs will be considered as being 0). +! + When {func} is a |Funcref| or a function name, this function + is called to compare items. The function is invoked with two + items as argument and must return zero if they are equal, 1 or +*** ../vim-7.4.340/src/eval.c 2014-06-17 17:48:21.776628008 +0200 +--- src/eval.c 2014-06-25 17:23:05.466719724 +0200 +*************** +*** 17330,17335 **** +--- 17330,17336 ---- + item_compare2 __ARGS((const void *s1, const void *s2)); + + static int item_compare_ic; ++ static int item_compare_numeric; + static char_u *item_compare_func; + static dict_T *item_compare_selfdict; + static int item_compare_func_err; +*************** +*** 17359,17368 **** + p1 = (char_u *)""; + if (p2 == NULL) + p2 = (char_u *)""; +! if (item_compare_ic) +! res = STRICMP(p1, p2); + else +! res = STRCMP(p1, p2); + vim_free(tofree1); + vim_free(tofree2); + return res; +--- 17360,17379 ---- + p1 = (char_u *)""; + if (p2 == NULL) + p2 = (char_u *)""; +! if (!item_compare_numeric) +! { +! if (item_compare_ic) +! res = STRICMP(p1, p2); +! else +! res = STRCMP(p1, p2); +! } + else +! { +! double n1, n2; +! n1 = strtod((char *)p1, (char **)&p1); +! n2 = strtod((char *)p2, (char **)&p2); +! res = n1 == n2 ? 0 : n1 > n2 ? 1 : -1; +! } + vim_free(tofree1); + vim_free(tofree2); + return res; +*************** +*** 17439,17444 **** +--- 17450,17456 ---- + return; /* short list sorts pretty quickly */ + + item_compare_ic = FALSE; ++ item_compare_numeric = FALSE; + item_compare_func = NULL; + item_compare_selfdict = NULL; + if (argvars[1].v_type != VAR_UNKNOWN) +*************** +*** 17457,17462 **** +--- 17469,17487 ---- + item_compare_ic = TRUE; + else + item_compare_func = get_tv_string(&argvars[1]); ++ if (item_compare_func != NULL) ++ { ++ if (STRCMP(item_compare_func, "n") == 0) ++ { ++ item_compare_func = NULL; ++ item_compare_numeric = TRUE; ++ } ++ else if (STRCMP(item_compare_func, "i") == 0) ++ { ++ item_compare_func = NULL; ++ item_compare_ic = TRUE; ++ } ++ } + } + + if (argvars[2].v_type != VAR_UNKNOWN) +*** ../vim-7.4.340/src/testdir/test55.in 2014-03-25 18:23:27.062087691 +0100 +--- src/testdir/test55.in 2014-06-25 17:20:47.006714486 +0200 +*************** +*** 332,337 **** +--- 332,342 ---- + :$put =string(reverse(sort(l))) + :$put =string(sort(reverse(sort(l)))) + :$put =string(uniq(sort(l))) ++ :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'foo', 'FOOBAR',{}, []] ++ :$put =string(sort(copy(l), 'n')) ++ :$put =string(sort(copy(l), 1)) ++ :$put =string(sort(copy(l), 'i')) ++ :$put =string(sort(copy(l))) + :" + :" splitting a string to a List + :$put =string(split(' aa bb ')) +*** ../vim-7.4.340/src/testdir/test55.ok 2014-03-25 18:23:27.062087691 +0100 +--- src/testdir/test55.ok 2014-06-25 17:23:31.382720704 +0200 +*************** +*** 101,106 **** +--- 101,110 ---- + [[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'] + ['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]] + ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]] ++ [-1, 0, 0, 'foo', 'FOOBAR', {}, [], 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255] ++ ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] ++ ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] ++ ['FOOBAR', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] + ['aa', 'bb'] + ['aa', 'bb'] + ['', 'aa', 'bb', ''] +*** ../vim-7.4.340/src/version.c 2014-06-25 15:02:29.250400570 +0200 +--- src/version.c 2014-06-25 16:46:45.438637250 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 341, + /**/ + +-- +We do not stumble over mountains, but over molehills. + Confucius + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.342 b/7.4.342 new file mode 100644 index 0000000..8bdc72e --- /dev/null +++ b/7.4.342 @@ -0,0 +1,67 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.342 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.342 +Problem: Clang gives warnings. +Solution: Add an else block. (Dominique Pelle) +Files: src/gui_beval.c + + +*** ../vim-7.4.341/src/gui_beval.c 2013-05-06 04:06:04.000000000 +0200 +--- src/gui_beval.c 2014-06-25 17:40:40.818759649 +0200 +*************** +*** 1193,1203 **** + XmFontList fl; + + fl = gui_motif_fontset2fontlist(&gui.tooltip_fontset); +! if (fl != NULL) + { +! XmStringExtent(fl, s, &w, &h); +! XmFontListFree(fl); + } + } + w += gui.border_offset << 1; + h += gui.border_offset << 1; +--- 1193,1205 ---- + XmFontList fl; + + fl = gui_motif_fontset2fontlist(&gui.tooltip_fontset); +! if (fl == NULL) + { +! XmStringFree(s); +! return; + } ++ XmStringExtent(fl, s, &w, &h); ++ XmFontListFree(fl); + } + w += gui.border_offset << 1; + h += gui.border_offset << 1; +*** ../vim-7.4.341/src/version.c 2014-06-25 17:31:04.942737863 +0200 +--- src/version.c 2014-06-25 17:40:56.902760258 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 342, + /**/ + +-- +CUSTOMER: Well, can you hang around a couple of minutes? He won't be + long. +MORTICIAN: Naaah, I got to go on to Robinson's -- they've lost nine today. +CUSTOMER: Well, when is your next round? +MORTICIAN: Thursday. +DEAD PERSON: I think I'll go for a walk. + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.343 b/7.4.343 new file mode 100644 index 0000000..141d981 --- /dev/null +++ b/7.4.343 @@ -0,0 +1,60 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.343 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.343 +Problem: matchdelete() does not always update the right lines. +Solution: Fix off-by-one error. (Ozaki Kiichi) +Files: src/window.c + + +*** ../vim-7.4.342/src/window.c 2014-06-18 21:20:07.236377308 +0200 +--- src/window.c 2014-06-25 17:55:34.190793447 +0200 +*************** +*** 6891,6898 **** + } + if (toplnum == 0 || lnum < toplnum) + toplnum = lnum; +! if (botlnum == 0 || lnum > botlnum) +! botlnum = lnum; + } + + /* Calculate top and bottom lines for redrawing area */ +--- 6891,6898 ---- + } + if (toplnum == 0 || lnum < toplnum) + toplnum = lnum; +! if (botlnum == 0 || lnum >= botlnum) +! botlnum = lnum + 1; + } + + /* Calculate top and bottom lines for redrawing area */ +*** ../vim-7.4.342/src/version.c 2014-06-25 17:44:45.850768919 +0200 +--- src/version.c 2014-06-25 17:54:14.258790423 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 343, + /**/ + +-- +CUSTOMER: You're not fooling anyone y'know. Look, isn't there something + you can do? +DEAD PERSON: I feel happy... I feel happy. + [whop] +CUSTOMER: Ah, thanks very much. +MORTICIAN: Not at all. See you on Thursday. +CUSTOMER: Right. + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.344 b/7.4.344 new file mode 100644 index 0000000..3b619e7 --- /dev/null +++ b/7.4.344 @@ -0,0 +1,180 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.344 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.344 +Problem: Unessecary initializations and other things related to + matchaddpos(). +Solution: Code cleanup. (Alexey Radkov) +Files: runtime/doc/eval.txt, src/screen.c, src/window.c + + +*** ../vim-7.4.343/runtime/doc/eval.txt 2014-06-25 17:31:04.934737863 +0200 +--- runtime/doc/eval.txt 2014-06-25 18:08:50.790823583 +0200 +*************** +*** 4353,4369 **** + required, for example to highlight matching parentheses. + + The list {pos} can contain one of these items: +! - A number. This while line will be highlighted. The first + line has number 1. + - A list with one number, e.g., [23]. The whole line with this + number will be highlighted. + - A list with two numbers, e.g., [23, 11]. The first number is +! the line number, the second one the column number (first +! column is 1). The character at this position will be +! highlighted. + - A list with three numbers, e.g., [23, 11, 3]. As above, but +! the third number gives the length of the highlight in screen +! cells. + + The maximum number of positions is 8. + +--- 4391,4407 ---- + required, for example to highlight matching parentheses. + + The list {pos} can contain one of these items: +! - A number. This whole line will be highlighted. The first + line has number 1. + - A list with one number, e.g., [23]. The whole line with this + number will be highlighted. + - A list with two numbers, e.g., [23, 11]. The first number is +! the line number, the second one is the column number (first +! column is 1, the value must correspond to the byte index as +! |col()| would return). The character at this position will +! be highlighted. + - A list with three numbers, e.g., [23, 11, 3]. As above, but +! the third number gives the length of the highlight in bytes. + + The maximum number of positions is 8. + +*** ../vim-7.4.343/src/screen.c 2014-06-25 14:39:35.110348584 +0200 +--- src/screen.c 2014-06-25 18:10:11.906826652 +0200 +*************** +*** 7531,7537 **** + colnr_T mincol; /* minimal column for a match */ + { + int i; +! int bot = -1; + + shl->lnum = 0; + for (i = posmatch->cur; i < MAXPOSMATCH; i++) +--- 7531,7537 ---- + colnr_T mincol; /* minimal column for a match */ + { + int i; +! int bot = -1; + + shl->lnum = 0; + for (i = posmatch->cur; i < MAXPOSMATCH; i++) +*** ../vim-7.4.343/src/window.c 2014-06-25 17:58:07.346799241 +0200 +--- src/window.c 2014-06-25 18:10:45.698827930 +0200 +*************** +*** 6813,6819 **** + m->id = id; + m->priority = prio; + m->pattern = pat == NULL ? NULL : vim_strsave(pat); +- m->pos.cur = 0; + m->hlg_id = hlg_id; + m->match.regprog = regprog; + m->match.rmm_ic = FALSE; +--- 6813,6818 ---- +*************** +*** 6827,6833 **** + listitem_T *li; + int i; + +! for (i = 0, li = pos_list->lv_first; i < MAXPOSMATCH; + i++, li = li->li_next) + { + linenr_T lnum = 0; +--- 6826,6832 ---- + listitem_T *li; + int i; + +! for (i = 0, li = pos_list->lv_first; li != NULL && i < MAXPOSMATCH; + i++, li = li->li_next) + { + linenr_T lnum = 0; +*************** +*** 6837,6847 **** + listitem_T *subli; + int error = FALSE; + +- if (li == NULL) +- { +- m->pos.pos[i].lnum = 0; +- break; +- } + if (li->li_tv.v_type == VAR_LIST) + { + subl = li->li_tv.vval.v_list; +--- 6836,6841 ---- +*************** +*** 6853,6864 **** + lnum = get_tv_number_chk(&subli->li_tv, &error); + if (error == TRUE) + goto fail; +- m->pos.pos[i].lnum = lnum; + if (lnum == 0) + { + --i; + continue; + } + subli = subli->li_next; + if (subli != NULL) + { +--- 6847,6858 ---- + lnum = get_tv_number_chk(&subli->li_tv, &error); + if (error == TRUE) + goto fail; + if (lnum == 0) + { + --i; + continue; + } ++ m->pos.pos[i].lnum = lnum; + subli = subli->li_next; + if (subli != NULL) + { +*************** +*** 6879,6885 **** +--- 6873,6882 ---- + else if (li->li_tv.v_type == VAR_NUMBER) + { + if (li->li_tv.vval.v_number == 0) ++ { ++ --i; + continue; ++ } + m->pos.pos[i].lnum = li->li_tv.vval.v_number; + m->pos.pos[i].col = 0; + m->pos.pos[i].len = 0; +*** ../vim-7.4.343/src/version.c 2014-06-25 17:58:07.346799241 +0200 +--- src/version.c 2014-06-25 18:07:06.170819625 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 344, + /**/ + +-- + [clop clop] +MORTICIAN: Who's that then? +CUSTOMER: I don't know. +MORTICIAN: Must be a king. +CUSTOMER: Why? +MORTICIAN: He hasn't got shit all over him. + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.345 b/7.4.345 new file mode 100644 index 0000000..7cac5f6 --- /dev/null +++ b/7.4.345 @@ -0,0 +1,73 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.345 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.345 (after 7.4.338) +Problem: Indent is not updated when deleting indent. +Solution: Remember changedtick. +Files: src/misc1.c + + +*** ../vim-7.4.344/src/misc1.c 2014-06-25 14:39:35.106348584 +0200 +--- src/misc1.c 2014-06-25 22:51:32.955465286 +0200 +*************** +*** 497,502 **** +--- 497,503 ---- + static int prev_indent = 0; /* cached indent value */ + static long prev_ts = 0L; /* cached tabstop value */ + static char_u *prev_line = NULL; /* cached pointer to line */ ++ static int prev_tick = 0; /* changedtick of cached value */ + int bri = 0; + /* window width minus window margin space, i.e. what rests for text */ + const int eff_wwidth = W_WIDTH(wp) +*************** +*** 505,514 **** + ? number_width(wp) + 1 : 0); + + /* used cached indent, unless pointer or 'tabstop' changed */ +! if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts) + { + prev_line = line; + prev_ts = wp->w_buffer->b_p_ts; + prev_indent = get_indent_str(line, + (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift; + } +--- 506,517 ---- + ? number_width(wp) + 1 : 0); + + /* used cached indent, unless pointer or 'tabstop' changed */ +! if (prev_line != line || prev_ts != wp->w_buffer->b_p_ts +! || prev_tick != wp->w_buffer->b_changedtick) + { + prev_line = line; + prev_ts = wp->w_buffer->b_p_ts; ++ prev_tick = wp->w_buffer->b_changedtick; + prev_indent = get_indent_str(line, + (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift; + } +*** ../vim-7.4.344/src/version.c 2014-06-25 18:15:18.446838249 +0200 +--- src/version.c 2014-06-25 22:52:55.971468427 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 345, + /**/ + +-- +ARTHUR: Well, I can't just call you `Man'. +DENNIS: Well, you could say `Dennis'. +ARTHUR: Well, I didn't know you were called `Dennis.' +DENNIS: Well, you didn't bother to find out, did you? + The Quest for the Holy Grail (Monty Python) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.346 b/7.4.346 new file mode 100644 index 0000000..a40278e --- /dev/null +++ b/7.4.346 @@ -0,0 +1,61 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.346 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.346 (after 7.4.338) +Problem: Indent is not updated when changing 'breakindentopt'. (itchyny) +Solution: Do not cache "brishift". (Christian Brabandt) +Files: src/misc1.c + + +*** ../vim-7.4.345/src/misc1.c 2014-06-25 22:55:34.783474435 +0200 +--- src/misc1.c 2014-06-26 21:15:46.970516542 +0200 +*************** +*** 513,523 **** + prev_ts = wp->w_buffer->b_p_ts; + prev_tick = wp->w_buffer->b_changedtick; + prev_indent = get_indent_str(line, +! (int)wp->w_buffer->b_p_ts, wp->w_p_list) + wp->w_p_brishift; + } + + /* indent minus the length of the showbreak string */ +- bri = prev_indent; + if (wp->w_p_brisbr) + bri -= vim_strsize(p_sbr); + +--- 513,523 ---- + prev_ts = wp->w_buffer->b_p_ts; + prev_tick = wp->w_buffer->b_changedtick; + prev_indent = get_indent_str(line, +! (int)wp->w_buffer->b_p_ts, wp->w_p_list); + } ++ bri = prev_indent + wp->w_p_brishift; + + /* indent minus the length of the showbreak string */ + if (wp->w_p_brisbr) + bri -= vim_strsize(p_sbr); + +*** ../vim-7.4.345/src/version.c 2014-06-25 22:55:34.783474435 +0200 +--- src/version.c 2014-06-26 21:17:10.342519697 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 346, + /**/ + +-- +A computer programmer is a device for turning requirements into +undocumented features. It runs on cola, pizza and Dilbert cartoons. + Bram Moolenaar + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.347 b/7.4.347 new file mode 100644 index 0000000..7b6b6dd --- /dev/null +++ b/7.4.347 @@ -0,0 +1,74 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.347 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.347 +Problem: test55 fails on some systems. +Solution: Remove the elements that all result in zero and can end up in an + arbitrary position. +Files: src/testdir/test55.in, src/testdir/test55.ok + + +*** ../vim-7.4.346/src/testdir/test55.in 2014-06-25 17:31:04.942737863 +0200 +--- src/testdir/test55.in 2014-06-26 22:25:33.078674909 +0200 +*************** +*** 332,339 **** + :$put =string(reverse(sort(l))) + :$put =string(sort(reverse(sort(l)))) + :$put =string(uniq(sort(l))) +! :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'foo', 'FOOBAR',{}, []] + :$put =string(sort(copy(l), 'n')) + :$put =string(sort(copy(l), 1)) + :$put =string(sort(copy(l), 'i')) + :$put =string(sort(copy(l))) +--- 332,340 ---- + :$put =string(reverse(sort(l))) + :$put =string(sort(reverse(sort(l)))) + :$put =string(uniq(sort(l))) +! :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0.22, 'foo'] + :$put =string(sort(copy(l), 'n')) ++ :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'foo', 'FOOBAR',{}, []] + :$put =string(sort(copy(l), 1)) + :$put =string(sort(copy(l), 'i')) + :$put =string(sort(copy(l))) +*** ../vim-7.4.346/src/testdir/test55.ok 2014-06-25 17:31:04.942737863 +0200 +--- src/testdir/test55.ok 2014-06-26 22:26:38.662677390 +0200 +*************** +*** 101,107 **** + [[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'] + ['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]] + ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]] +! [-1, 0, 0, 'foo', 'FOOBAR', {}, [], 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255] + ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] + ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] + ['FOOBAR', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] +--- 101,107 ---- + [[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'] + ['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]] + ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]] +! [-1, 'foo', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255] + ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] + ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] + ['FOOBAR', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] +*** ../vim-7.4.346/src/version.c 2014-06-26 21:24:53.134537205 +0200 +--- src/version.c 2014-06-26 22:28:15.402681050 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 347, + /**/ + +-- +Witches prefer brooms: vacuum-cleaners need extension cords! + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.348 b/7.4.348 new file mode 100644 index 0000000..c881719 --- /dev/null +++ b/7.4.348 @@ -0,0 +1,58 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.348 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.348 +Problem: When using "J1" in 'cinoptions' a line below a continuation line + gets too much indent. +Solution: Fix parenthesis in condition. +Files: src/misc1.c + + +*** ../vim-7.4.347/src/misc1.c 2014-06-26 21:24:53.134537205 +0200 +--- src/misc1.c 2014-07-02 16:58:08.854208322 +0200 +*************** +*** 7497,7505 **** + * ldfd) { + * } + */ +! if (curbuf->b_ind_js || (curbuf->b_ind_keep_case_label +! && cin_iscase(skipwhite(ml_get_curline()), FALSE))) + amount = get_indent(); + else + amount = skip_label(lnum, &l); + +--- 7497,7507 ---- + * ldfd) { + * } + */ +! if ((curbuf->b_ind_js || curbuf->b_ind_keep_case_label) +! && cin_iscase(skipwhite(ml_get_curline()), FALSE)) + amount = get_indent(); ++ else if (curbuf->b_ind_js) ++ amount = get_indent_lnum(lnum); + else + amount = skip_label(lnum, &l); + +*** ../vim-7.4.347/src/version.c 2014-06-26 22:33:47.850693627 +0200 +--- src/version.c 2014-07-02 16:46:14.934197383 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 348, + /**/ + +-- +5 out of 4 people have trouble with fractions. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.349 b/7.4.349 new file mode 100644 index 0000000..ce23202 --- /dev/null +++ b/7.4.349 @@ -0,0 +1,111 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.349 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.349 +Problem: When there are matches to highlight the whole window is redrawn, + which is slow. +Solution: Only redraw everything when lines were inserted or deleted. + Reset b_mod_xlines when needed. (Alexey Radkov) +Files: src/screen.c, src/window.c + + +*** ../vim-7.4.348/src/screen.c 2014-06-25 18:15:18.446838249 +0200 +--- src/screen.c 2014-06-28 15:35:18.868836570 +0200 +*************** +*** 1769,1776 **** + syntax_check_changed(lnum))) + #endif + #ifdef FEAT_SEARCH_EXTRA +! /* match in fixed position might need redraw */ +! || wp->w_match_head != NULL + #endif + ))))) + { +--- 1769,1778 ---- + syntax_check_changed(lnum))) + #endif + #ifdef FEAT_SEARCH_EXTRA +! /* match in fixed position might need redraw +! * if lines were inserted or deleted */ +! || (wp->w_match_head != NULL +! && buf->b_mod_xlines != 0) + #endif + ))))) + { +*** ../vim-7.4.348/src/window.c 2014-06-25 18:15:18.446838249 +0200 +--- src/window.c 2014-06-28 15:38:51.952839835 +0200 +*************** +*** 6904,6915 **** + } + else + { + wp->w_buffer->b_mod_top = toplnum; + wp->w_buffer->b_mod_bot = botlnum; + } + m->pos.toplnum = toplnum; + m->pos.botlnum = botlnum; +- wp->w_buffer->b_mod_set = TRUE; + rtype = VALID; + } + } +--- 6904,6916 ---- + } + else + { ++ wp->w_buffer->b_mod_set = TRUE; + wp->w_buffer->b_mod_top = toplnum; + wp->w_buffer->b_mod_bot = botlnum; ++ wp->w_buffer->b_mod_xlines = 0; + } + m->pos.toplnum = toplnum; + m->pos.botlnum = botlnum; + rtype = VALID; + } + } +*************** +*** 6986,6995 **** + } + else + { + wp->w_buffer->b_mod_top = cur->pos.toplnum; + wp->w_buffer->b_mod_bot = cur->pos.botlnum; + } +- wp->w_buffer->b_mod_set = TRUE; + rtype = VALID; + } + vim_free(cur); +--- 6987,6997 ---- + } + else + { ++ wp->w_buffer->b_mod_set = TRUE; + wp->w_buffer->b_mod_top = cur->pos.toplnum; + wp->w_buffer->b_mod_bot = cur->pos.botlnum; ++ wp->w_buffer->b_mod_xlines = 0; + } + rtype = VALID; + } + vim_free(cur); +*** ../vim-7.4.348/src/version.c 2014-07-02 17:02:29.726212319 +0200 +--- src/version.c 2014-07-02 17:15:58.646224714 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 349, + /**/ + +-- +Trees moving back and forth is what makes the wind blow. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.350 b/7.4.350 new file mode 100644 index 0000000..1c4a5a3 --- /dev/null +++ b/7.4.350 @@ -0,0 +1,139 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.350 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.350 +Problem: Using C indenting for Javascript does not work well for a {} block + inside parenthesis. +Solution: When looking for a matching paren ignore one that is before the + start of a {} block. +Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok + + +*** ../vim-7.4.349/src/misc1.c 2014-07-02 17:02:29.722212319 +0200 +--- src/misc1.c 2014-07-02 18:09:39.670274070 +0200 +*************** +*** 6614,6620 **** + } + + /* +! * Find the matching '(', failing if it is in a comment. + * Return NULL if no match found. + */ + static pos_T * +--- 6614,6620 ---- + } + + /* +! * Find the matching '(', ignoring it if it is in a comment. + * Return NULL if no match found. + */ + static pos_T * +*************** +*** 6645,6650 **** +--- 6645,6676 ---- + } + + /* ++ * Find the matching '(', ignoring it if it is in a comment or before an ++ * unmatched {. ++ * Return NULL if no match found. ++ */ ++ static pos_T * ++ find_match_paren_after_brace(ind_maxparen) /* XXX */ ++ int ind_maxparen; ++ { ++ pos_T *trypos = find_match_paren(ind_maxparen); ++ ++ if (trypos != NULL) ++ { ++ pos_T *tryposBrace = find_start_brace(); ++ ++ /* If both an unmatched '(' and '{' is found. Ignore the '(' ++ * position if the '{' is further down. */ ++ if (tryposBrace != NULL ++ && (trypos->lnum != tryposBrace->lnum ++ ? trypos->lnum < tryposBrace->lnum ++ : trypos->col < tryposBrace->col)) ++ trypos = NULL; ++ } ++ return trypos; ++ } ++ ++ /* + * Return ind_maxparen corrected for the difference in line number between the + * cursor position and "startpos". This makes sure that searching for a + * matching paren above the cursor line doesn't find a match because of +*************** +*** 7419,7425 **** + { + curwin->w_cursor.lnum = our_paren_pos.lnum; + curwin->w_cursor.col = col; +! if (find_match_paren(curbuf->b_ind_maxparen) != NULL) + amount += curbuf->b_ind_unclosed2; + else + { +--- 7445,7452 ---- + { + curwin->w_cursor.lnum = our_paren_pos.lnum; + curwin->w_cursor.col = col; +! if (find_match_paren_after_brace(curbuf->b_ind_maxparen) +! != NULL) + amount += curbuf->b_ind_unclosed2; + else + { +*** ../vim-7.4.349/src/testdir/test3.in 2013-03-07 12:39:35.000000000 +0100 +--- src/testdir/test3.in 2014-07-02 18:08:06.430272641 +0200 +*************** +*** 1950,1955 **** +--- 1950,1959 ---- + JSSTART + (function($){ + ++ if (cond && ++ cond) { ++ stmt; ++ } + var class_name='myclass'; + + function private_method() { +*** ../vim-7.4.349/src/testdir/test3.ok 2013-03-07 12:40:03.000000000 +0100 +--- src/testdir/test3.ok 2014-07-02 18:09:14.470273684 +0200 +*************** +*** 1728,1733 **** +--- 1728,1737 ---- + JSSTART + (function($){ + ++ if (cond && ++ cond) { ++ stmt; ++ } + var class_name='myclass'; + + function private_method() { +*** ../vim-7.4.349/src/version.c 2014-07-02 17:16:51.334225522 +0200 +--- src/version.c 2014-07-02 18:06:31.330271184 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 350, + /**/ + +-- +FATHER: You killed eight wedding guests in all! +LAUNCELOT: Er, Well ... the thing is ... I thought your son was a lady. +FATHER: I can understand that. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.351 b/7.4.351 new file mode 100644 index 0000000..0ace333 --- /dev/null +++ b/7.4.351 @@ -0,0 +1,160 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.351 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.351 +Problem: sort() is not stable. +Solution: When the items are identical, compare the pointers. +Files: src/eval.c, src/testdir/test55.in, src/testdir/test55.ok + + +*** ../vim-7.4.350/src/eval.c 2014-06-25 17:31:04.942737863 +0200 +--- src/eval.c 2014-07-02 18:52:19.102313288 +0200 +*************** +*** 17334,17339 **** +--- 17334,17340 ---- + static char_u *item_compare_func; + static dict_T *item_compare_selfdict; + static int item_compare_func_err; ++ static int item_compare_keep_zero; + static void do_sort_uniq __ARGS((typval_T *argvars, typval_T *rettv, int sort)); + #define ITEM_COMPARE_FAIL 999 + +*************** +*** 17374,17379 **** +--- 17375,17386 ---- + n2 = strtod((char *)p2, (char **)&p2); + res = n1 == n2 ? 0 : n1 > n2 ? 1 : -1; + } ++ ++ /* When the result would be zero, compare the pointers themselves. Makes ++ * the sort stable. */ ++ if (res == 0 && !item_compare_keep_zero) ++ res = s1 > s2 ? 1 : -1; ++ + vim_free(tofree1); + vim_free(tofree2); + return res; +*************** +*** 17396,17402 **** + if (item_compare_func_err) + return 0; + +! /* copy the values. This is needed to be able to set v_lock to VAR_FIXED + * in the copy without changing the original list items. */ + copy_tv(&(*(listitem_T **)s1)->li_tv, &argv[0]); + copy_tv(&(*(listitem_T **)s2)->li_tv, &argv[1]); +--- 17403,17409 ---- + if (item_compare_func_err) + return 0; + +! /* Copy the values. This is needed to be able to set v_lock to VAR_FIXED + * in the copy without changing the original list items. */ + copy_tv(&(*(listitem_T **)s1)->li_tv, &argv[0]); + copy_tv(&(*(listitem_T **)s2)->li_tv, &argv[1]); +*************** +*** 17415,17420 **** +--- 17422,17433 ---- + if (item_compare_func_err) + res = ITEM_COMPARE_FAIL; /* return value has wrong type */ + clear_tv(&rettv); ++ ++ /* When the result would be zero, compare the pointers themselves. Makes ++ * the sort stable. */ ++ if (res == 0 && !item_compare_keep_zero) ++ res = s1 > s2 ? 1 : -1; ++ + return res; + } + +*************** +*** 17509,17514 **** +--- 17522,17528 ---- + ptrs[i++] = li; + + item_compare_func_err = FALSE; ++ item_compare_keep_zero = FALSE; + /* test the compare function */ + if (item_compare_func != NULL + && item_compare2((void *)&ptrs[0], (void *)&ptrs[1]) +*************** +*** 17536,17541 **** +--- 17550,17556 ---- + + /* f_uniq(): ptrs will be a stack of items to remove */ + item_compare_func_err = FALSE; ++ item_compare_keep_zero = TRUE; + item_compare_func_ptr = item_compare_func + ? item_compare2 : item_compare; + +*** ../vim-7.4.350/src/testdir/test55.in 2014-06-26 22:33:47.850693627 +0200 +--- src/testdir/test55.in 2014-07-02 19:00:09.238320492 +0200 +*************** +*** 332,340 **** + :$put =string(reverse(sort(l))) + :$put =string(sort(reverse(sort(l)))) + :$put =string(uniq(sort(l))) +! :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0.22, 'foo'] + :$put =string(sort(copy(l), 'n')) +! :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'foo', 'FOOBAR',{}, []] + :$put =string(sort(copy(l), 1)) + :$put =string(sort(copy(l), 'i')) + :$put =string(sort(copy(l))) +--- 332,340 ---- + :$put =string(reverse(sort(l))) + :$put =string(sort(reverse(sort(l)))) + :$put =string(uniq(sort(l))) +! :let l=[7, 9, 'one', 18, 12, 22, 'two', 10.0e-16, -1, 'three', 0xff, 0.22, 'four'] + :$put =string(sort(copy(l), 'n')) +! :let l=[7, 9, 18, 12, 22, 10.0e-16, -1, 0xff, 0, -0, 0.22, 'bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', {}, []] + :$put =string(sort(copy(l), 1)) + :$put =string(sort(copy(l), 'i')) + :$put =string(sort(copy(l))) +*** ../vim-7.4.350/src/testdir/test55.ok 2014-06-26 22:33:47.850693627 +0200 +--- src/testdir/test55.ok 2014-07-02 19:00:57.078321225 +0200 +*************** +*** 101,110 **** + [[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'] + ['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]] + ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]] +! [-1, 'foo', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255] +! ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] +! ['foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] +! ['FOOBAR', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] + ['aa', 'bb'] + ['aa', 'bb'] + ['', 'aa', 'bb', ''] +--- 101,110 ---- + [[0, 1, 2], [0, 1, 2], 4, 2, 2, 1.5, 'xaaa', 'x8', 'foo6', 'foo', 'foo', 'A11', '-0'] + ['-0', 'A11', 'foo', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 2, 4, [0, 1, 2], [0, 1, 2]] + ['-0', 'A11', 'foo', 'foo6', 'x8', 'xaaa', 1.5, 2, 4, [0, 1, 2]] +! [-1, 'one', 'two', 'three', 'four', 1.0e-15, 0.22, 7, 9, 12, 18, 22, 255] +! ['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] +! ['bar', 'BAR', 'Bar', 'Foo', 'FOO', 'foo', 'FOOBAR', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] +! ['BAR', 'Bar', 'FOO', 'FOOBAR', 'Foo', 'bar', 'foo', -1, 0, 0, 0.22, 1.0e-15, 12, 18, 22, 255, 7, 9, [], {}] + ['aa', 'bb'] + ['aa', 'bb'] + ['', 'aa', 'bb', ''] +*** ../vim-7.4.350/src/version.c 2014-07-02 18:27:44.662290695 +0200 +--- src/version.c 2014-07-02 18:46:38.230308065 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 351, + /**/ + +-- +The early bird gets the worm. If you want something else for +breakfast, get up later. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.352 b/7.4.352 new file mode 100644 index 0000000..ecfabb3 --- /dev/null +++ b/7.4.352 @@ -0,0 +1,101 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.352 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.352 +Problem: With 'linebreak' a tab causes missing line break. +Solution: Count a tab for what it's worth also for shorter lines. + (Christian Brabandt) +Files: src/charset.c + + +*** ../vim-7.4.351/src/charset.c 2014-06-25 14:39:35.098348584 +0200 +--- src/charset.c 2014-07-02 19:34:28.142352040 +0200 +*************** +*** 1078,1083 **** +--- 1078,1084 ---- + int c; + int size; + colnr_T col2; ++ colnr_T col_adj = 0; /* col + screen size of tab */ + colnr_T colmax; + int added; + # ifdef FEAT_MBYTE +*************** +*** 1109,1114 **** +--- 1110,1117 ---- + */ + size = win_chartabsize(wp, s, col); + c = *s; ++ if (tab_corr) ++ col_adj = size - 1; + + /* + * If 'linebreak' set check at a blank before a non-blank if the line +*************** +*** 1130,1141 **** + */ + numberextra = win_col_off(wp); + col2 = col; +! colmax = (colnr_T)(W_WIDTH(wp) - numberextra); + if (col >= colmax) + { +! n = colmax + win_col_off2(wp); + if (n > 0) +! colmax += (((col - colmax) / n) + 1) * n; + } + + for (;;) +--- 1133,1145 ---- + */ + numberextra = win_col_off(wp); + col2 = col; +! colmax = (colnr_T)(W_WIDTH(wp) - numberextra - col_adj); + if (col >= colmax) + { +! colmax += col_adj; +! n = colmax + win_col_off2(wp); + if (n > 0) +! colmax += (((col - colmax) / n) + 1) * n - col_adj; + } + + for (;;) +*************** +*** 1152,1158 **** + col2 += win_chartabsize(wp, s, col2); + if (col2 >= colmax) /* doesn't fit */ + { +! size = colmax - col; + tab_corr = FALSE; + break; + } +--- 1156,1162 ---- + col2 += win_chartabsize(wp, s, col2); + if (col2 >= colmax) /* doesn't fit */ + { +! size = colmax - col + col_adj; + tab_corr = FALSE; + break; + } +*** ../vim-7.4.351/src/version.c 2014-07-02 19:06:14.686326091 +0200 +--- src/version.c 2014-07-02 19:32:50.218350540 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 352, + /**/ + +-- +The early bird gets the worm. The second mouse gets the cheese. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.353 b/7.4.353 new file mode 100644 index 0000000..a099d04 --- /dev/null +++ b/7.4.353 @@ -0,0 +1,446 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.353 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.353 +Problem: 'linebreak' doesn't work with the 'list' option. +Solution: Make it work. (Christian Brabandt) +Files: src/charset.c, src/screen.c, + src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, + src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms, src/testdir/Makefile, + src/testdir/test_listlbr.in, src/testdir/test_listlbr.ok + + +*** ../vim-7.4.352/src/charset.c 2014-07-02 19:37:38.462354956 +0200 +--- src/charset.c 2014-07-02 19:47:21.602363892 +0200 +*************** +*** 1120,1126 **** + if (wp->w_p_lbr + && vim_isbreak(c) + && !vim_isbreak(s[1]) +- && !wp->w_p_list + && wp->w_p_wrap + # ifdef FEAT_VERTSPLIT + && wp->w_width != 0 +--- 1120,1125 ---- +*** ../vim-7.4.352/src/screen.c 2014-07-02 17:16:51.330225522 +0200 +--- src/screen.c 2014-07-02 19:51:42.082367883 +0200 +*************** +*** 2843,2848 **** +--- 2843,2849 ---- + char_u extra[18]; /* "%ld" and 'fdc' must fit in here */ + int n_extra = 0; /* number of extra chars */ + char_u *p_extra = NULL; /* string of extra chars, plus NUL */ ++ char_u *p_extra_free = NULL; /* p_extra needs to be freed */ + int c_extra = NUL; /* extra chars, all the same */ + int extra_attr = 0; /* attributes when n_extra != 0 */ + static char_u *at_end_str = (char_u *)""; /* used for p_extra when +*************** +*** 4053,4058 **** +--- 4054,4064 ---- + } + else + { ++ if (p_extra_free != NULL) ++ { ++ vim_free(p_extra_free); ++ p_extra_free = NULL; ++ } + /* + * Get a character from the line itself. + */ +*************** +*** 4424,4431 **** + /* + * Found last space before word: check for line break. + */ +! if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr) +! && !wp->w_p_list) + { + char_u *p = ptr - ( + # ifdef FEAT_MBYTE +--- 4430,4436 ---- + /* + * Found last space before word: check for line break. + */ +! if (wp->w_p_lbr && vim_isbreak(c) && !vim_isbreak(*ptr)) + { + char_u *p = ptr - ( + # ifdef FEAT_MBYTE +*************** +*** 4433,4439 **** + # endif + 1); + /* TODO: is passing p for start of the line OK? */ +! n_extra = win_lbr_chartabsize(wp, p, p, (colnr_T)vcol, + NULL) - 1; + c_extra = ' '; + if (vim_iswhite(c)) +--- 4438,4444 ---- + # endif + 1); + /* TODO: is passing p for start of the line OK? */ +! n_extra = win_lbr_chartabsize(wp, line, p, (colnr_T)vcol, + NULL) - 1; + c_extra = ' '; + if (vim_iswhite(c)) +*************** +*** 4443,4449 **** + /* See "Tab alignment" below. */ + FIX_FOR_BOGUSCOLS; + #endif +! c = ' '; + } + } + #endif +--- 4448,4455 ---- + /* See "Tab alignment" below. */ + FIX_FOR_BOGUSCOLS; + #endif +! if (!wp->w_p_list) +! c = ' '; + } + } + #endif +*************** +*** 4483,4491 **** + */ + if (c == TAB && (!wp->w_p_list || lcs_tab1)) + { + /* tab amount depends on current column */ +! n_extra = (int)wp->w_buffer->b_p_ts + - vcol % (int)wp->w_buffer->b_p_ts - 1; + #ifdef FEAT_CONCEAL + /* Tab alignment should be identical regardless of + * 'conceallevel' value. So tab compensates of all +--- 4489,4538 ---- + */ + if (c == TAB && (!wp->w_p_list || lcs_tab1)) + { ++ int tab_len = 0; + /* tab amount depends on current column */ +! tab_len = (int)wp->w_buffer->b_p_ts + - vcol % (int)wp->w_buffer->b_p_ts - 1; ++ #ifdef FEAT_LINEBREAK ++ if (!wp->w_p_lbr) ++ #endif ++ /* tab amount depends on current column */ ++ n_extra = tab_len; ++ #ifdef FEAT_LINEBREAK ++ else ++ { ++ char_u *p; ++ int len = n_extra; ++ int i; ++ int saved_nextra = n_extra; ++ ++ /* if n_extra > 0, it gives the number of chars, to ++ * use for a tab, else we need to calculate the width ++ * for a tab */ ++ #ifdef FEAT_MBYTE ++ len = (tab_len * mb_char2len(lcs_tab2)); ++ if (n_extra > 0) ++ len += n_extra - tab_len; ++ #endif ++ c = lcs_tab1; ++ p = alloc((unsigned)(len + 1)); ++ vim_memset(p, ' ', len); ++ p[len] = NUL; ++ p_extra_free = p; ++ for (i = 0; i < tab_len; i++) ++ { ++ #ifdef FEAT_MBYTE ++ mb_char2bytes(lcs_tab2, p); ++ p += mb_char2len(lcs_tab2); ++ n_extra += mb_char2len(lcs_tab2) ++ - (saved_nextra > 0 ? 1 : 0); ++ #else ++ p[i] = lcs_tab2; ++ #endif ++ } ++ p_extra = p_extra_free; ++ } ++ #endif + #ifdef FEAT_CONCEAL + /* Tab alignment should be identical regardless of + * 'conceallevel' value. So tab compensates of all +*************** +*** 4501,4508 **** + if (wp->w_p_list) + { + c = lcs_tab1; +! c_extra = lcs_tab2; +! n_attr = n_extra + 1; + extra_attr = hl_attr(HLF_8); + saved_attr2 = char_attr; /* save current attr */ + #ifdef FEAT_MBYTE +--- 4548,4560 ---- + if (wp->w_p_list) + { + c = lcs_tab1; +! #ifdef FEAT_LINEBREAK +! if (wp->w_p_lbr) +! c_extra = NUL; /* using p_extra from above */ +! else +! #endif +! c_extra = lcs_tab2; +! n_attr = tab_len + 1; + extra_attr = hl_attr(HLF_8); + saved_attr2 = char_attr; /* save current attr */ + #ifdef FEAT_MBYTE +*************** +*** 4598,4606 **** + if ((dy_flags & DY_UHEX) && wp->w_p_rl) + rl_mirror(p_extra); /* reverse "<12>" */ + #endif +- n_extra = byte2cells(c) - 1; + c_extra = NUL; +! c = *p_extra++; + if (!attr_pri) + { + n_attr = n_extra + 1; +--- 4650,4674 ---- + if ((dy_flags & DY_UHEX) && wp->w_p_rl) + rl_mirror(p_extra); /* reverse "<12>" */ + #endif + c_extra = NUL; +! #ifdef FEAT_LINEBREAK +! if (wp->w_p_lbr) +! { +! char_u *p; +! +! c = *p_extra; +! p = alloc((unsigned)n_extra + 1); +! vim_memset(p, ' ', n_extra); +! STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1); +! p[n_extra] = NUL; +! p_extra_free = p_extra = p; +! } +! else +! #endif +! { +! n_extra = byte2cells(c) - 1; +! c = *p_extra++; +! } + if (!attr_pri) + { + n_attr = n_extra + 1; +*** ../vim-7.4.352/src/testdir/Make_amiga.mak 2014-06-25 14:39:35.110348584 +0200 +--- src/testdir/Make_amiga.mak 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 38,43 **** +--- 38,44 ---- + test104.out test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_breakindent.out \ ++ test_listlbr.out \ + test_eval.out \ + test_options.out + +*************** +*** 165,169 **** +--- 166,171 ---- + test107.out: test107.in + test_autoformat_join.out: test_autoformat_join.in + test_breakindent.out: test_breakindent.in ++ test_listlbr.out: test_listlbr.in + test_eval.out: test_eval.in + test_options.out: test_options.in +*** ../vim-7.4.352/src/testdir/Make_dos.mak 2014-06-25 14:39:35.110348584 +0200 +--- src/testdir/Make_dos.mak 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 37,42 **** +--- 37,43 ---- + test105.out test106.out test107.out\ + test_autoformat_join.out \ + test_breakindent.out \ ++ test_listlbr \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.352/src/testdir/Make_ming.mak 2014-06-25 14:39:35.110348584 +0200 +--- src/testdir/Make_ming.mak 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 57,62 **** +--- 57,63 ---- + test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_breakindent.out \ ++ test_listlbr.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.352/src/testdir/Make_os2.mak 2014-06-25 14:39:35.114348584 +0200 +--- src/testdir/Make_os2.mak 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 40,45 **** +--- 40,46 ---- + test_autoformat_join.out \ + test_eval.out \ + test_breakindent.out \ ++ test_listlbr.out \ + test_options.out + + .SUFFIXES: .in .out +*** ../vim-7.4.352/src/testdir/Make_vms.mms 2014-06-25 14:39:35.114348584 +0200 +--- src/testdir/Make_vms.mms 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 98,103 **** +--- 98,104 ---- + test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_breakindent.out \ ++ test_listlbr.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.352/src/testdir/Makefile 2014-06-25 14:39:35.114348584 +0200 +--- src/testdir/Makefile 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 35,40 **** +--- 35,41 ---- + test104.out test105.out test106.out test107.out \ + test_autoformat_join.out \ + test_breakindent.out \ ++ test_listlbr.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.352/src/testdir/test_listlbr.in 2014-07-02 19:58:25.642374067 +0200 +--- src/testdir/test_listlbr.in 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 0 **** +--- 1,62 ---- ++ Test for linebreak and list option ++ ++ STARTTEST ++ :so small.vim ++ :if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif ++ :10new|:vsp|:vert resize 20 ++ :put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \" ++ :norm! zt ++ :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap ++ :fu! ScreenChar(width) ++ : let c='' ++ : for j in range(1,4) ++ : for i in range(1,a:width) ++ : let c.=nr2char(screenchar(j, i)) ++ : endfor ++ : let c.="\n" ++ : endfor ++ : return c ++ :endfu ++ :fu! DoRecordScreen() ++ : wincmd l ++ : $put =printf(\"\n%s\", g:test) ++ : $put =g:line ++ : wincmd p ++ :endfu ++ :let g:test="Test 1: set linebreak" ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :let g:test="Test 2: set linebreak + set list" ++ :set linebreak list listchars= ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :let g:test ="Test 3: set linebreak + set list + fancy listchars" ++ :exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :let g:test ="Test 4: set linebreak nolist" ++ :set nolist linebreak ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :let g:test ="Test 5: set nolinebreak list" ++ :set list nolinebreak ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :let g:test ="Test 6: set linebreak with tab and 1 line as long as screen: should break!" ++ :set nolist linebreak ts=8 ++ :let line="1\t".repeat('a', winwidth(0)-2) ++ :$put =line ++ :$ ++ :norm! zt ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :%w! test.out ++ :qa! ++ ENDTEST ++ dummy text +*** ../vim-7.4.352/src/testdir/test_listlbr.ok 2014-07-02 19:58:25.646374067 +0200 +--- src/testdir/test_listlbr.ok 2014-07-02 19:47:21.610363892 +0200 +*************** +*** 0 **** +--- 1,39 ---- ++ ++ abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP ++ ++ Test 1: set linebreak ++ abcdef ++ +hijklmn ++ +pqrstuvwxyz 1060ABC ++ +DEFGHIJKLMNOP ++ ++ Test 2: set linebreak + set list ++ ^Iabcdef hijklmn^I ++ +pqrstuvwxyz 1060ABC ++ +DEFGHIJKLMNOP ++ ++ ++ Test 3: set linebreak + set list + fancy listchars ++ ▕———abcdef ++ +hijklmn▕——— ++ +pqrstuvwxyz␣1060ABC ++ +DEFGHIJKLMNOPˑ¶ ++ ++ Test 4: set linebreak nolist ++ abcdef ++ +hijklmn ++ +pqrstuvwxyz 1060ABC ++ +DEFGHIJKLMNOP ++ ++ Test 5: set nolinebreak list ++ ▕———abcdef hijklmn▕— ++ +pqrstuvwxyz␣1060ABC ++ +DEFGHIJKLMNOPˑ¶ ++ ¶ ++ 1 aaaaaaaaaaaaaaaaaa ++ ++ Test 6: set linebreak with tab and 1 line as long as screen: should break! ++ 1 ++ +aaaaaaaaaaaaaaaaaa ++ ~ ++ ~ +*** ../vim-7.4.352/src/version.c 2014-07-02 19:37:38.462354956 +0200 +--- src/version.c 2014-07-02 19:57:44.066373430 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 353, + /**/ + +-- +FATHER: You only killed the bride's father - that's all - +LAUNCELOT: Oh dear, I didn't really mean to... +FATHER: Didn't mean to? You put your sword right through his head! +LAUNCELOT: Gosh - Is he all right? + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.354 b/7.4.354 new file mode 100644 index 0000000..1bbcf6d --- /dev/null +++ b/7.4.354 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.354 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.354 +Problem: Compiler warning. +Solution: Change NUL to NULL. (Ken Takata) +Files: src/screen.c + + +*** ../vim-7.4.353/src/screen.c 2014-07-02 19:59:35.454375136 +0200 +--- src/screen.c 2014-07-03 14:08:03.579375847 +0200 +*************** +*** 3704,3710 **** + if (diff_hlf != (hlf_T)0) + char_attr = hl_attr(diff_hlf); + #endif +! p_extra = NUL; + c_extra = ' '; + n_extra = get_breakindent_win(wp, + ml_get_buf(wp->w_buffer, lnum, FALSE)); +--- 3704,3710 ---- + if (diff_hlf != (hlf_T)0) + char_attr = hl_attr(diff_hlf); + #endif +! p_extra = NULL; + c_extra = ' '; + n_extra = get_breakindent_win(wp, + ml_get_buf(wp->w_buffer, lnum, FALSE)); +*** ../vim-7.4.353/src/version.c 2014-07-02 19:59:35.454375136 +0200 +--- src/version.c 2014-07-03 14:08:38.875376388 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 354, + /**/ + +-- + [SIR LAUNCELOT runs back up the stairs, grabs a rope + of the wall and swings out over the heads of the CROWD in a + swashbuckling manner towards a large window. He stops just short + of the window and is left swing pathetically back and forth.] +LAUNCELOT: Excuse me ... could somebody give me a push ... + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.355 b/7.4.355 new file mode 100644 index 0000000..49d4276 --- /dev/null +++ b/7.4.355 @@ -0,0 +1,929 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.355 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.355 +Problem: Several problems with Javascript indenting. +Solution: Improve Javascript indenting. +Files: src/misc1.c + + +*** ../vim-7.4.354/src/misc1.c 2014-07-02 18:27:44.662290695 +0200 +--- src/misc1.c 2014-07-03 22:42:20.315848662 +0200 +*************** +*** 5382,5387 **** +--- 5382,5388 ---- + static char_u *cin_skipcomment __ARGS((char_u *)); + static int cin_nocode __ARGS((char_u *)); + static pos_T *find_line_comment __ARGS((void)); ++ static int cin_has_js_key __ARGS((char_u *text)); + static int cin_islabel_skip __ARGS((char_u **)); + static int cin_isdefault __ARGS((char_u *)); + static char_u *after_label __ARGS((char_u *l)); +*************** +*** 5410,5415 **** +--- 5411,5417 ---- + static int cin_skip2pos __ARGS((pos_T *trypos)); + static pos_T *find_start_brace __ARGS((void)); + static pos_T *find_match_paren __ARGS((int)); ++ static pos_T *find_match_char __ARGS((int c, int ind_maxparen)); + static int corr_ind_maxparen __ARGS((pos_T *startpos)); + static int find_last_paren __ARGS((char_u *l, int start, int end)); + static int find_match __ARGS((int lookfor, linenr_T ourscope)); +*************** +*** 5494,5500 **** +--- 5496,5533 ---- + } + + /* ++ * Return TRUE if "text" starts with "key:". ++ */ ++ static int ++ cin_has_js_key(text) ++ char_u *text; ++ { ++ char_u *s = skipwhite(text); ++ int quote = 0; ++ ++ if (*s == '\'' || *s == '"') ++ { ++ /* can be 'key': or "key": */ ++ quote = *s; ++ ++s; ++ } ++ if (!vim_isIDc(*s)) /* need at least one ID character */ ++ return FALSE; ++ ++ while (vim_isIDc(*s)) ++ ++s; ++ if (*s == quote) ++ ++s; ++ ++ s = cin_skipcomment(s); ++ ++ /* "::" is not a label, it's C++ */ ++ return (*s == ':' && s[1] != ':'); ++ } ++ ++ /* + * Check if string matches "label:"; move to character after ':' if true. ++ * "*s" must point to the start of the label, if there is one. + */ + static int + cin_islabel_skip(s) +*************** +*** 6621,6632 **** + find_match_paren(ind_maxparen) /* XXX */ + int ind_maxparen; + { + pos_T cursor_save; + pos_T *trypos; + static pos_T pos_copy; + + cursor_save = curwin->w_cursor; +! if ((trypos = findmatchlimit(NULL, '(', 0, ind_maxparen)) != NULL) + { + /* check if the ( is in a // comment */ + if ((colnr_T)cin_skip2pos(trypos) > trypos->col) +--- 6654,6673 ---- + find_match_paren(ind_maxparen) /* XXX */ + int ind_maxparen; + { ++ return find_match_char('(', ind_maxparen); ++ } ++ ++ static pos_T * ++ find_match_char(c, ind_maxparen) /* XXX */ ++ int c; ++ int ind_maxparen; ++ { + pos_T cursor_save; + pos_T *trypos; + static pos_T pos_copy; + + cursor_save = curwin->w_cursor; +! if ((trypos = findmatchlimit(NULL, c, 0, ind_maxparen)) != NULL) + { + /* check if the ( is in a // comment */ + if ((colnr_T)cin_skip2pos(trypos) > trypos->col) +*************** +*** 6976,6981 **** +--- 7017,7024 ---- + #define LOOKFOR_NOBREAK 8 + #define LOOKFOR_CPP_BASECLASS 9 + #define LOOKFOR_ENUM_OR_INIT 10 ++ #define LOOKFOR_JS_KEY 11 ++ #define LOOKFOR_NO_COMMA 12 + + int whilelevel; + linenr_T lnum; +*************** +*** 6986,6991 **** +--- 7029,7035 ---- + int cont_amount = 0; /* amount for continuation line */ + int original_line_islabel; + int added_to_amount = 0; ++ int js_cur_has_key = 0; + + /* make a copy, value is changed below */ + int ind_continuation = curbuf->b_ind_continuation; +*************** +*** 7209,7214 **** +--- 7253,7268 ---- + } + + /* ++ * Are we looking at a ']' that has a match? ++ */ ++ else if (*skipwhite(theline) == ']' ++ && (trypos = find_match_char('[', curbuf->b_ind_maxparen)) != NULL) ++ { ++ /* align with the line containing the '['. */ ++ amount = get_indent_lnum(trypos->lnum); ++ } ++ ++ /* + * Are we inside parentheses or braces? + */ /* XXX */ + else if (((trypos = find_match_paren(curbuf->b_ind_maxparen)) != NULL +*************** +*** 7473,7486 **** + if (cin_iscomment(theline)) + amount += curbuf->b_ind_comment; + } +- +- /* +- * Are we at least inside braces, then? +- */ + else + { + trypos = tryposBrace; +- + ourscope = trypos->lnum; + start = ml_get(ourscope); + +--- 7527,7539 ---- + if (cin_iscomment(theline)) + amount += curbuf->b_ind_comment; + } + else + { ++ /* ++ * We are inside braces, there is a { before this line at the position ++ * stored in tryposBrace. ++ */ + trypos = tryposBrace; + ourscope = trypos->lnum; + start = ml_get(ourscope); + +*************** +*** 7502,7525 **** + } + else + { +! /* +! * that opening brace might have been on a continuation +! * line. if so, find the start of the line. +! */ + curwin->w_cursor.lnum = ourscope; + +! /* +! * position the cursor over the rightmost paren, so that +! * matching it will take us back to the start of the line. +! */ + lnum = ourscope; + if (find_last_paren(start, '(', ')') + && (trypos = find_match_paren(curbuf->b_ind_maxparen)) + != NULL) + lnum = trypos->lnum; + +! /* +! * It could have been something like + * case 1: if (asdf && + * ldfd) { + * } +--- 7555,7573 ---- + } + else + { +! /* That opening brace might have been on a continuation +! * line. if so, find the start of the line. */ + curwin->w_cursor.lnum = ourscope; + +! /* Position the cursor over the rightmost paren, so that +! * matching it will take us back to the start of the line. */ + lnum = ourscope; + if (find_last_paren(start, '(', ')') + && (trypos = find_match_paren(curbuf->b_ind_maxparen)) + != NULL) + lnum = trypos->lnum; + +! /* It could have been something like + * case 1: if (asdf && + * ldfd) { + * } +*************** +*** 7535,7542 **** + start_brace = BRACE_AT_END; + } + + /* +! * if we're looking at a closing brace, that's where + * we want to be. otherwise, add the amount of room + * that an indent is supposed to be. + */ +--- 7583,7594 ---- + start_brace = BRACE_AT_END; + } + ++ /* For Javascript check if the line starts with "key:". */ ++ if (curbuf->b_ind_js) ++ js_cur_has_key = cin_has_js_key(theline); ++ + /* +! * If we're looking at a closing brace, that's where + * we want to be. otherwise, add the amount of room + * that an indent is supposed to be. + */ +*************** +*** 7643,7649 **** + * Search backwards. If we find something we recognize, line up + * with that. + * +! * if we're looking at an open brace, indent + * the usual amount relative to the conditional + * that opens the block. + */ +--- 7695,7701 ---- + * Search backwards. If we find something we recognize, line up + * with that. + * +! * If we're looking at an open brace, indent + * the usual amount relative to the conditional + * that opens the block. + */ +*************** +*** 8051,8056 **** +--- 8103,8143 ---- + */ + terminated = cin_isterminated(l, FALSE, TRUE); + ++ if (js_cur_has_key) ++ { ++ js_cur_has_key = 0; /* only check the first line */ ++ if (curbuf->b_ind_js && terminated == ',') ++ { ++ /* For Javascript we might be inside an object: ++ * key: something, <- align with this ++ * key: something ++ * or: ++ * key: something + <- align with this ++ * something, ++ * key: something ++ */ ++ lookfor = LOOKFOR_JS_KEY; ++ } ++ } ++ if (lookfor == LOOKFOR_JS_KEY && cin_has_js_key(l)) ++ { ++ amount = get_indent(); ++ break; ++ } ++ if (lookfor == LOOKFOR_NO_COMMA) ++ { ++ if (terminated != ',') ++ /* line below current line is the one that starts a ++ * (possibly broken) line ending in a comma. */ ++ break; ++ amount = get_indent(); ++ if (curwin->w_cursor.lnum - 1 == ourscope) ++ /* line above is start of the scope, thus current line ++ * is the one that stars a (possibly broken) line ++ * ending in a comma. */ ++ break; ++ } ++ + if (terminated == 0 || (lookfor != LOOKFOR_UNTERM + && terminated == ',')) + { +*************** +*** 8062,8072 **** + * bar ) + */ + /* +! * position the cursor over the rightmost paren, so that + * matching it will take us back to the start of the line. + */ + (void)find_last_paren(l, '(', ')'); + trypos = find_match_paren(corr_ind_maxparen(&cur_curpos)); + + /* + * If we are looking for ',', we also look for matching +--- 8149,8164 ---- + * bar ) + */ + /* +! * Position the cursor over the rightmost paren, so that + * matching it will take us back to the start of the line. ++ * Ignore a match before the start of the block. + */ + (void)find_last_paren(l, '(', ')'); + trypos = find_match_paren(corr_ind_maxparen(&cur_curpos)); ++ if (trypos != NULL && (trypos->lnum < tryposBrace->lnum ++ || (trypos->lnum == tryposBrace->lnum ++ && trypos->col < tryposBrace->col))) ++ trypos = NULL; + + /* + * If we are looking for ',', we also look for matching +*************** +*** 8117,8126 **** + * Get indent and pointer to text for current line, + * ignoring any jump label. XXX + */ +! if (!curbuf->b_ind_js) +! cur_amount = skip_label(curwin->w_cursor.lnum, &l); +! else + cur_amount = get_indent(); + /* + * If this is just above the line we are indenting, and it + * starts with a '{', line it up with this line. +--- 8209,8218 ---- + * Get indent and pointer to text for current line, + * ignoring any jump label. XXX + */ +! if (curbuf->b_ind_js) + cur_amount = get_indent(); ++ else ++ cur_amount = skip_label(curwin->w_cursor.lnum, &l); + /* + * If this is just above the line we are indenting, and it + * starts with a '{', line it up with this line. +*************** +*** 8142,8148 **** + if (*skipwhite(l) != '{') + amount += curbuf->b_ind_open_extra; + +! if (curbuf->b_ind_cpp_baseclass) + { + /* have to look back, whether it is a cpp base + * class declaration or initialization */ +--- 8234,8240 ---- + if (*skipwhite(l) != '{') + amount += curbuf->b_ind_open_extra; + +! if (curbuf->b_ind_cpp_baseclass && !curbuf->b_ind_js) + { + /* have to look back, whether it is a cpp base + * class declaration or initialization */ +*************** +*** 8302,8309 **** + */ + if (lookfor == LOOKFOR_INITIAL && terminated == ',') + { +! lookfor = LOOKFOR_ENUM_OR_INIT; +! cont_amount = cin_first_id_amount(); + } + else + { +--- 8394,8434 ---- + */ + if (lookfor == LOOKFOR_INITIAL && terminated == ',') + { +! if (curbuf->b_ind_js) +! { +! /* Search for a line ending in a comma +! * and line up with the line below it +! * (could be the current line). +! * some = [ +! * 1, <- line up here +! * 2, +! * some = [ +! * 3 + <- line up here +! * 4 * +! * 5, +! * 6, +! */ +! lookfor = LOOKFOR_NO_COMMA; +! amount = get_indent(); /* XXX */ +! trypos = find_match_char('[', +! curbuf->b_ind_maxparen); +! if (trypos != NULL) +! { +! if (trypos->lnum +! == curwin->w_cursor.lnum - 1) +! { +! /* Current line is first inside +! * [], line up with it. */ +! break; +! } +! ourscope = trypos->lnum; +! } +! } +! else +! { +! lookfor = LOOKFOR_ENUM_OR_INIT; +! cont_amount = cin_first_id_amount(); +! } + } + else + { +*************** +*** 8313,8319 **** + /* XXX */ + cont_amount = cin_get_equal_amount( + curwin->w_cursor.lnum); +! if (lookfor != LOOKFOR_TERM) + lookfor = LOOKFOR_UNTERM; + } + } +--- 8438,8445 ---- + /* XXX */ + cont_amount = cin_get_equal_amount( + curwin->w_cursor.lnum); +! if (lookfor != LOOKFOR_TERM +! && lookfor != LOOKFOR_JS_KEY) + lookfor = LOOKFOR_UNTERM; + } + } +*************** +*** 8324,8331 **** + * Check if we are after a while (cond); + * If so: Ignore until the matching "do". + */ +! /* XXX */ +! else if (cin_iswhileofdo_end(terminated)) + { + /* + * Found an unterminated line after a while ();, line up +--- 8450,8456 ---- + * Check if we are after a while (cond); + * If so: Ignore until the matching "do". + */ +! else if (cin_iswhileofdo_end(terminated)) /* XXX */ + { + /* + * Found an unterminated line after a while ();, line up +*************** +*** 8538,8555 **** + if (curbuf->b_ind_jump_label > 0 && original_line_islabel) + amount -= curbuf->b_ind_jump_label; + } +- +- /* +- * ok -- we're not inside any sort of structure at all! +- * +- * this means we're at the top level, and everything should +- * basically just match where the previous line is, except +- * for the lines immediately following a function declaration, +- * which are K&R-style parameters and need to be indented. +- */ + else + { + /* + * if our line starts with an open brace, forget about any + * prevailing indent and make sure it looks like the start + * of a function +--- 8663,8678 ---- + if (curbuf->b_ind_jump_label > 0 && original_line_islabel) + amount -= curbuf->b_ind_jump_label; + } + else + { + /* ++ * ok -- we're not inside any sort of structure at all! ++ * ++ * This means we're at the top level, and everything should ++ * basically just match where the previous line is, except ++ * for the lines immediately following a function declaration, ++ * which are K&R-style parameters and need to be indented. ++ * + * if our line starts with an open brace, forget about any + * prevailing indent and make sure it looks like the start + * of a function +*************** +*** 8700,8705 **** +--- 8823,8840 ---- + break; + + /* ++ * If the previous line ends on '[' we are probably in an ++ * array constant: ++ * something = [ ++ * 234, <- extra indent ++ */ ++ if (cin_ends_in(l, (char_u *)"[", NULL)) ++ { ++ amount = get_indent() + ind_continuation; ++ break; ++ } ++ ++ /* + * Find a line only has a semicolon that belongs to a previous + * line ending in '}', e.g. before an #endif. Don't increase + * indent then. +*** ../vim-7.4.354/src/testdir/test3.in 2014-07-02 18:27:44.662290695 +0200 +--- src/testdir/test3.in 2014-07-03 22:41:38.743848025 +0200 +*************** +*** 1432,1438 **** + + STARTTEST + :set cino=(0,ts +! 2kdd=][ + ENDTEST + + void func(int a +--- 1432,1438 ---- + + STARTTEST + :set cino=(0,ts +! 2kdd2j=][ + ENDTEST + + void func(int a +*************** +*** 1446,1452 **** + + STARTTEST + :set cino=(0 +! 2kdd=][ + ENDTEST + + void +--- 1446,1452 ---- + + STARTTEST + :set cino=(0 +! 2kdd2j=][ + ENDTEST + + void +*************** +*** 1461,1467 **** + + STARTTEST + :set cino& +! 2kdd=7][ + ENDTEST + + void func(void) +--- 1461,1467 ---- + + STARTTEST + :set cino& +! 2kdd2j=7][ + ENDTEST + + void func(void) +*************** +*** 1538,1544 **** + STARTTEST + :set cino& + :set cino+=l1 +! 2kdd=][ + ENDTEST + + void func(void) +--- 1538,1544 ---- + STARTTEST + :set cino& + :set cino+=l1 +! 2kdd2j=][ + ENDTEST + + void func(void) +*************** +*** 1567,1573 **** + + STARTTEST + :set cino& +! 2kdd=][ + ENDTEST + + void func(void) +--- 1567,1573 ---- + + STARTTEST + :set cino& +! 2kdd2j=][ + ENDTEST + + void func(void) +*************** +*** 1592,1598 **** + + STARTTEST + :set cino& +! 2kdd=][ + ENDTEST + + void func(void) +--- 1592,1598 ---- + + STARTTEST + :set cino& +! 2kdd2j=][ + ENDTEST + + void func(void) +*************** +*** 1919,1928 **** + + JSSTART + var foo = [ +! 1, // indent 8 more + 2, + 3 +! ]; // indent 8 less + JSEND + + STARTTEST +--- 1919,1928 ---- + + JSSTART + var foo = [ +! 1, + 2, + 3 +! ]; + JSEND + + STARTTEST +*************** +*** 1937,1943 **** + 1, + 2, + 3 +! ]; // indent 16 less + } + JSEND + +--- 1937,1943 ---- + 1, + 2, + 3 +! ]; + } + JSEND + +*************** +*** 1954,1959 **** +--- 1954,1961 ---- + cond) { + stmt; + } ++ window.something.left = ++ (width - 50 + offset) + "px"; + var class_name='myclass'; + + function private_method() { +*************** +*** 1969,1983 **** + + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, // indent 8 more +! foobar: [ // indent 8 more +! 1, // indent 8 more +! 2, // indent 16 more +! 3 // indent 16 more + ], +! callback: function(){ // indent 8 more +! return true; // indent 8 more +! } // indent 8 more + }, options||{})); + } + +--- 1971,1985 ---- + + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, +! foobar: [ +! 1, +! 2, +! 3 + ], +! callback: function(){ +! return true; +! } + }, options||{})); + } + +*************** +*** 2018,2026 **** + foo: 'bar', + bar: 2, + foobar: [ +! 1, // indent 8 more +! 2, // indent 8 more +! 3 // indent 8 more + ], + callback: function(){ + return true; +--- 2020,2028 ---- + foo: 'bar', + bar: 2, + foobar: [ +! 1, +! 2, +! 3 + ], + callback: function(){ + return true; +*************** +*** 2040,2054 **** + function init(options) { + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, // indent 8 more +! foobar: [ // indent 8 more +! 1, // indent 8 more +! 2, // indent 16 more +! 3 // indent 16 more + ], +! callback: function(){ // indent 8 more +! return true; // indent 8 more +! } // indent 8 more + }, options||{})); + } + })(jQuery); +--- 2042,2056 ---- + function init(options) { + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, +! foobar: [ +! 1, +! 2, +! 3 + ], +! callback: function(){ +! return true; +! } + }, options||{})); + } + })(jQuery); +*** ../vim-7.4.354/src/testdir/test3.ok 2014-07-02 18:27:44.662290695 +0200 +--- src/testdir/test3.ok 2014-07-03 22:18:58.167827177 +0200 +*************** +*** 1707,1716 **** + + JSSTART + var foo = [ +! 1, // indent 8 more + 2, + 3 +! ]; // indent 8 less + JSEND + + +--- 1707,1716 ---- + + JSSTART + var foo = [ +! 1, + 2, + 3 +! ]; + JSEND + + +*************** +*** 1720,1726 **** + 1, + 2, + 3 +! ]; // indent 16 less + } + JSEND + +--- 1720,1726 ---- + 1, + 2, + 3 +! ]; + } + JSEND + +*************** +*** 1732,1737 **** +--- 1732,1739 ---- + cond) { + stmt; + } ++ window.something.left = ++ (width - 50 + offset) + "px"; + var class_name='myclass'; + + function private_method() { +*************** +*** 1747,1761 **** + + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, // indent 8 more +! foobar: [ // indent 8 more +! 1, // indent 8 more +! 2, // indent 16 more +! 3 // indent 16 more + ], +! callback: function(){ // indent 8 more +! return true; // indent 8 more +! } // indent 8 more + }, options||{})); + } + +--- 1749,1763 ---- + + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, +! foobar: [ +! 1, +! 2, +! 3 + ], +! callback: function(){ +! return true; +! } + }, options||{})); + } + +*************** +*** 1791,1799 **** + foo: 'bar', + bar: 2, + foobar: [ +! 1, // indent 8 more +! 2, // indent 8 more +! 3 // indent 8 more + ], + callback: function(){ + return true; +--- 1793,1801 ---- + foo: 'bar', + bar: 2, + foobar: [ +! 1, +! 2, +! 3 + ], + callback: function(){ + return true; +*************** +*** 1808,1822 **** + function init(options) { + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, // indent 8 more +! foobar: [ // indent 8 more +! 1, // indent 8 more +! 2, // indent 16 more +! 3 // indent 16 more + ], +! callback: function(){ // indent 8 more +! return true; // indent 8 more +! } // indent 8 more + }, options||{})); + } + })(jQuery); +--- 1810,1824 ---- + function init(options) { + $(this).data(class_name+'_public',$.extend({},{ + foo: 'bar', +! bar: 2, +! foobar: [ +! 1, +! 2, +! 3 + ], +! callback: function(){ +! return true; +! } + }, options||{})); + } + })(jQuery); +*** ../vim-7.4.354/src/version.c 2014-07-03 22:54:04.911859458 +0200 +--- src/version.c 2014-07-03 22:54:40.971860011 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 355, + /**/ + +-- +MESKIMEN'S LAW + There's never time to do it right, but always time to do it over. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.356 b/7.4.356 new file mode 100644 index 0000000..58af038 --- /dev/null +++ b/7.4.356 @@ -0,0 +1,38 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.356 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.356 +Problem: Mercurial does not ignore memfile_test. (Daniel Hahler) +Solution: Add memfile_test to ignored files, remove trailing spaces. +Files: .hgignore + + +Note: This patch was made empty, because .hgignore is not part of the +distributed files. + + +*** ../vim-7.4.355/src/version.c 2014-07-03 22:57:51.299862927 +0200 +--- src/version.c 2014-07-09 13:41:39.855060005 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 356, + /**/ + +-- +In Africa some of the native tribes have a custom of beating the ground +with clubs and uttering spine chilling cries. Anthropologists call +this a form of primitive self-expression. In America we call it golf. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.357 b/7.4.357 new file mode 100644 index 0000000..e1d638f --- /dev/null +++ b/7.4.357 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.357 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.357 +Problem: After completion some characters are not redrawn. +Solution: Clear the command line unconditionally. (Jacob Niehus) +Files: src/edit.c + + +*** ../vim-7.4.356/src/edit.c 2014-06-25 14:39:35.102348584 +0200 +--- src/edit.c 2014-07-09 13:22:22.747075922 +0200 +*************** +*** 3854,3861 **** + ins_compl_free(); + compl_started = FALSE; + compl_matches = 0; +! if (!shortmess(SHM_COMPLETIONMENU)) +! msg_clr_cmdline(); /* necessary for "noshowmode" */ + ctrl_x_mode = 0; + compl_enter_selects = FALSE; + if (edit_submode != NULL) +--- 3854,3860 ---- + ins_compl_free(); + compl_started = FALSE; + compl_matches = 0; +! msg_clr_cmdline(); /* necessary for "noshowmode" */ + ctrl_x_mode = 0; + compl_enter_selects = FALSE; + if (edit_submode != NULL) +*** ../vim-7.4.356/src/version.c 2014-07-09 13:43:18.399058649 +0200 +--- src/version.c 2014-07-09 13:58:35.483046034 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 357, + /**/ + +-- +Why isn't there mouse-flavored cat food? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.358 b/7.4.358 new file mode 100644 index 0000000..a36803d --- /dev/null +++ b/7.4.358 @@ -0,0 +1,290 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.358 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.358 (after 7.4.351) +Problem: Sort is not always stable. +Solution: Add an index instead of relying on the pointer to remain the same. + Idea by Jun Takimoto. +Files: src/eval.c + + +*** ../vim-7.4.357/src/eval.c 2014-07-02 19:06:14.686326091 +0200 +--- src/eval.c 2014-07-09 17:42:05.699813489 +0200 +*************** +*** 17329,17334 **** +--- 17329,17341 ---- + #endif + item_compare2 __ARGS((const void *s1, const void *s2)); + ++ /* struct used in the array that's given to qsort() */ ++ typedef struct ++ { ++ listitem_T *item; ++ int idx; ++ } sortItem_T; ++ + static int item_compare_ic; + static int item_compare_numeric; + static char_u *item_compare_func; +*************** +*** 17349,17362 **** + const void *s1; + const void *s2; + { + char_u *p1, *p2; + char_u *tofree1, *tofree2; + int res; + char_u numbuf1[NUMBUFLEN]; + char_u numbuf2[NUMBUFLEN]; + +! p1 = tv2string(&(*(listitem_T **)s1)->li_tv, &tofree1, numbuf1, 0); +! p2 = tv2string(&(*(listitem_T **)s2)->li_tv, &tofree2, numbuf2, 0); + if (p1 == NULL) + p1 = (char_u *)""; + if (p2 == NULL) +--- 17356,17372 ---- + const void *s1; + const void *s2; + { ++ sortItem_T *si1, *si2; + char_u *p1, *p2; + char_u *tofree1, *tofree2; + int res; + char_u numbuf1[NUMBUFLEN]; + char_u numbuf2[NUMBUFLEN]; + +! si1 = (sortItem_T *)s1; +! si2 = (sortItem_T *)s2; +! p1 = tv2string(&si1->item->li_tv, &tofree1, numbuf1, 0); +! p2 = tv2string(&si2->item->li_tv, &tofree2, numbuf2, 0); + if (p1 == NULL) + p1 = (char_u *)""; + if (p2 == NULL) +*************** +*** 17379,17385 **** + /* When the result would be zero, compare the pointers themselves. Makes + * the sort stable. */ + if (res == 0 && !item_compare_keep_zero) +! res = s1 > s2 ? 1 : -1; + + vim_free(tofree1); + vim_free(tofree2); +--- 17389,17395 ---- + /* When the result would be zero, compare the pointers themselves. Makes + * the sort stable. */ + if (res == 0 && !item_compare_keep_zero) +! res = si1->idx > si2->idx ? 1 : -1; + + vim_free(tofree1); + vim_free(tofree2); +*************** +*** 17394,17399 **** +--- 17404,17410 ---- + const void *s1; + const void *s2; + { ++ sortItem_T *si1, *si2; + int res; + typval_T rettv; + typval_T argv[3]; +*************** +*** 17403,17412 **** + if (item_compare_func_err) + return 0; + + /* Copy the values. This is needed to be able to set v_lock to VAR_FIXED + * in the copy without changing the original list items. */ +! copy_tv(&(*(listitem_T **)s1)->li_tv, &argv[0]); +! copy_tv(&(*(listitem_T **)s2)->li_tv, &argv[1]); + + rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ + res = call_func(item_compare_func, (int)STRLEN(item_compare_func), +--- 17414,17426 ---- + if (item_compare_func_err) + return 0; + ++ si1 = (sortItem_T *)s1; ++ si2 = (sortItem_T *)s2; ++ + /* Copy the values. This is needed to be able to set v_lock to VAR_FIXED + * in the copy without changing the original list items. */ +! copy_tv(&si1->item->li_tv, &argv[0]); +! copy_tv(&si2->item->li_tv, &argv[1]); + + rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ + res = call_func(item_compare_func, (int)STRLEN(item_compare_func), +*************** +*** 17426,17432 **** + /* When the result would be zero, compare the pointers themselves. Makes + * the sort stable. */ + if (res == 0 && !item_compare_keep_zero) +! res = s1 > s2 ? 1 : -1; + + return res; + } +--- 17440,17446 ---- + /* When the result would be zero, compare the pointers themselves. Makes + * the sort stable. */ + if (res == 0 && !item_compare_keep_zero) +! res = si1->idx > si2->idx ? 1 : -1; + + return res; + } +*************** +*** 17442,17448 **** + { + list_T *l; + listitem_T *li; +! listitem_T **ptrs; + long len; + long i; + +--- 17456,17462 ---- + { + list_T *l; + listitem_T *li; +! sortItem_T *ptrs; + long len; + long i; + +*************** +*** 17510,17516 **** + } + + /* Make an array with each entry pointing to an item in the List. */ +! ptrs = (listitem_T **)alloc((int)(len * sizeof(listitem_T *))); + if (ptrs == NULL) + return; + +--- 17524,17530 ---- + } + + /* Make an array with each entry pointing to an item in the List. */ +! ptrs = (sortItem_T *)alloc((int)(len * sizeof(sortItem_T))); + if (ptrs == NULL) + return; + +*************** +*** 17519,17525 **** + { + /* sort(): ptrs will be the list to sort */ + for (li = l->lv_first; li != NULL; li = li->li_next) +! ptrs[i++] = li; + + item_compare_func_err = FALSE; + item_compare_keep_zero = FALSE; +--- 17533,17543 ---- + { + /* sort(): ptrs will be the list to sort */ + for (li = l->lv_first; li != NULL; li = li->li_next) +! { +! ptrs[i].item = li; +! ptrs[i].idx = i; +! ++i; +! } + + item_compare_func_err = FALSE; + item_compare_keep_zero = FALSE; +*************** +*** 17531,17537 **** + else + { + /* Sort the array with item pointers. */ +! qsort((void *)ptrs, (size_t)len, sizeof(listitem_T *), + item_compare_func == NULL ? item_compare : item_compare2); + + if (!item_compare_func_err) +--- 17549,17555 ---- + else + { + /* Sort the array with item pointers. */ +! qsort((void *)ptrs, (size_t)len, sizeof(sortItem_T), + item_compare_func == NULL ? item_compare : item_compare2); + + if (!item_compare_func_err) +*************** +*** 17540,17546 **** + l->lv_first = l->lv_last = l->lv_idx_item = NULL; + l->lv_len = 0; + for (i = 0; i < len; ++i) +! list_append(l, ptrs[i]); + } + } + } +--- 17558,17564 ---- + l->lv_first = l->lv_last = l->lv_idx_item = NULL; + l->lv_len = 0; + for (i = 0; i < len; ++i) +! list_append(l, ptrs[i].item); + } + } + } +*************** +*** 17559,17565 **** + { + if (item_compare_func_ptr((void *)&li, (void *)&li->li_next) + == 0) +! ptrs[i++] = li; + if (item_compare_func_err) + { + EMSG(_("E882: Uniq compare function failed")); +--- 17577,17583 ---- + { + if (item_compare_func_ptr((void *)&li, (void *)&li->li_next) + == 0) +! ptrs[i++].item = li; + if (item_compare_func_err) + { + EMSG(_("E882: Uniq compare function failed")); +*************** +*** 17571,17582 **** + { + while (--i >= 0) + { +! li = ptrs[i]->li_next; +! ptrs[i]->li_next = li->li_next; + if (li->li_next != NULL) +! li->li_next->li_prev = ptrs[i]; + else +! l->lv_last = ptrs[i]; + list_fix_watch(l, li); + listitem_free(li); + l->lv_len--; +--- 17589,17600 ---- + { + while (--i >= 0) + { +! li = ptrs[i].item->li_next; +! ptrs[i].item->li_next = li->li_next; + if (li->li_next != NULL) +! li->li_next->li_prev = ptrs[i].item; + else +! l->lv_last = ptrs[i].item; + list_fix_watch(l, li); + listitem_free(li); + l->lv_len--; +*** ../vim-7.4.357/src/version.c 2014-07-09 14:00:45.175044250 +0200 +--- src/version.c 2014-07-09 17:23:12.791836515 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 358, + /**/ + +-- +An indication you must be a manager: +You can explain to somebody the difference between "re-engineering", +"down-sizing", "right-sizing", and "firing people's asses". + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.359 b/7.4.359 new file mode 100644 index 0000000..ab695d5 --- /dev/null +++ b/7.4.359 @@ -0,0 +1,103 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.359 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.359 +Problem: When 'ttymouse' is set to 'uxterm' the xterm version is not + requested. (Tomas Janousek) +Solution: Do not mark uxterm as a conflict mouse and add + resume_get_esc_sequence(). +Files: src/term.c, src/os_unix.c, src/proto/term.pro + + +*** ../vim-7.4.358/src/term.c 2014-05-22 21:22:15.361995652 +0200 +--- src/term.c 2014-07-09 18:49:57.127730739 +0200 +*************** +*** 3330,3335 **** +--- 3330,3348 ---- + return crv_status == CRV_SENT || u7_status == U7_SENT + || xt_index_out > xt_index_in; + } ++ ++ /* ++ * If requesting the version was disabled in did_request_esc_sequence(), ++ * enable it again. ++ */ ++ void ++ resume_get_esc_sequence() ++ { ++ if (crv_status == 0) ++ crv_status = CRV_GET; ++ if (u7_status == 0) ++ u7_status = U7_GET; ++ } + # endif + + +*** ../vim-7.4.358/src/os_unix.c 2014-05-22 21:22:15.361995652 +0200 +--- src/os_unix.c 2014-07-09 18:56:58.483722175 +0200 +*************** +*** 3780,3788 **** + # ifdef FEAT_MOUSE_URXVT + /* same as the dec mouse */ + if (use_xterm_mouse() == 3 +- # ifdef FEAT_TERMRESPONSE +- && !did_request_esc_sequence() +- # endif + # ifdef FEAT_GUI + && !gui.in_use + # endif +--- 3780,3785 ---- +*************** +*** 3797,3803 **** + mch_setmouse(FALSE); + setmouse(); + } +! xterm_conflict_mouse = TRUE; + } + else + del_mouse_termcode(KS_URXVT_MOUSE); +--- 3794,3801 ---- + mch_setmouse(FALSE); + setmouse(); + } +! /* It's OK to request the xterm version for uxterm. */ +! resume_get_esc_sequence(); + } + else + del_mouse_termcode(KS_URXVT_MOUSE); +*** ../vim-7.4.358/src/proto/term.pro 2014-05-22 18:14:27.570224664 +0200 +--- src/proto/term.pro 2014-07-09 18:53:31.827726375 +0200 +*************** +*** 35,40 **** +--- 35,41 ---- + void starttermcap __ARGS((void)); + void stoptermcap __ARGS((void)); + int did_request_esc_sequence __ARGS((void)); ++ void resume_get_esc_sequence __ARGS((void)); + void may_req_termresponse __ARGS((void)); + void may_req_ambiguous_char_width __ARGS((void)); + int swapping_screen __ARGS((void)); +*** ../vim-7.4.358/src/version.c 2014-07-09 17:51:46.075801693 +0200 +--- src/version.c 2014-07-09 18:50:55.515729552 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 359, + /**/ + +-- +An indication you must be a manager: +You give constructive feedback to your dog. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.360 b/7.4.360 new file mode 100644 index 0000000..9bd5212 --- /dev/null +++ b/7.4.360 @@ -0,0 +1,80 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.360 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.360 +Problem: In a regexp pattern a "$" followed by \v or \V is not seen as the + end-of-line. +Solution: Handle the situation. (Ozaki Kiichi) +Files: src/regexp.c + + +*** ../vim-7.4.359/src/regexp.c 2014-05-13 19:37:19.489786520 +0200 +--- src/regexp.c 2014-07-09 19:28:51.871683287 +0200 +*************** +*** 3109,3123 **** + if (reg_magic >= MAGIC_OFF) + { + char_u *p = regparse + 1; + +! /* ignore \c \C \m and \M after '$' */ + while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C' +! || p[1] == 'm' || p[1] == 'M' || p[1] == 'Z')) + p += 2; + if (p[0] == NUL + || (p[0] == '\\' + && (p[1] == '|' || p[1] == '&' || p[1] == ')' + || p[1] == 'n')) + || reg_magic == MAGIC_ALL) + curchr = Magic('$'); + } +--- 3109,3133 ---- + if (reg_magic >= MAGIC_OFF) + { + char_u *p = regparse + 1; ++ int is_magic_all = (reg_magic == MAGIC_ALL); + +! /* ignore \c \C \m \M \v \V and \Z after '$' */ + while (p[0] == '\\' && (p[1] == 'c' || p[1] == 'C' +! || p[1] == 'm' || p[1] == 'M' +! || p[1] == 'v' || p[1] == 'V' || p[1] == 'Z')) +! { +! if (p[1] == 'v') +! is_magic_all = TRUE; +! else if (p[1] == 'm' || p[1] == 'M' || p[1] == 'V') +! is_magic_all = FALSE; + p += 2; ++ } + if (p[0] == NUL + || (p[0] == '\\' + && (p[1] == '|' || p[1] == '&' || p[1] == ')' + || p[1] == 'n')) ++ || (is_magic_all ++ && (p[0] == '|' || p[0] == '&' || p[0] == ')')) + || reg_magic == MAGIC_ALL) + curchr = Magic('$'); + } +*** ../vim-7.4.359/src/version.c 2014-07-09 19:13:45.007701718 +0200 +--- src/version.c 2014-07-09 19:18:36.599695792 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 360, + /**/ + +-- +An indication you must be a manager: +You believe you never have any problems in your life, just +"issues" and "improvement opportunities". + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.361 b/7.4.361 new file mode 100644 index 0000000..7629b12 --- /dev/null +++ b/7.4.361 @@ -0,0 +1,48 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.361 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.361 +Problem: Lots of flickering when filling the preview window for 'omnifunc'. +Solution: Disable redrawing. (Hirohito Higashi) +Files: src/popupmnu.c + + +*** ../vim-7.4.360/src/popupmnu.c 2013-11-06 04:04:29.000000000 +0100 +--- src/popupmnu.c 2014-07-09 19:56:25.663649674 +0200 +*************** +*** 567,573 **** +--- 567,575 ---- + g_do_tagpreview = 3; + if (p_pvh > 0 && p_pvh < g_do_tagpreview) + g_do_tagpreview = p_pvh; ++ ++RedrawingDisabled; + resized = prepare_tagpreview(FALSE); ++ --RedrawingDisabled; + g_do_tagpreview = 0; + + if (curwin->w_p_pvw) +*** ../vim-7.4.360/src/version.c 2014-07-09 19:32:30.939678834 +0200 +--- src/version.c 2014-07-09 19:55:48.995650419 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 361, + /**/ + +-- +Lose weight, NEVER Diet again with + The "Invisible Weight Loss Patch" + (spam e-mail) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.362 b/7.4.362 new file mode 100644 index 0000000..beeb6dd --- /dev/null +++ b/7.4.362 @@ -0,0 +1,53 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.362 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.362 +Problem: When matchaddpos() uses a length smaller than the number of bytes + in the (last) character the highlight continues until the end of + the line. +Solution: Change condition from equal to larger-or-equal. +Files: src/screen.c + + +*** ../vim-7.4.361/src/screen.c 2014-07-03 22:54:04.911859458 +0200 +--- src/screen.c 2014-07-09 20:14:46.611627298 +0200 +*************** +*** 3852,3858 **** + { + shl->attr_cur = shl->attr; + } +! else if (v == (long)shl->endcol) + { + shl->attr_cur = 0; + next_search_hl(wp, shl, lnum, (colnr_T)v, cur); +--- 3852,3858 ---- + { + shl->attr_cur = shl->attr; + } +! else if (v >= (long)shl->endcol) + { + shl->attr_cur = 0; + next_search_hl(wp, shl, lnum, (colnr_T)v, cur); +*** ../vim-7.4.361/src/version.c 2014-07-09 19:58:21.115647328 +0200 +--- src/version.c 2014-07-09 20:20:14.423620635 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 362, + /**/ + +-- +Compilation process failed successfully. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.363 b/7.4.363 new file mode 100644 index 0000000..d225cdb --- /dev/null +++ b/7.4.363 @@ -0,0 +1,160 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.363 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.363 +Problem: In Windows console typing 0xCE does not work. +Solution: Convert 0xCE to K_NUL 3. (Nobuhiro Takasaki et al.) +Files: src/os_win32.c, src/term.c + + +*** ../vim-7.4.362/src/os_win32.c 2014-04-01 21:00:45.436733663 +0200 +--- src/os_win32.c 2014-07-09 20:29:30.787609327 +0200 +*************** +*** 619,625 **** + return FALSE; + } + +! tokenPrivileges.PrivilegeCount = 1; + tokenPrivileges.Privileges[0].Luid = luid; + tokenPrivileges.Privileges[0].Attributes = bEnable ? + SE_PRIVILEGE_ENABLED : 0; +--- 619,625 ---- + return FALSE; + } + +! tokenPrivileges.PrivilegeCount = 1; + tokenPrivileges.Privileges[0].Luid = luid; + tokenPrivileges.Privileges[0].Attributes = bEnable ? + SE_PRIVILEGE_ENABLED : 0; +*************** +*** 1785,1797 **** + #endif + { + int n = 1; + +- /* A key may have one or two bytes. */ + typeahead[typeaheadlen] = c; + if (ch2 != NUL) + { +! typeahead[typeaheadlen + 1] = ch2; +! ++n; + } + #ifdef FEAT_MBYTE + /* Only convert normal characters, not special keys. Need to +--- 1785,1798 ---- + #endif + { + int n = 1; ++ int conv = FALSE; + + typeahead[typeaheadlen] = c; + if (ch2 != NUL) + { +! typeahead[typeaheadlen + 1] = 3; +! typeahead[typeaheadlen + 2] = ch2; +! n += 2; + } + #ifdef FEAT_MBYTE + /* Only convert normal characters, not special keys. Need to +*************** +*** 1800,1805 **** +--- 1801,1807 ---- + if (input_conv.vc_type != CONV_NONE + && (ch2 == NUL || c != K_NUL)) + { ++ conv = TRUE; + typeaheadlen -= unconverted; + n = convert_input_safe(typeahead + typeaheadlen, + n + unconverted, TYPEAHEADLEN - typeaheadlen, +*************** +*** 1807,1812 **** +--- 1809,1832 ---- + } + #endif + ++ if (conv) ++ { ++ char_u *p = typeahead + typeaheadlen; ++ char_u *e = typeahead + TYPEAHEADLEN; ++ ++ while (*p && p < e) ++ { ++ if (*p == K_NUL) ++ { ++ ++p; ++ mch_memmove(p + 1, p, ((size_t)(e - p)) - 1); ++ *p = 3; ++ ++n; ++ } ++ ++p; ++ } ++ } ++ + /* Use the ALT key to set the 8th bit of the character + * when it's one byte, the 8th bit isn't set yet and not + * using a double-byte encoding (would become a lead +*** ../vim-7.4.362/src/term.c 2014-07-09 19:13:45.003701718 +0200 +--- src/term.c 2014-07-09 20:26:28.655613029 +0200 +*************** +*** 3724,3730 **** +--- 3724,3734 ---- + return; + } + ++ #if defined(WIN3264) && !defined(FEAT_GUI) ++ s = vim_strnsave(string, (int)STRLEN(string) + 1); ++ #else + s = vim_strsave(string); ++ #endif + if (s == NULL) + return; + +*************** +*** 3734,3739 **** +--- 3738,3752 ---- + STRMOVE(s, s + 1); + s[0] = term_7to8bit(string); + } ++ ++ #if defined(WIN3264) && !defined(FEAT_GUI) ++ if (s[0] == K_NUL) ++ { ++ STRMOVE(s + 1, s); ++ s[1] = 3; ++ } ++ #endif ++ + len = (int)STRLEN(s); + + need_gather = TRUE; /* need to fill termleader[] */ +*** ../vim-7.4.362/src/version.c 2014-07-09 20:20:40.359620108 +0200 +--- src/version.c 2014-07-09 20:26:38.903612821 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 363, + /**/ + +-- +BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One. +ANOTHER MONK: And St. Attila raised his hand grenade up on high saying "O + Lord bless this thy hand grenade that with it thou mayest + blow thine enemies to tiny bits, in thy mercy. "and the Lord + did grin and people did feast upon the lambs and sloths and + carp and anchovies and orang-utans and breakfast cereals and + fruit bats and... +BROTHER MAYNARD: Skip a bit brother ... + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.364 b/7.4.364 new file mode 100644 index 0000000..493056c --- /dev/null +++ b/7.4.364 @@ -0,0 +1,70 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.364 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.364 +Problem: When the viminfo file can't be renamed there is no error message. + (Vladimir Berezhnoy) +Solution: Check for the rename to fail. +Files: src/ex_cmds.c + + +*** ../vim-7.4.363/src/ex_cmds.c 2014-05-22 14:00:12.694534712 +0200 +--- src/ex_cmds.c 2014-07-09 21:11:44.531557830 +0200 +*************** +*** 2004,2014 **** + { + fclose(fp_in); + +! /* +! * In case of an error keep the original viminfo file. +! * Otherwise rename the newly written file. +! */ +! if (viminfo_errcnt || vim_rename(tempname, fname) == -1) + mch_remove(tempname); + + #ifdef WIN3264 +--- 2004,2017 ---- + { + fclose(fp_in); + +! /* In case of an error keep the original viminfo file. Otherwise +! * rename the newly written file. Give an error if that fails. */ +! if (viminfo_errcnt == 0 && vim_rename(tempname, fname) == -1) +! { +! ++viminfo_errcnt; +! EMSG2(_("E886: Can't rename viminfo file to %s!"), fname); +! } +! if (viminfo_errcnt > 0) + mch_remove(tempname); + + #ifdef WIN3264 +*** ../vim-7.4.363/src/version.c 2014-07-09 20:51:04.519583033 +0200 +--- src/version.c 2014-07-09 21:13:18.575555919 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 364, + /**/ + +-- +MONK: ... and the Lord spake, saying, "First shalt thou take out the Holy Pin, + then shalt thou count to three, no more, no less. Three shalt be the + number thou shalt count, and the number of the counting shalt be three. + Four shalt thou not count, neither count thou two, excepting that thou + then proceed to three. Five is right out. Once the number three, being + the third number, be reached, then lobbest thou thy Holy Hand Grenade of + Antioch towards thou foe, who being naughty in my sight, shall snuff it. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.365 b/7.4.365 new file mode 100644 index 0000000..196e66e --- /dev/null +++ b/7.4.365 @@ -0,0 +1,159 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.365 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.365 +Problem: Crash when using ":botright split" when there isn't much space. +Solution: Add a check for the minimum width/height. (Yukihiro Nakadaira) +Files: src/window.c + + +*** ../vim-7.4.364/src/window.c 2014-07-02 17:16:51.334225522 +0200 +--- src/window.c 2014-07-16 14:14:37.751774230 +0200 +*************** +*** 686,691 **** +--- 686,693 ---- + int layout; + frame_T *frp, *curfrp; + int before; ++ int minwidth; ++ int minheight; + + if (flags & WSP_TOP) + oldwin = firstwin; +*************** +*** 725,735 **** + needed += p_wiw - p_wmw; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { + available = topframe->fr_width; +! needed += frame_minwidth(topframe, NULL); + } + else + available = oldwin->w_width; + if (available < needed && new_wp == NULL) + { + EMSG(_(e_noroom)); +--- 727,741 ---- + needed += p_wiw - p_wmw; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { ++ minwidth = frame_minwidth(topframe, NULL); + available = topframe->fr_width; +! needed += minwidth; + } + else ++ { ++ minwidth = frame_minwidth(oldwin->w_frame, NULL); + available = oldwin->w_width; ++ } + if (available < needed && new_wp == NULL) + { + EMSG(_(e_noroom)); +*************** +*** 739,744 **** +--- 745,752 ---- + new_size = oldwin->w_width / 2; + if (new_size > oldwin->w_width - p_wmw - 1) + new_size = oldwin->w_width - p_wmw - 1; ++ if (new_size > available - minwidth - 1) ++ new_size = available - minwidth - 1; + if (new_size < p_wmw) + new_size = p_wmw; + +*************** +*** 786,796 **** + needed += p_wh - p_wmh; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { + available = topframe->fr_height; +! needed += frame_minheight(topframe, NULL); + } + else + { + available = oldwin->w_height; + needed += p_wmh; + } +--- 794,806 ---- + needed += p_wh - p_wmh; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { ++ minheight = frame_minheight(topframe, NULL); + available = topframe->fr_height; +! needed += minheight; + } + else + { ++ minheight = frame_minheight(oldwin->w_frame, NULL); + available = oldwin->w_height; + needed += p_wmh; + } +*************** +*** 810,815 **** +--- 820,827 ---- + + if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT) + new_size = oldwin_height - p_wmh - STATUS_HEIGHT; ++ if (new_size > available - minheight - STATUS_HEIGHT) ++ new_size = available - minheight - STATUS_HEIGHT; + if (new_size < p_wmh) + new_size = p_wmh; + +*************** +*** 5732,5738 **** + --wp->w_wrow; + } + } +! set_topline(wp, lnum); + } + else if (sline > 0) + { +--- 5744,5750 ---- + --wp->w_wrow; + } + } +! set_topline(wp, lnum); + } + else if (sline > 0) + { +*************** +*** 5778,5784 **** + wp->w_wrow -= sline; + } + +! set_topline(wp, lnum); + } + } + +--- 5790,5796 ---- + wp->w_wrow -= sline; + } + +! set_topline(wp, lnum); + } + } + +*** ../vim-7.4.364/src/version.c 2014-07-09 21:17:59.755550204 +0200 +--- src/version.c 2014-07-16 14:10:41.191779038 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 365, + /**/ + +-- +"Software is like sex... it's better when it's free." + -- Linus Torvalds, initiator of the free Linux OS +Makes me wonder what FSF stands for...? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.366 b/7.4.366 new file mode 100644 index 0000000..76097be --- /dev/null +++ b/7.4.366 @@ -0,0 +1,53 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.366 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.366 +Problem: Can't run the linebreak test on MS-Windows. +Solution: Fix the output file name. (Taro Muraoka) +Files: src/testdir/Make_dos.mak + + +*** ../vim-7.4.365/src/testdir/Make_dos.mak 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/Make_dos.mak 2014-07-16 14:19:39.719768093 +0200 +*************** +*** 37,43 **** + test105.out test106.out test107.out\ + test_autoformat_join.out \ + test_breakindent.out \ +! test_listlbr \ + test_eval.out \ + test_options.out + +--- 37,43 ---- + test105.out test106.out test107.out\ + test_autoformat_join.out \ + test_breakindent.out \ +! test_listlbr.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.365/src/version.c 2014-07-16 14:16:41.519771715 +0200 +--- src/version.c 2014-07-16 14:18:43.307769239 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 366, + /**/ + +-- + Girls are like internet domain names, + the ones I like are already taken. + Well, you can stil get one from a strange country :-P + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.367 b/7.4.367 new file mode 100644 index 0000000..c184192 --- /dev/null +++ b/7.4.367 @@ -0,0 +1,67 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.367 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.367 (after 7.4.357) +Problem: Other solution for redrawing after completion. +Solution: Schedule a window redraw instead of just clearing the command + line. (Jacob Niehus) +Files: src/edit.c + + +*** ../vim-7.4.366/src/edit.c 2014-07-09 14:00:45.175044250 +0200 +--- src/edit.c 2014-07-16 14:36:00.679748155 +0200 +*************** +*** 3854,3860 **** + ins_compl_free(); + compl_started = FALSE; + compl_matches = 0; +! msg_clr_cmdline(); /* necessary for "noshowmode" */ + ctrl_x_mode = 0; + compl_enter_selects = FALSE; + if (edit_submode != NULL) +--- 3854,3861 ---- + ins_compl_free(); + compl_started = FALSE; + compl_matches = 0; +! if (!shortmess(SHM_COMPLETIONMENU)) +! msg_clr_cmdline(); /* necessary for "noshowmode" */ + ctrl_x_mode = 0; + compl_enter_selects = FALSE; + if (edit_submode != NULL) +*************** +*** 4591,4597 **** +--- 4592,4601 ---- + */ + i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0); + backspace_until_column(i); ++ ++ /* Not sure what is still valid, better redraw everything. */ + changed_cline_bef_curs(); ++ redraw_curbuf_later(NOT_VALID); + } + + /* Insert the new text being completed. */ +*** ../vim-7.4.366/src/version.c 2014-07-16 14:20:38.255766903 +0200 +--- src/version.c 2014-07-16 14:42:23.059740384 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 367, + /**/ + +-- +No children may attend school with their breath smelling of "wild onions." + [real standing law in West Virginia, United States of America] + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.368 b/7.4.368 new file mode 100644 index 0000000..0dd85e3 --- /dev/null +++ b/7.4.368 @@ -0,0 +1,79 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.368 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.368 +Problem: Restoring the window sizes after closing the command line window + doesn't work properly if there are nested splits. +Solution: Restore the sizes twice. (Hirohito Higashi) +Files: src/window.c + + +*** ../vim-7.4.367/src/window.c 2014-07-16 14:16:41.519771715 +0200 +--- src/window.c 2014-07-16 15:13:52.895701974 +0200 +*************** +*** 4848,4862 **** + garray_T *gap; + { + win_T *wp; +! int i; + + if (win_count() * 2 == gap->ga_len) + { +! i = 0; +! for (wp = firstwin; wp != NULL; wp = wp->w_next) + { +! frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]); +! win_setheight_win(((int *)gap->ga_data)[i++], wp); + } + /* recompute the window positions */ + (void)win_comp_pos(); +--- 4848,4867 ---- + garray_T *gap; + { + win_T *wp; +! int i, j; + + if (win_count() * 2 == gap->ga_len) + { +! /* The order matters, because frames contain other frames, but it's +! * difficult to get right. The easy way out is to do it twice. */ +! for (j = 0; j < 2; ++j) + { +! i = 0; +! for (wp = firstwin; wp != NULL; wp = wp->w_next) +! { +! frame_setwidth(wp->w_frame, ((int *)gap->ga_data)[i++]); +! win_setheight_win(((int *)gap->ga_data)[i++], wp); +! } + } + /* recompute the window positions */ + (void)win_comp_pos(); +*** ../vim-7.4.367/src/version.c 2014-07-16 14:42:37.923740082 +0200 +--- src/version.c 2014-07-16 15:14:46.035700894 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 368, + /**/ + +-- +FROG: How you English say: I one more time, mac, I unclog my nose towards + you, sons of a window-dresser, so, you think you could out-clever us + French fellows with your silly knees-bent creeping about advancing + behaviour. (blows a raspberry) I wave my private parts at your aunties, + you brightly-coloured, mealy-templed, cranberry-smelling, electric + donkey-bottom biters. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.369 b/7.4.369 new file mode 100644 index 0000000..c501c64 --- /dev/null +++ b/7.4.369 @@ -0,0 +1,70 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.369 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.369 +Problem: Using freed memory when exiting while compiled with EXITFREE. +Solution: Set curwin to NULL and check for that. (Dominique Pelle) +Files: src/buffer.c, src/window.c + + +*** ../vim-7.4.368/src/buffer.c 2014-06-12 14:01:27.571769788 +0200 +--- src/buffer.c 2014-07-16 16:20:04.443621254 +0200 +*************** +*** 5702,5709 **** + signlist_T *next; + + /* When deleting the last sign need to redraw the windows to remove the +! * sign column. */ +! if (buf->b_signlist != NULL) + { + redraw_buf_later(buf, NOT_VALID); + changed_cline_bef_curs(); +--- 5702,5709 ---- + signlist_T *next; + + /* When deleting the last sign need to redraw the windows to remove the +! * sign column. Not when curwin is NULL (this means we're exiting). */ +! if (buf->b_signlist != NULL && curwin != NULL) + { + redraw_buf_later(buf, NOT_VALID); + changed_cline_bef_curs(); +*** ../vim-7.4.368/src/window.c 2014-07-16 15:18:22.903696486 +0200 +--- src/window.c 2014-07-16 16:15:41.063626607 +0200 +*************** +*** 2489,2494 **** +--- 2489,2498 ---- + + while (firstwin != NULL) + (void)win_free_mem(firstwin, &dummy, NULL); ++ ++ /* No window should be used after this. Set curwin to NULL to crash ++ * instead of using freed memory. */ ++ curwin = NULL; + } + #endif + +*** ../vim-7.4.368/src/version.c 2014-07-16 15:18:22.907696486 +0200 +--- src/version.c 2014-07-16 16:18:36.827623035 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 369, + /**/ + +-- +ARTHUR: If you do not open these doors, we will take this castle by force ... + [A bucket of slops land on ARTHUR. He tries to retain his dignity.] + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.370 b/7.4.370 new file mode 100644 index 0000000..5da13f4 --- /dev/null +++ b/7.4.370 @@ -0,0 +1,316 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.370 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.370 +Problem: Linebreak test fails when encoding is not utf-8. (Danek Duvall) +Solution: Split the test in a single byte one and a utf-8 one. (Christian + Brabandt) +Files: src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, + src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms, src/testdir/Makefile, + src/testdir/test_listlbr.in, src/testdir/test_listlbr.ok, + src/testdir/test_listlbr_utf8.in, src/testdir/test_listlbr_utf8.ok + + +*** ../vim-7.4.369/src/testdir/Make_amiga.mak 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/Make_amiga.mak 2014-07-16 16:55:15.311578352 +0200 +*************** +*** 39,44 **** +--- 39,45 ---- + test_autoformat_join.out \ + test_breakindent.out \ + test_listlbr.out \ ++ test_listlbr_utf8.out \ + test_eval.out \ + test_options.out + +*************** +*** 167,171 **** +--- 168,173 ---- + test_autoformat_join.out: test_autoformat_join.in + test_breakindent.out: test_breakindent.in + test_listlbr.out: test_listlbr.in ++ test_listlbr_utf8.out: test_listlbr_utf8.in + test_eval.out: test_eval.in + test_options.out: test_options.in +*** ../vim-7.4.369/src/testdir/Make_dos.mak 2014-07-16 14:20:38.255766903 +0200 +--- src/testdir/Make_dos.mak 2014-07-16 16:56:02.423577394 +0200 +*************** +*** 38,43 **** +--- 38,44 ---- + test_autoformat_join.out \ + test_breakindent.out \ + test_listlbr.out \ ++ test_listlbr_utf8.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.369/src/testdir/Make_ming.mak 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/Make_ming.mak 2014-07-16 16:55:15.311578352 +0200 +*************** +*** 58,63 **** +--- 58,64 ---- + test_autoformat_join.out \ + test_breakindent.out \ + test_listlbr.out \ ++ test_listlbr_utf8.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.369/src/testdir/Make_os2.mak 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/Make_os2.mak 2014-07-16 16:55:15.311578352 +0200 +*************** +*** 40,45 **** +--- 40,46 ---- + test_autoformat_join.out \ + test_eval.out \ + test_breakindent.out \ ++ test_listlbr_utf8.out \ + test_listlbr.out \ + test_options.out + +*** ../vim-7.4.369/src/testdir/Make_vms.mms 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/Make_vms.mms 2014-07-16 16:55:15.311578352 +0200 +*************** +*** 99,104 **** +--- 99,105 ---- + test_autoformat_join.out \ + test_breakindent.out \ + test_listlbr.out \ ++ test_listlbr_utf8.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.369/src/testdir/Makefile 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/Makefile 2014-07-16 16:55:15.311578352 +0200 +*************** +*** 36,41 **** +--- 36,42 ---- + test_autoformat_join.out \ + test_breakindent.out \ + test_listlbr.out \ ++ test_listlbr_utf8.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.369/src/testdir/test_listlbr.in 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/test_listlbr.in 2014-07-16 16:55:15.311578352 +0200 +*************** +*** 1,10 **** +! Test for linebreak and list option + + STARTTEST + :so small.vim + :if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif + :10new|:vsp|:vert resize 20 +! :put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \" + :norm! zt + :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap + :fu! ScreenChar(width) +--- 1,10 ---- +! Test for linebreak and list option (non-utf8) + + STARTTEST + :so small.vim + :if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif + :10new|:vsp|:vert resize 20 +! :put =\"\tabcdef hijklmn\tpqrstuvwxyz_1060ABCDEFGHIJKLMNOP \" + :norm! zt + :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap + :fu! ScreenChar(width) +*************** +*** 32,53 **** + :redraw! + :let line=ScreenChar(winwidth(0)) + :call DoRecordScreen() +! :let g:test ="Test 3: set linebreak + set list + fancy listchars" +! :exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" +! :redraw! +! :let line=ScreenChar(winwidth(0)) +! :call DoRecordScreen() +! :let g:test ="Test 4: set linebreak nolist" + :set nolist linebreak + :redraw! + :let line=ScreenChar(winwidth(0)) + :call DoRecordScreen() +! :let g:test ="Test 5: set nolinebreak list" +! :set list nolinebreak +! :redraw! +! :let line=ScreenChar(winwidth(0)) +! :call DoRecordScreen() +! :let g:test ="Test 6: set linebreak with tab and 1 line as long as screen: should break!" + :set nolist linebreak ts=8 + :let line="1\t".repeat('a', winwidth(0)-2) + :$put =line +--- 32,43 ---- + :redraw! + :let line=ScreenChar(winwidth(0)) + :call DoRecordScreen() +! :let g:test ="Test 3: set linebreak nolist" + :set nolist linebreak + :redraw! + :let line=ScreenChar(winwidth(0)) + :call DoRecordScreen() +! :let g:test ="Test 4: set linebreak with tab and 1 line as long as screen: should break!" + :set nolist linebreak ts=8 + :let line="1\t".repeat('a', winwidth(0)-2) + :$put =line +*** ../vim-7.4.369/src/testdir/test_listlbr.ok 2014-07-02 19:59:35.454375136 +0200 +--- src/testdir/test_listlbr.ok 2014-07-16 16:55:15.315578352 +0200 +*************** +*** 1,38 **** + +! abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP + + Test 1: set linebreak + abcdef + +hijklmn +! +pqrstuvwxyz 1060ABC + +DEFGHIJKLMNOP + + Test 2: set linebreak + set list + ^Iabcdef hijklmn^I +! +pqrstuvwxyz 1060ABC + +DEFGHIJKLMNOP + + +! Test 3: set linebreak + set list + fancy listchars +! ▕———abcdef +! +hijklmn▕——— +! +pqrstuvwxyz␣1060ABC +! +DEFGHIJKLMNOPˑ¶ +! +! Test 4: set linebreak nolist + abcdef + +hijklmn +! +pqrstuvwxyz 1060ABC + +DEFGHIJKLMNOP +- +- Test 5: set nolinebreak list +- ▕———abcdef hijklmn▕— +- +pqrstuvwxyz␣1060ABC +- +DEFGHIJKLMNOPˑ¶ +- ¶ + 1 aaaaaaaaaaaaaaaaaa + +! Test 6: set linebreak with tab and 1 line as long as screen: should break! + 1 + +aaaaaaaaaaaaaaaaaa + ~ +--- 1,26 ---- + +! abcdef hijklmn pqrstuvwxyz_1060ABCDEFGHIJKLMNOP + + Test 1: set linebreak + abcdef + +hijklmn +! +pqrstuvwxyz_1060ABC + +DEFGHIJKLMNOP + + Test 2: set linebreak + set list + ^Iabcdef hijklmn^I +! +pqrstuvwxyz_1060ABC + +DEFGHIJKLMNOP + + +! Test 3: set linebreak nolist + abcdef + +hijklmn +! +pqrstuvwxyz_1060ABC + +DEFGHIJKLMNOP + 1 aaaaaaaaaaaaaaaaaa + +! Test 4: set linebreak with tab and 1 line as long as screen: should break! + 1 + +aaaaaaaaaaaaaaaaaa + ~ +*** ../vim-7.4.369/src/testdir/test_listlbr_utf8.in 2014-07-16 17:01:25.415570829 +0200 +--- src/testdir/test_listlbr_utf8.in 2014-07-16 16:55:15.315578352 +0200 +*************** +*** 0 **** +--- 1,41 ---- ++ Test for linebreak and list option in utf-8 mode ++ ++ STARTTEST ++ :so small.vim ++ :if !exists("+linebreak") | e! test.ok | w! test.out | qa! | endif ++ :so mbyte.vim ++ :if &enc !=? 'utf-8'|:e! test.ok|:w! test.out|qa!|endif ++ :10new|:vsp|:vert resize 20 ++ :put =\"\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP \" ++ :norm! zt ++ :set ts=4 sw=4 sts=4 linebreak sbr=+ wrap ++ :fu! ScreenChar(width) ++ : let c='' ++ : for j in range(1,4) ++ : for i in range(1,a:width) ++ : let c.=nr2char(screenchar(j, i)) ++ : endfor ++ : let c.="\n" ++ : endfor ++ : return c ++ :endfu ++ :fu! DoRecordScreen() ++ : wincmd l ++ : $put =printf(\"\n%s\", g:test) ++ : $put =g:line ++ : wincmd p ++ :endfu ++ :let g:test ="Test 1: set linebreak + set list + fancy listchars" ++ :exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :let g:test ="Test 2: set nolinebreak list" ++ :set list nolinebreak ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :%w! test.out ++ :qa! ++ ENDTEST ++ dummy text +*** ../vim-7.4.369/src/testdir/test_listlbr_utf8.ok 2014-07-16 17:01:25.419570829 +0200 +--- src/testdir/test_listlbr_utf8.ok 2014-07-16 16:55:15.315578352 +0200 +*************** +*** 0 **** +--- 1,14 ---- ++ ++ abcdef hijklmn pqrstuvwxyz 1060ABCDEFGHIJKLMNOP ++ ++ Test 1: set linebreak + set list + fancy listchars ++ ▕———abcdef ++ +hijklmn▕——— ++ +pqrstuvwxyz␣1060ABC ++ +DEFGHIJKLMNOPˑ¶ ++ ++ Test 2: set nolinebreak list ++ ▕———abcdef hijklmn▕— ++ +pqrstuvwxyz␣1060ABC ++ +DEFGHIJKLMNOPˑ¶ ++ ¶ +*** ../vim-7.4.369/src/version.c 2014-07-16 16:30:21.647608710 +0200 +--- src/version.c 2014-07-16 16:56:38.755576656 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 370, + /**/ + +-- + Another bucket of what can only be described as human ordure hits ARTHUR. +ARTHUR: ... Right! (to the KNIGHTS) That settles it! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.371 b/7.4.371 new file mode 100644 index 0000000..f915a8f --- /dev/null +++ b/7.4.371 @@ -0,0 +1,59 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.371 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.371 +Problem: When 'linebreak' is set control characters are not correctly + displayed. (Kimmy Lindvall) +Solution: Set n_extra. (Christian Brabandt) +Files: src/screen.c + + +*** ../vim-7.4.370/src/screen.c 2014-07-09 20:20:40.359620108 +0200 +--- src/screen.c 2014-07-16 17:12:38.599557147 +0200 +*************** +*** 4646,4651 **** +--- 4646,4653 ---- + else if (c != NUL) + { + p_extra = transchar(c); ++ if (n_extra == 0) ++ n_extra = byte2cells(c) - 1; + #ifdef FEAT_RIGHTLEFT + if ((dy_flags & DY_UHEX) && wp->w_p_rl) + rl_mirror(p_extra); /* reverse "<12>" */ +*** ../vim-7.4.370/src/version.c 2014-07-16 17:01:38.279570568 +0200 +--- src/version.c 2014-07-16 17:13:21.815556269 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 371, + /**/ + +-- +LETTERS TO THE EDITOR (The Times of London) + +Dear Sir, + +I am firmly opposed to the spread of microchips either to the home or +to the office.  We have more than enough of them foisted upon us in +public places.  They are a disgusting Americanism, and can only result +in the farmers being forced to grow smaller potatoes, which in turn +will cause massive unemployment in the already severely depressed +agricultural industry. + +Yours faithfully, +        Capt. Quinton D'Arcy, J. P. +        Sevenoaks + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.372 b/7.4.372 new file mode 100644 index 0000000..11d0254 --- /dev/null +++ b/7.4.372 @@ -0,0 +1,188 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.372 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.372 +Problem: When 'winminheight' is zero there might not be one line for the + current window. +Solution: Change the size computations. (Yukihiro Nakadaira) +Files: src/window.c + + +*** ../vim-7.4.371/src/window.c 2014-07-16 16:30:21.647608710 +0200 +--- src/window.c 2014-07-16 18:06:53.123491001 +0200 +*************** +*** 688,693 **** +--- 688,695 ---- + int before; + int minwidth; + int minheight; ++ int wmw1; ++ int wmh1; + + if (flags & WSP_TOP) + oldwin = firstwin; +*************** +*** 722,740 **** + * Check if we are able to split the current window and compute its + * width. + */ +! needed = p_wmw + 1; + if (flags & WSP_ROOM) +! needed += p_wiw - p_wmw; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { +! minwidth = frame_minwidth(topframe, NULL); + available = topframe->fr_width; + needed += minwidth; + } + else + { +! minwidth = frame_minwidth(oldwin->w_frame, NULL); +! available = oldwin->w_width; + } + if (available < needed && new_wp == NULL) + { +--- 724,745 ---- + * Check if we are able to split the current window and compute its + * width. + */ +! /* Current window requires at least 1 space. */ +! wmw1 = (p_wmw == 0 ? 1 : p_wmw); +! needed = wmw1 + 1; + if (flags & WSP_ROOM) +! needed += p_wiw - wmw1; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { +! minwidth = frame_minwidth(topframe, NOWIN); + available = topframe->fr_width; + needed += minwidth; + } + else + { +! minwidth = frame_minwidth(oldwin->w_frame, NOWIN); +! available = oldwin->w_frame->fr_width; +! needed += minwidth; + } + if (available < needed && new_wp == NULL) + { +*************** +*** 743,754 **** + } + if (new_size == 0) + new_size = oldwin->w_width / 2; +- if (new_size > oldwin->w_width - p_wmw - 1) +- new_size = oldwin->w_width - p_wmw - 1; + if (new_size > available - minwidth - 1) + new_size = available - minwidth - 1; +! if (new_size < p_wmw) +! new_size = p_wmw; + + /* if it doesn't fit in the current window, need win_equal() */ + if (oldwin->w_width - new_size - 1 < p_wmw) +--- 748,757 ---- + } + if (new_size == 0) + new_size = oldwin->w_width / 2; + if (new_size > available - minwidth - 1) + new_size = available - minwidth - 1; +! if (new_size < wmw1) +! new_size = wmw1; + + /* if it doesn't fit in the current window, need win_equal() */ + if (oldwin->w_width - new_size - 1 < p_wmw) +*************** +*** 789,808 **** + * Check if we are able to split the current window and compute its + * height. + */ +! needed = p_wmh + STATUS_HEIGHT + need_status; + if (flags & WSP_ROOM) +! needed += p_wh - p_wmh; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { +! minheight = frame_minheight(topframe, NULL); + available = topframe->fr_height; + needed += minheight; + } + else + { +! minheight = frame_minheight(oldwin->w_frame, NULL); +! available = oldwin->w_height; +! needed += p_wmh; + } + if (available < needed && new_wp == NULL) + { +--- 792,813 ---- + * Check if we are able to split the current window and compute its + * height. + */ +! /* Current window requires at least 1 space. */ +! wmh1 = (p_wmh == 0 ? 1 : p_wmh); +! needed = wmh1 + STATUS_HEIGHT; + if (flags & WSP_ROOM) +! needed += p_wh - wmh1; + if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { +! minheight = frame_minheight(topframe, NOWIN) + need_status; + available = topframe->fr_height; + needed += minheight; + } + else + { +! minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status; +! available = oldwin->w_frame->fr_height; +! needed += minheight; + } + if (available < needed && new_wp == NULL) + { +*************** +*** 817,829 **** + } + if (new_size == 0) + new_size = oldwin_height / 2; +- +- if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT) +- new_size = oldwin_height - p_wmh - STATUS_HEIGHT; + if (new_size > available - minheight - STATUS_HEIGHT) + new_size = available - minheight - STATUS_HEIGHT; +! if (new_size < p_wmh) +! new_size = p_wmh; + + /* if it doesn't fit in the current window, need win_equal() */ + if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh) +--- 822,831 ---- + } + if (new_size == 0) + new_size = oldwin_height / 2; + if (new_size > available - minheight - STATUS_HEIGHT) + new_size = available - minheight - STATUS_HEIGHT; +! if (new_size < wmh1) +! new_size = wmh1; + + /* if it doesn't fit in the current window, need win_equal() */ + if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh) +*** ../vim-7.4.371/src/version.c 2014-07-16 17:29:46.691536252 +0200 +--- src/version.c 2014-07-16 17:34:14.795530803 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 372, + /**/ + +-- + [The rest of the ARMY stand around looking at a loss.] +INSPECTOR END OF FILM: (picks up megaphone) All right! Clear off! Go on! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.373 b/7.4.373 new file mode 100644 index 0000000..0d2841d --- /dev/null +++ b/7.4.373 @@ -0,0 +1,98 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.373 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.373 +Problem: Compiler warning for unused argument and unused variable. +Solution: Add UNUSED. Move variable inside #ifdef. +Files: src/charset.c, src/window.c + + +*** ../vim-7.4.372/src/charset.c 2014-07-02 19:59:35.450375136 +0200 +--- src/charset.c 2014-07-16 23:36:51.211088615 +0200 +*************** +*** 1024,1030 **** + */ + int + lbr_chartabsize(line, s, col) +! char_u *line; /* start of the line */ + unsigned char *s; + colnr_T col; + { +--- 1024,1030 ---- + */ + int + lbr_chartabsize(line, s, col) +! char_u *line UNUSED; /* start of the line */ + unsigned char *s; + colnr_T col; + { +*************** +*** 1069,1075 **** + int + win_lbr_chartabsize(wp, line, s, col, headp) + win_T *wp; +! char_u *line; /* start of the line */ + char_u *s; + colnr_T col; + int *headp UNUSED; +--- 1069,1075 ---- + int + win_lbr_chartabsize(wp, line, s, col, headp) + win_T *wp; +! char_u *line UNUSED; /* start of the line */ + char_u *s; + colnr_T col; + int *headp UNUSED; +*** ../vim-7.4.372/src/window.c 2014-07-16 18:19:22.911475762 +0200 +--- src/window.c 2014-07-16 23:38:31.567086575 +0200 +*************** +*** 686,694 **** + int layout; + frame_T *frp, *curfrp; + int before; +- int minwidth; + int minheight; +- int wmw1; + int wmh1; + + if (flags & WSP_TOP) +--- 686,692 ---- +*************** +*** 718,723 **** +--- 716,724 ---- + #ifdef FEAT_VERTSPLIT + if (flags & WSP_VERT) + { ++ int wmw1; ++ int minwidth; ++ + layout = FR_ROW; + + /* +*** ../vim-7.4.372/src/version.c 2014-07-16 18:19:22.915475762 +0200 +--- src/version.c 2014-07-16 23:36:20.775089233 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 373, + /**/ + +-- +INSPECTOR END OF FILM: Move along. There's nothing to see! Keep moving! + [Suddenly he notices the cameras.] +INSPECTOR END OF FILM: (to Camera) All right, put that away sonny. + [He walks over to it and puts his hand over the lens.] + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.374 b/7.4.374 new file mode 100644 index 0000000..1657477 --- /dev/null +++ b/7.4.374 @@ -0,0 +1,71 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.374 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.374 +Problem: Character after "fb" command not mapped if it might be a composing + character. +Solution: Don't disable mapping when looking for a composing character. + (Jacob Niehus) +Files: src/normal.c + + +*** ../vim-7.4.373/src/normal.c 2014-04-29 12:15:22.856032651 +0200 +--- src/normal.c 2014-07-23 12:26:26.811992854 +0200 +*************** +*** 1076,1082 **** + #ifdef FEAT_MBYTE + /* When getting a text character and the next character is a + * multi-byte character, it could be a composing character. +! * However, don't wait for it to arrive. */ + while (enc_utf8 && lang && (c = vpeekc()) > 0 + && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1)) + { +--- 1076,1085 ---- + #ifdef FEAT_MBYTE + /* When getting a text character and the next character is a + * multi-byte character, it could be a composing character. +! * However, don't wait for it to arrive. Also, do enable mapping, +! * because if it's put back with vungetc() it's too late to apply +! * mapping. */ +! --no_mapping; + while (enc_utf8 && lang && (c = vpeekc()) > 0 + && (c >= 0x100 || MB_BYTE2LEN(vpeekc()) > 1)) + { +*************** +*** 1091,1096 **** +--- 1094,1100 ---- + else + ca.ncharC2 = c; + } ++ ++no_mapping; + #endif + } + --no_mapping; +*** ../vim-7.4.373/src/version.c 2014-07-16 23:39:50.251084976 +0200 +--- src/version.c 2014-07-23 12:27:50.483992253 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 374, + /**/ + +-- +CART DRIVER: Bring out your dead! + There are legs stick out of windows and doors. Two MEN are fighting in the + mud - covered from head to foot in it. Another MAN is on his hands in + knees shovelling mud into his mouth. We just catch sight of a MAN falling + into a well. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.375 b/7.4.375 new file mode 100644 index 0000000..5ccfecf --- /dev/null +++ b/7.4.375 @@ -0,0 +1,59 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.375 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.375 +Problem: Test 63 fails when run with GUI-only Vim. +Solution: Add guibg attributes. (suggested by Mike Soyka) +Files: src/testdir/test63.in + + +*** ../vim-7.4.374/src/testdir/test63.in 2014-06-17 17:48:21.784628008 +0200 +--- src/testdir/test63.in 2014-07-23 13:12:20.727973060 +0200 +*************** +*** 6,14 **** + :" --- Check that "matcharg()" returns the correct group and pattern if a match + :" --- is defined. + :let @r = "*** Test 1: " +! :highlight MyGroup1 ctermbg=red +! :highlight MyGroup2 ctermbg=green +! :highlight MyGroup3 ctermbg=blue + :match MyGroup1 /TODO/ + :2match MyGroup2 /FIXME/ + :3match MyGroup3 /XXX/ +--- 6,14 ---- + :" --- Check that "matcharg()" returns the correct group and pattern if a match + :" --- is defined. + :let @r = "*** Test 1: " +! :highlight MyGroup1 ctermbg=red guibg=red +! :highlight MyGroup2 ctermbg=green guibg=green +! :highlight MyGroup3 ctermbg=blue guibg=blue + :match MyGroup1 /TODO/ + :2match MyGroup2 /FIXME/ + :3match MyGroup3 /XXX/ +*** ../vim-7.4.374/src/version.c 2014-07-23 12:31:17.207990767 +0200 +--- src/version.c 2014-07-23 13:13:15.167972669 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 375, + /**/ + +-- +BODY: I'm not dead! +CART DRIVER: 'Ere. He says he's not dead. +LARGE MAN: Yes he is. +BODY: I'm not! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.376 b/7.4.376 new file mode 100644 index 0000000..93098cb --- /dev/null +++ b/7.4.376 @@ -0,0 +1,57 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.376 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.376 (after 7.4.367) +Problem: Popup menu flickers too much. +Solution: Remove the forced redraw. (Hirohito Higashi) +Files: src/edit.c + + +*** ../vim-7.4.375/src/edit.c 2014-07-16 14:42:37.923740082 +0200 +--- src/edit.c 2014-07-23 13:49:03.535957228 +0200 +*************** +*** 4593,4601 **** + i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0); + backspace_until_column(i); + +! /* Not sure what is still valid, better redraw everything. */ + changed_cline_bef_curs(); +- redraw_curbuf_later(NOT_VALID); + } + + /* Insert the new text being completed. */ +--- 4593,4601 ---- + i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0); + backspace_until_column(i); + +! /* TODO: is this sufficient for redrawing? Redrawing everything causes +! * flicker, thus we can't do that. */ + changed_cline_bef_curs(); + } + + /* Insert the new text being completed. */ +*** ../vim-7.4.375/src/version.c 2014-07-23 13:16:26.727971292 +0200 +--- src/version.c 2014-07-23 13:48:02.031957670 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 376, + /**/ + +-- +Why I like vim: +> I like VIM because, when I ask a question in this newsgroup, I get a +> one-line answer. With xemacs, I get a 1Kb lisp script with bugs in it ;-) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.377 b/7.4.377 new file mode 100644 index 0000000..e5d86bd --- /dev/null +++ b/7.4.377 @@ -0,0 +1,144 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.377 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.377 +Problem: When 'equalalways' is set a split may report "no room" even though + there is plenty of room. +Solution: Compute the available room properly. (Yukihiro Nakadaira) +Files: src/window.c + + +*** ../vim-7.4.376/src/window.c 2014-07-16 23:39:50.251084976 +0200 +--- src/window.c 2014-07-23 15:19:10.491918366 +0200 +*************** +*** 684,690 **** + int available; + int oldwin_height = 0; + int layout; +! frame_T *frp, *curfrp; + int before; + int minheight; + int wmh1; +--- 684,690 ---- + int available; + int oldwin_height = 0; + int layout; +! frame_T *frp, *curfrp, *frp2, *prevfrp; + int before; + int minheight; + int wmh1; +*************** +*** 730,741 **** + needed = wmw1 + 1; + if (flags & WSP_ROOM) + needed += p_wiw - wmw1; +! if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { + minwidth = frame_minwidth(topframe, NOWIN); + available = topframe->fr_width; + needed += minwidth; + } + else + { + minwidth = frame_minwidth(oldwin->w_frame, NOWIN); +--- 730,758 ---- + needed = wmw1 + 1; + if (flags & WSP_ROOM) + needed += p_wiw - wmw1; +! if (flags & (WSP_BOT | WSP_TOP)) + { + minwidth = frame_minwidth(topframe, NOWIN); + available = topframe->fr_width; + needed += minwidth; + } ++ else if (p_ea) ++ { ++ minwidth = frame_minwidth(oldwin->w_frame, NOWIN); ++ prevfrp = oldwin->w_frame; ++ for (frp = oldwin->w_frame->fr_parent; frp != NULL; ++ frp = frp->fr_parent) ++ { ++ if (frp->fr_layout == FR_ROW) ++ for (frp2 = frp->fr_child; frp2 != NULL; ++ frp2 = frp2->fr_next) ++ if (frp2 != prevfrp) ++ minwidth += frame_minwidth(frp2, NOWIN); ++ prevfrp = frp; ++ } ++ available = topframe->fr_width; ++ needed += minwidth; ++ } + else + { + minwidth = frame_minwidth(oldwin->w_frame, NOWIN); +*************** +*** 798,809 **** + needed = wmh1 + STATUS_HEIGHT; + if (flags & WSP_ROOM) + needed += p_wh - wmh1; +! if (p_ea || (flags & (WSP_BOT | WSP_TOP))) + { + minheight = frame_minheight(topframe, NOWIN) + need_status; + available = topframe->fr_height; + needed += minheight; + } + else + { + minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status; +--- 815,843 ---- + needed = wmh1 + STATUS_HEIGHT; + if (flags & WSP_ROOM) + needed += p_wh - wmh1; +! if (flags & (WSP_BOT | WSP_TOP)) + { + minheight = frame_minheight(topframe, NOWIN) + need_status; + available = topframe->fr_height; + needed += minheight; + } ++ else if (p_ea) ++ { ++ minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status; ++ prevfrp = oldwin->w_frame; ++ for (frp = oldwin->w_frame->fr_parent; frp != NULL; ++ frp = frp->fr_parent) ++ { ++ if (frp->fr_layout == FR_COL) ++ for (frp2 = frp->fr_child; frp2 != NULL; ++ frp2 = frp2->fr_next) ++ if (frp2 != prevfrp) ++ minheight += frame_minheight(frp2, NOWIN); ++ prevfrp = frp; ++ } ++ available = topframe->fr_height; ++ needed += minheight; ++ } + else + { + minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status; +*** ../vim-7.4.376/src/version.c 2014-07-23 13:50:41.839956521 +0200 +--- src/version.c 2014-07-23 15:20:33.227917771 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 377, + /**/ + +-- +LARGE MAN: Who's that then? +CART DRIVER: (Grudgingly) I dunno, Must be a king. +LARGE MAN: Why? +CART DRIVER: He hasn't got shit all over him. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.378 b/7.4.378 new file mode 100644 index 0000000..659f18f --- /dev/null +++ b/7.4.378 @@ -0,0 +1,336 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.378 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.378 +Problem: Title of quickfist list is not kept for setqflist(list, 'r'). +Solution: Keep the title. Add a test. (Lcd) +Files: src/quickfix.c, src/testdir/Make_amiga.mak, + src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, + src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, + src/testdir/Makefile, src/testdir/test_qf_title.in, + src/testdir/test_qf_title.ok + + +*** ../vim-7.4.377/src/quickfix.c 2014-03-27 17:02:22.080660944 +0100 +--- src/quickfix.c 2014-07-23 15:37:30.551910459 +0200 +*************** +*** 107,112 **** +--- 107,113 ---- + }; + + static int qf_init_ext __ARGS((qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title)); ++ static void qf_store_title __ARGS((qf_info_T *qi, char_u *title)); + static void qf_new_list __ARGS((qf_info_T *qi, char_u *qf_title)); + static void ll_free_all __ARGS((qf_info_T **pqi)); + static int qf_add_entry __ARGS((qf_info_T *qi, qfline_T **prevp, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid)); +*************** +*** 126,132 **** + static win_T *qf_find_win __ARGS((qf_info_T *qi)); + static buf_T *qf_find_buf __ARGS((qf_info_T *qi)); + static void qf_update_buffer __ARGS((qf_info_T *qi)); +! static void qf_set_title __ARGS((qf_info_T *qi)); + static void qf_fill_buffer __ARGS((qf_info_T *qi)); + #endif + static char_u *get_mef_name __ARGS((void)); +--- 127,133 ---- + static win_T *qf_find_win __ARGS((qf_info_T *qi)); + static buf_T *qf_find_buf __ARGS((qf_info_T *qi)); + static void qf_update_buffer __ARGS((qf_info_T *qi)); +! static void qf_set_title_var __ARGS((qf_info_T *qi)); + static void qf_fill_buffer __ARGS((qf_info_T *qi)); + #endif + static char_u *get_mef_name __ARGS((void)); +*************** +*** 884,889 **** +--- 885,905 ---- + return retval; + } + ++ static void ++ qf_store_title(qi, title) ++ qf_info_T *qi; ++ char_u *title; ++ { ++ if (title != NULL) ++ { ++ char_u *p = alloc((int)STRLEN(title) + 2); ++ ++ qi->qf_lists[qi->qf_curlist].qf_title = p; ++ if (p != NULL) ++ sprintf((char *)p, ":%s", (char *)title); ++ } ++ } ++ + /* + * Prepare for adding a new quickfix list. + */ +*************** +*** 895,901 **** + int i; + + /* +! * If the current entry is not the last entry, delete entries below + * the current entry. This makes it possible to browse in a tree-like + * way with ":grep'. + */ +--- 911,917 ---- + int i; + + /* +! * If the current entry is not the last entry, delete entries beyond + * the current entry. This makes it possible to browse in a tree-like + * way with ":grep'. + */ +*************** +*** 916,929 **** + else + qi->qf_curlist = qi->qf_listcount++; + vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T))); +! if (qf_title != NULL) +! { +! char_u *p = alloc((int)STRLEN(qf_title) + 2); +! +! qi->qf_lists[qi->qf_curlist].qf_title = p; +! if (p != NULL) +! sprintf((char *)p, ":%s", (char *)qf_title); +! } + } + + /* +--- 932,938 ---- + else + qi->qf_curlist = qi->qf_listcount++; + vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T))); +! qf_store_title(qi, qf_title); + } + + /* +*************** +*** 2444,2450 **** + qf_fill_buffer(qi); + + if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) +! qf_set_title(qi); + + curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index; + curwin->w_cursor.col = 0; +--- 2453,2459 ---- + qf_fill_buffer(qi); + + if (qi->qf_lists[qi->qf_curlist].qf_title != NULL) +! qf_set_title_var(qi); + + curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index; + curwin->w_cursor.col = 0; +*************** +*** 2599,2605 **** + { + curwin_save = curwin; + curwin = win; +! qf_set_title(qi); + curwin = curwin_save; + + } +--- 2608,2614 ---- + { + curwin_save = curwin; + curwin = win; +! qf_set_title_var(qi); + curwin = curwin_save; + + } +*************** +*** 2612,2618 **** + } + + static void +! qf_set_title(qi) + qf_info_T *qi; + { + set_internal_string_var((char_u *)"w:quickfix_title", +--- 2621,2627 ---- + } + + static void +! qf_set_title_var(qi) + qf_info_T *qi; + { + set_internal_string_var((char_u *)"w:quickfix_title", +*************** +*** 3845,3851 **** +--- 3854,3863 ---- + prevp->qf_next != prevp; prevp = prevp->qf_next) + ; + else if (action == 'r') ++ { + qf_free(qi, qi->qf_curlist); ++ qf_store_title(qi, title); ++ } + + for (li = list->lv_first; li != NULL; li = li->li_next) + { +*** ../vim-7.4.377/src/testdir/Make_amiga.mak 2014-07-16 17:01:38.275570568 +0200 +--- src/testdir/Make_amiga.mak 2014-07-23 15:26:51.455915053 +0200 +*************** +*** 40,45 **** +--- 40,46 ---- + test_breakindent.out \ + test_listlbr.out \ + test_listlbr_utf8.out \ ++ test_qf_title.out \ + test_eval.out \ + test_options.out + +*************** +*** 169,173 **** +--- 170,175 ---- + test_breakindent.out: test_breakindent.in + test_listlbr.out: test_listlbr.in + test_listlbr_utf8.out: test_listlbr_utf8.in ++ test_qf_title.out: test_qf_title.in + test_eval.out: test_eval.in + test_options.out: test_options.in +*** ../vim-7.4.377/src/testdir/Make_dos.mak 2014-07-16 17:01:38.279570568 +0200 +--- src/testdir/Make_dos.mak 2014-07-23 15:27:01.231914983 +0200 +*************** +*** 39,44 **** +--- 39,45 ---- + test_breakindent.out \ + test_listlbr.out \ + test_listlbr_utf8.out \ ++ test_qf_title.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.377/src/testdir/Make_ming.mak 2014-07-16 17:01:38.279570568 +0200 +--- src/testdir/Make_ming.mak 2014-07-23 15:27:13.163914897 +0200 +*************** +*** 59,64 **** +--- 59,65 ---- + test_breakindent.out \ + test_listlbr.out \ + test_listlbr_utf8.out \ ++ test_qf_title.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.377/src/testdir/Make_os2.mak 2014-07-16 17:01:38.279570568 +0200 +--- src/testdir/Make_os2.mak 2014-07-23 15:27:25.999914805 +0200 +*************** +*** 40,47 **** + test_autoformat_join.out \ + test_eval.out \ + test_breakindent.out \ +- test_listlbr_utf8.out \ + test_listlbr.out \ + test_options.out + + .SUFFIXES: .in .out +--- 40,48 ---- + test_autoformat_join.out \ + test_eval.out \ + test_breakindent.out \ + test_listlbr.out \ ++ test_listlbr_utf8.out \ ++ test_qf_title.out \ + test_options.out + + .SUFFIXES: .in .out +*** ../vim-7.4.377/src/testdir/Make_vms.mms 2014-07-16 17:01:38.279570568 +0200 +--- src/testdir/Make_vms.mms 2014-07-23 15:27:34.787914741 +0200 +*************** +*** 4,10 **** + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2014 May 28 + # + # 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. +--- 4,10 ---- + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2014 Jul 23 + # + # 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. +*************** +*** 100,105 **** +--- 100,106 ---- + test_breakindent.out \ + test_listlbr.out \ + test_listlbr_utf8.out \ ++ test_qf_title.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.377/src/testdir/Makefile 2014-07-16 17:01:38.279570568 +0200 +--- src/testdir/Makefile 2014-07-23 15:27:46.947914654 +0200 +*************** +*** 37,42 **** +--- 37,43 ---- + test_breakindent.out \ + test_listlbr.out \ + test_listlbr_utf8.out \ ++ test_qf_title.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.377/src/testdir/test_qf_title.in 2014-07-23 15:53:26.279903590 +0200 +--- src/testdir/test_qf_title.in 2014-07-23 15:26:02.495915405 +0200 +*************** +*** 0 **** +--- 1,18 ---- ++ Tests for quickfix window's title vim: set ft=vim : ++ ++ STARTTEST ++ :so small.vim ++ :if !has('quickfix') | e! test.ok | wq! test.out | endif ++ :set efm=%E%f:%l:%c:%m ++ :cgetexpr ['file:1:1:message'] ++ :let qflist=getqflist() ++ :call setqflist(qflist, 'r') ++ :copen ++ :let g:quickfix_title=w:quickfix_title ++ :wincmd p ++ :$put =g:quickfix_title ++ :/^Results/,$w test.out ++ :qa! ++ ENDTEST ++ ++ Results of test_qf_title: +*** ../vim-7.4.377/src/testdir/test_qf_title.ok 2014-07-23 15:53:26.283903590 +0200 +--- src/testdir/test_qf_title.ok 2014-07-23 15:25:55.303915456 +0200 +*************** +*** 0 **** +--- 1,2 ---- ++ Results of test_qf_title: ++ :setqflist() +*** ../vim-7.4.377/src/version.c 2014-07-23 15:21:16.247917462 +0200 +--- src/version.c 2014-07-23 15:28:57.251914149 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 378, + /**/ + +-- +ARTHUR: Old woman! +DENNIS: Man! +ARTHUR: Man. I'm sorry. Old man, What knight live in that castle over there? +DENNIS: I'm thirty-seven. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.379 b/7.4.379 new file mode 100644 index 0000000..79d8593 --- /dev/null +++ b/7.4.379 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.379 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.379 +Problem: Accessing freed memory after using setqflist(list, 'r'). (Lcd) +Solution: Reset qf_index. +Files: src/quickfix.c + + +*** ../vim-7.4.378/src/quickfix.c 2014-07-23 15:54:43.443903036 +0200 +--- src/quickfix.c 2014-07-23 16:11:59.915895586 +0200 +*************** +*** 2173,2178 **** +--- 2173,2179 ---- + } + vim_free(qi->qf_lists[idx].qf_title); + qi->qf_lists[idx].qf_title = NULL; ++ qi->qf_lists[idx].qf_index = 0; + } + + /* +*** ../vim-7.4.378/src/version.c 2014-07-23 15:54:43.443903036 +0200 +--- src/version.c 2014-07-23 16:14:43.995894407 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 379, + /**/ + +-- +"Lisp has all the visual appeal of oatmeal with nail clippings thrown in." + -- Larry Wall + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.380 b/7.4.380 new file mode 100644 index 0000000..8c93e07 --- /dev/null +++ b/7.4.380 @@ -0,0 +1,115 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.380 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.380 +Problem: Loading python may cause Vim to exit. +Solution: Avoid loading the "site" module. (Taro Muraoka) +Files: src/if_python.c + + +*** ../vim-7.4.379/src/if_python.c 2014-03-30 16:11:37.176530823 +0200 +--- src/if_python.c 2014-07-23 16:46:42.863880615 +0200 +*************** +*** 295,300 **** +--- 295,303 ---- + # define PyCObject_FromVoidPtr dll_PyCObject_FromVoidPtr + # define PyCObject_AsVoidPtr dll_PyCObject_AsVoidPtr + # endif ++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 ++ # define Py_NoSiteFlag (*dll_Py_NoSiteFlag) ++ # endif + + /* + * Pointers for dynamic link +*************** +*** 440,445 **** +--- 443,451 ---- + static PyObject* (*dll_PyCObject_FromVoidPtr)(void *cobj, void (*destr)(void *)); + static void* (*dll_PyCObject_AsVoidPtr)(PyObject *); + # endif ++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 ++ static int* dll_Py_NoSiteFlag; ++ # endif + + static HINSTANCE hinstPython = 0; /* Instance of python.dll */ + +*************** +*** 633,638 **** +--- 639,647 ---- + {"PyCObject_FromVoidPtr", (PYTHON_PROC*)&dll_PyCObject_FromVoidPtr}, + {"PyCObject_AsVoidPtr", (PYTHON_PROC*)&dll_PyCObject_AsVoidPtr}, + # endif ++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 ++ {"Py_NoSiteFlag", (PYTHON_PROC*)&dll_Py_NoSiteFlag}, ++ # endif + {"", NULL}, + }; + +*************** +*** 901,906 **** +--- 910,919 ---- + { + if (!initialised) + { ++ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 ++ PyObject *site; ++ #endif ++ + #ifdef DYNAMIC_PYTHON + if (!python_enabled(TRUE)) + { +*************** +*** 915,925 **** +--- 928,956 ---- + + init_structs(); + ++ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 ++ /* Disable implicit 'import site', because it may cause Vim to exit ++ * when it can't be found. */ ++ Py_NoSiteFlag++; ++ #endif ++ + #if !defined(MACOS) || defined(MACOS_X_UNIX) + Py_Initialize(); + #else + PyMac_Initialize(); + #endif ++ ++ #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 ++ /* 'import site' explicitly. */ ++ site = PyImport_ImportModule("site"); ++ if (site == NULL) ++ { ++ EMSG(_("E887: Sorry, this command is disabled, the Python's site module could not be loaded.")); ++ goto fail; ++ } ++ Py_DECREF(site); ++ #endif ++ + /* Initialise threads, and below save the state using + * PyEval_SaveThread. Without the call to PyEval_SaveThread, thread + * specific state (such as the system trace hook), will be lost +*** ../vim-7.4.379/src/version.c 2014-07-23 16:33:04.079886500 +0200 +--- src/version.c 2014-07-23 16:43:47.939881872 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 380, + /**/ + +-- +Looking at Perl through Lisp glasses, Perl looks atrocious. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.381 b/7.4.381 new file mode 100644 index 0000000..188124e --- /dev/null +++ b/7.4.381 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.381 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.381 +Problem: Get u_undo error when backspacing in Insert mode deletes more than + one line break. (Ayberk Ozgur) +Solution: Also decrement Insstart.lnum. +Files: src/edit.c + + +*** ../vim-7.4.380/src/edit.c 2014-07-23 13:50:41.839956521 +0200 +--- src/edit.c 2014-07-23 17:35:05.747859751 +0200 +*************** +*** 8833,8838 **** +--- 8833,8839 ---- + return FALSE; + --Insstart_orig.lnum; + Insstart_orig.col = MAXCOL; ++ Insstart = Insstart_orig; + } + /* + * In replace mode: +*** ../vim-7.4.380/src/version.c 2014-07-23 16:56:56.587876204 +0200 +--- src/version.c 2014-07-23 17:38:54.467858107 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 381, + /**/ + +-- +Friends? I have lots of friends! In fact, I have all episodes ever made. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.382 b/7.4.382 new file mode 100644 index 0000000..e1ca90b --- /dev/null +++ b/7.4.382 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.382 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.382 +Problem: Mapping characters may not work after typing Esc in Insert mode. +Solution: Fix the noremap flags for inserted characters. (Jacob Niehus) +Files: src/getchar.c + + +*** ../vim-7.4.381/src/getchar.c 2014-06-25 14:39:35.102348584 +0200 +--- src/getchar.c 2014-07-23 20:10:25.651792765 +0200 +*************** +*** 2731,2736 **** +--- 2731,2741 ---- + } + if (c < 0) + continue; /* end of input script reached */ ++ ++ /* Allow mapping for just typed characters. When we get here c ++ * is the number of extra bytes and typebuf.tb_len is 1. */ ++ for (n = 1; n <= c; ++n) ++ typebuf.tb_noremap[typebuf.tb_off + n] = RM_YES; + typebuf.tb_len += c; + + /* buffer full, don't map */ +*** ../vim-7.4.381/src/version.c 2014-07-23 17:39:21.815857910 +0200 +--- src/version.c 2014-07-23 18:26:42.663837492 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 382, + /**/ + +-- +DENNIS: Oh, very nice. King, eh! I expect you've got a palace and fine + clothes and courtiers and plenty of food. And how d'you get that? By + exploiting the workers! By hanging on to outdated imperialist dogma + which perpetuates the social and economic differences in our society! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.383 b/7.4.383 new file mode 100644 index 0000000..f022812 --- /dev/null +++ b/7.4.383 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.383 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.383 +Problem: Bad interaction between preview window and omnifunc. +Solution: Avoid redrawing the status line. (Hirohito Higashi) +Files: src/popupmnu.c + + +*** ../vim-7.4.382/src/popupmnu.c 2014-07-09 19:58:21.111647328 +0200 +--- src/popupmnu.c 2014-07-23 20:56:17.131772989 +0200 +*************** +*** 643,648 **** +--- 643,654 ---- + + if (curwin != curwin_save && win_valid(curwin_save)) + { ++ /* When the first completion is done and the preview ++ * window is not resized, skip the preview window's ++ * status line redrawing. */ ++ if (ins_compl_active() && !resized) ++ curwin->w_redr_status = FALSE; ++ + /* Return cursor to where we were */ + validate_cursor(); + redraw_later(SOME_VALID); +*** ../vim-7.4.382/src/version.c 2014-07-23 20:41:09.895779510 +0200 +--- src/version.c 2014-07-23 20:58:12.079772163 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 383, + /**/ + +-- +ARTHUR: ... and I am your king .... +OLD WOMAN: Ooooh! I didn't know we had a king. I thought we were an + autonomous collective ... + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.384 b/7.4.384 new file mode 100644 index 0000000..6c2b046 --- /dev/null +++ b/7.4.384 @@ -0,0 +1,47 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.384 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.384 +Problem: Test 102 fails when compiled with small features. +Solution: Source small.vim. (Jacob Niehus) +Files: src/testdir/test102.in + + +*** ../vim-7.4.383/src/testdir/test102.in 2013-11-12 05:28:08.000000000 +0100 +--- src/testdir/test102.in 2014-07-27 21:10:34.881282860 +0200 +*************** +*** 1,6 **** +--- 1,7 ---- + Test if fnameescape is correct for special chars like ! + + STARTTEST ++ :so small.vim + :%d + :let fname = 'Xspa ce' + :try | exe "w! " . fnameescape(fname) | put='Space' | endtry +*** ../vim-7.4.383/src/version.c 2014-07-23 21:10:39.867766788 +0200 +--- src/version.c 2014-07-30 13:15:18.047624849 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 384, + /**/ + +-- +An easy way to determine if you have enough teamwork to be doomed is simply to +measure how long it takes from the time you decide to go to lunch together +until the time you actually eat. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.385 b/7.4.385 new file mode 100644 index 0000000..8cfe098 --- /dev/null +++ b/7.4.385 @@ -0,0 +1,76 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.385 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.385 +Problem: When building with tiny or small features building the .mo files + fails. +Solution: In autoconf do not setup for building the .mo files when it would + fail. +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.4.384/src/configure.in 2014-05-22 14:44:08.094481148 +0200 +--- src/configure.in 2014-07-27 21:26:39.349275928 +0200 +*************** +*** 3818,3824 **** + else + AC_MSG_RESULT([msgfmt not found - disabled]); + fi +! if test $have_gettext = "yes"; then + AC_DEFINE(HAVE_GETTEXT) + MAKEMO=yes + AC_SUBST(MAKEMO) +--- 3818,3824 ---- + else + AC_MSG_RESULT([msgfmt not found - disabled]); + fi +! if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then + AC_DEFINE(HAVE_GETTEXT) + MAKEMO=yes + AC_SUBST(MAKEMO) +*** ../vim-7.4.384/src/auto/configure 2014-05-22 14:44:08.098481148 +0200 +--- src/auto/configure 2014-07-27 21:26:41.969275909 +0200 +*************** +*** 12966,12972 **** + { $as_echo "$as_me:${as_lineno-$LINENO}: result: msgfmt not found - disabled" >&5 + $as_echo "msgfmt not found - disabled" >&6; }; + fi +! if test $have_gettext = "yes"; then + $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + MAKEMO=yes +--- 12966,12972 ---- + { $as_echo "$as_me:${as_lineno-$LINENO}: result: msgfmt not found - disabled" >&5 + $as_echo "msgfmt not found - disabled" >&6; }; + fi +! if test $have_gettext = "yes" -a "x$features" != "xtiny" -a "x$features" != "xsmall"; then + $as_echo "#define HAVE_GETTEXT 1" >>confdefs.h + + MAKEMO=yes +*** ../vim-7.4.384/src/version.c 2014-07-30 13:20:35.719622565 +0200 +--- src/version.c 2014-07-30 13:22:07.295621907 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 385, + /**/ + +-- +"You're fired." (1980) +"You're laid off." (1985) +"You're downsized." (1990) +"You're rightsized." (1992) + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.386 b/7.4.386 new file mode 100644 index 0000000..2b0db1f --- /dev/null +++ b/7.4.386 @@ -0,0 +1,186 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.386 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.386 +Problem: When splitting a window the changelist position is wrong. +Solution: Copy the changelist position. (Jacob Niehus) +Files: src/window.c, src/testdir/Make_amiga.mak, + src/testdir/Make_dos.mak, src/testdir/Make_ming.mak, + src/testdir/Make_os2.mak, src/testdir/Make_vms.mms, + src/testdir/Makefile, src/testdir/test_changelist.in, + src/testdir/test_changelist.ok + + +*** ../vim-7.4.385/src/window.c 2014-07-23 15:21:16.247917462 +0200 +--- src/window.c 2014-07-30 13:55:49.275607374 +0200 +*************** +*** 1178,1183 **** +--- 1178,1188 ---- + p_wh = size; + } + ++ #ifdef FEAT_JUMPLIST ++ /* Keep same changelist position in new window. */ ++ wp->w_changelistidx = oldwin->w_changelistidx; ++ #endif ++ + /* + * make the new window the current window + */ +*** ../vim-7.4.385/src/testdir/Make_amiga.mak 2014-07-23 15:54:43.443903036 +0200 +--- src/testdir/Make_amiga.mak 2014-07-30 13:54:06.871608110 +0200 +*************** +*** 41,46 **** +--- 41,47 ---- + test_listlbr.out \ + test_listlbr_utf8.out \ + test_qf_title.out \ ++ test_changelist.out \ + test_eval.out \ + test_options.out + +*************** +*** 171,175 **** +--- 172,177 ---- + test_listlbr.out: test_listlbr.in + test_listlbr_utf8.out: test_listlbr_utf8.in + test_qf_title.out: test_qf_title.in ++ test_changelist.out: test_changelist.in + test_eval.out: test_eval.in + test_options.out: test_options.in +*** ../vim-7.4.385/src/testdir/Make_dos.mak 2014-07-23 15:54:43.443903036 +0200 +--- src/testdir/Make_dos.mak 2014-07-30 13:54:16.091608044 +0200 +*************** +*** 40,45 **** +--- 40,46 ---- + test_listlbr.out \ + test_listlbr_utf8.out \ + test_qf_title.out \ ++ test_changelist.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.385/src/testdir/Make_ming.mak 2014-07-23 15:54:43.443903036 +0200 +--- src/testdir/Make_ming.mak 2014-07-30 13:54:19.775608018 +0200 +*************** +*** 60,65 **** +--- 60,66 ---- + test_listlbr.out \ + test_listlbr_utf8.out \ + test_qf_title.out \ ++ test_changelist.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.385/src/testdir/Make_os2.mak 2014-07-23 15:54:43.443903036 +0200 +--- src/testdir/Make_os2.mak 2014-07-30 13:54:24.207607986 +0200 +*************** +*** 38,43 **** +--- 38,44 ---- + test100.out test101.out test102.out test103.out test104.out \ + test105.out test106.out test107.out \ + test_autoformat_join.out \ ++ test_changelist.out \ + test_eval.out \ + test_breakindent.out \ + test_listlbr.out \ +*** ../vim-7.4.385/src/testdir/Make_vms.mms 2014-07-23 15:54:43.443903036 +0200 +--- src/testdir/Make_vms.mms 2014-07-30 13:54:31.151607936 +0200 +*************** +*** 4,10 **** + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2014 Jul 23 + # + # 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. +--- 4,10 ---- + # Authors: Zoltan Arpadffy, + # Sandor Kopanyi, + # +! # Last change: 2014 Jul 30 + # + # 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,106 **** +--- 101,107 ---- + test_listlbr.out \ + test_listlbr_utf8.out \ + test_qf_title.out \ ++ test_changelist.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.385/src/testdir/Makefile 2014-07-23 15:54:43.443903036 +0200 +--- src/testdir/Makefile 2014-07-30 13:54:45.291607834 +0200 +*************** +*** 38,43 **** +--- 38,44 ---- + test_listlbr.out \ + test_listlbr_utf8.out \ + test_qf_title.out \ ++ test_changelist.out \ + test_eval.out \ + test_options.out + +*** ../vim-7.4.385/src/testdir/test_changelist.in 2014-07-30 14:04:27.507603650 +0200 +--- src/testdir/test_changelist.in 2014-07-30 13:52:21.363608869 +0200 +*************** +*** 0 **** +--- 1,22 ---- ++ Test changelist position after splitting window ++ Set 'undolevels' to make changelist for sourced file ++ ++ STARTTEST ++ :so small.vim ++ Gkylp:set ul=100 ++ Gylp:set ul=100 ++ gg ++ :vsplit ++ :try ++ : normal g; ++ : normal ggVGcpass ++ :catch ++ : normal ggVGcfail ++ :finally ++ : %w! test.out ++ :endtry ++ :qa! ++ ENDTEST ++ ++ 1 ++ 2 +*** ../vim-7.4.385/src/testdir/test_changelist.ok 2014-07-30 14:04:27.515603650 +0200 +--- src/testdir/test_changelist.ok 2014-07-30 13:53:41.991608289 +0200 +*************** +*** 0 **** +--- 1 ---- ++ pass +*** ../vim-7.4.385/src/version.c 2014-07-30 13:22:48.271621613 +0200 +--- src/version.c 2014-07-30 13:56:49.951606938 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 386, + /**/ + +-- +Our job was to build a computer information system for the branch banks. We +were the perfect people for the job: Dean had seen a computer once, and I had +heard Dean talk about it. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.387 b/7.4.387 new file mode 100644 index 0000000..ff0b2a0 --- /dev/null +++ b/7.4.387 @@ -0,0 +1,199 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.387 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.387 +Problem: "4gro" replaces one character then executes "ooo". (Urtica Dioica) +Solution: Write the ESC in the second stuff buffer. +Files: src/getchar.c, src/proto/getchar.pro, src/edit.c, + src/testdir/Make_amiga.mak, src/testdir/Make_dos.mak, + src/testdir/Make_ming.mak, src/testdir/Make_os2.mak, + src/testdir/Make_vms.mms, src/testdir/Makefile, + src/testdir/test_insertcount.in, src/testdir/test_insertcount.ok + + +*** ../vim-7.4.386/src/getchar.c 2014-07-23 20:41:09.891779510 +0200 +--- src/getchar.c 2014-07-30 14:35:08.831590415 +0200 +*************** +*** 678,683 **** +--- 678,694 ---- + add_buff(&readbuf1, s, -1L); + } + ++ /* ++ * Append string "s" to the redo stuff buffer. ++ * CSI and K_SPECIAL must already have been escaped. ++ */ ++ void ++ stuffRedoReadbuff(s) ++ char_u *s; ++ { ++ add_buff(&readbuf2, s, -1L); ++ } ++ + void + stuffReadbuffLen(s, len) + char_u *s; +*** ../vim-7.4.386/src/proto/getchar.pro 2014-02-11 15:10:38.134111836 +0100 +--- src/proto/getchar.pro 2014-07-30 14:36:18.851589912 +0200 +*************** +*** 15,20 **** +--- 15,21 ---- + void AppendCharToRedobuff __ARGS((int c)); + void AppendNumberToRedobuff __ARGS((long n)); + void stuffReadbuff __ARGS((char_u *s)); ++ void stuffRedoReadbuff __ARGS((char_u *s)); + void stuffReadbuffLen __ARGS((char_u *s, long len)); + void stuffReadbuffSpec __ARGS((char_u *s)); + void stuffcharReadbuff __ARGS((int c)); +*** ../vim-7.4.386/src/edit.c 2014-07-23 17:39:21.815857910 +0200 +--- src/edit.c 2014-07-30 14:47:56.875584895 +0200 +*************** +*** 8389,8395 **** + + (void)start_redo_ins(); + if (cmdchar == 'r' || cmdchar == 'v') +! stuffReadbuff(ESC_STR); /* no ESC in redo buffer */ + ++RedrawingDisabled; + disabled_redraw = TRUE; + return FALSE; /* repeat the insert */ +--- 8389,8395 ---- + + (void)start_redo_ins(); + if (cmdchar == 'r' || cmdchar == 'v') +! stuffRedoReadbuff(ESC_STR); /* no ESC in redo buffer */ + ++RedrawingDisabled; + disabled_redraw = TRUE; + return FALSE; /* repeat the insert */ +*** ../vim-7.4.386/src/testdir/Make_amiga.mak 2014-07-30 14:04:49.131603494 +0200 +--- src/testdir/Make_amiga.mak 2014-07-30 15:57:52.819554737 +0200 +*************** +*** 43,48 **** +--- 43,49 ---- + test_qf_title.out \ + test_changelist.out \ + test_eval.out \ ++ test_insertcount.out \ + test_options.out + + .SUFFIXES: .in .out +*************** +*** 174,177 **** +--- 175,179 ---- + test_qf_title.out: test_qf_title.in + test_changelist.out: test_changelist.in + test_eval.out: test_eval.in ++ test_insertcount.out: test_insertcount.in + test_options.out: test_options.in +*** ../vim-7.4.386/src/testdir/Make_dos.mak 2014-07-30 14:04:49.131603494 +0200 +--- src/testdir/Make_dos.mak 2014-07-30 15:57:59.071554692 +0200 +*************** +*** 42,47 **** +--- 42,48 ---- + test_qf_title.out \ + test_changelist.out \ + test_eval.out \ ++ test_insertcount.out \ + test_options.out + + SCRIPTS32 = test50.out test70.out +*** ../vim-7.4.386/src/testdir/Make_ming.mak 2014-07-30 14:04:49.131603494 +0200 +--- src/testdir/Make_ming.mak 2014-07-30 15:58:02.351554669 +0200 +*************** +*** 62,67 **** +--- 62,68 ---- + test_qf_title.out \ + test_changelist.out \ + test_eval.out \ ++ test_insertcount.out \ + test_options.out + + SCRIPTS32 = test50.out test70.out +*** ../vim-7.4.386/src/testdir/Make_os2.mak 2014-07-30 14:04:49.131603494 +0200 +--- src/testdir/Make_os2.mak 2014-07-30 15:58:05.975554643 +0200 +*************** +*** 40,45 **** +--- 40,46 ---- + test_autoformat_join.out \ + test_changelist.out \ + test_eval.out \ ++ test_insertcount.out \ + test_breakindent.out \ + test_listlbr.out \ + test_listlbr_utf8.out \ +*** ../vim-7.4.386/src/testdir/Make_vms.mms 2014-07-30 14:04:49.131603494 +0200 +--- src/testdir/Make_vms.mms 2014-07-30 15:58:10.099554613 +0200 +*************** +*** 103,108 **** +--- 103,109 ---- + test_qf_title.out \ + test_changelist.out \ + test_eval.out \ ++ test_insertcount.out \ + test_options.out + + # Known problems: +*** ../vim-7.4.386/src/testdir/Makefile 2014-07-30 14:04:49.131603494 +0200 +--- src/testdir/Makefile 2014-07-30 15:58:16.539554567 +0200 +*************** +*** 40,45 **** +--- 40,46 ---- + test_qf_title.out \ + test_changelist.out \ + test_eval.out \ ++ test_insertcount.out \ + test_options.out + + SCRIPTS_GUI = test16.out +*** ../vim-7.4.386/src/testdir/test_insertcount.in 2014-07-30 15:56:12.087555461 +0200 +--- src/testdir/test_insertcount.in 2014-07-30 14:47:36.335585043 +0200 +*************** +*** 0 **** +--- 1,14 ---- ++ Tests for repeating insert and replace. ++ ++ STARTTEST ++ :so small.vim ++ :/Second ++ 4gro ++ :/^First/,$wq! test.out ++ :" get here when failed and in Insert mode ++ :.wq! test.out ++ ENDTEST ++ ++ First line ++ Second line ++ Last line +*** ../vim-7.4.386/src/testdir/test_insertcount.ok 2014-07-30 15:56:12.091555461 +0200 +--- src/testdir/test_insertcount.ok 2014-07-30 14:45:43.491585854 +0200 +*************** +*** 0 **** +--- 1,3 ---- ++ First line ++ ooooecond line ++ Last line +*** ../vim-7.4.386/src/version.c 2014-07-30 14:04:49.131603494 +0200 +--- src/version.c 2014-07-30 14:48:45.039584549 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 387, + /**/ + +-- +If your company is not involved in something called "ISO 9000" you probably +have no idea what it is. If your company _is_ involved in ISO 9000 then you +definitely have no idea what it is. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.388 b/7.4.388 new file mode 100644 index 0000000..21db642 --- /dev/null +++ b/7.4.388 @@ -0,0 +1,98 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.388 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.388 +Problem: With 'linebreak' set and 'list' unset a Tab is not counted + properly. (Kent Sibilev) +Solution: Check the 'list' option. (Christian Brabandt) +Files: src/screen.c, src/testdir/test_listlbr_utf8.in, + src/testdir/test_listlbr_utf8.ok + + +*** ../vim-7.4.387/src/screen.c 2014-07-16 17:29:46.691536252 +0200 +--- src/screen.c 2014-07-30 16:41:15.167536033 +0200 +*************** +*** 4494,4500 **** + tab_len = (int)wp->w_buffer->b_p_ts + - vcol % (int)wp->w_buffer->b_p_ts - 1; + #ifdef FEAT_LINEBREAK +! if (!wp->w_p_lbr) + #endif + /* tab amount depends on current column */ + n_extra = tab_len; +--- 4494,4500 ---- + tab_len = (int)wp->w_buffer->b_p_ts + - vcol % (int)wp->w_buffer->b_p_ts - 1; + #ifdef FEAT_LINEBREAK +! if (!wp->w_p_lbr || !wp->w_p_list) + #endif + /* tab amount depends on current column */ + n_extra = tab_len; +*** ../vim-7.4.387/src/testdir/test_listlbr_utf8.in 2014-07-16 17:01:38.279570568 +0200 +--- src/testdir/test_listlbr_utf8.in 2014-07-30 16:37:26.703537675 +0200 +*************** +*** 30,40 **** +--- 30,51 ---- + :redraw! + :let line=ScreenChar(winwidth(0)) + :call DoRecordScreen() ++ :" + :let g:test ="Test 2: set nolinebreak list" + :set list nolinebreak + :redraw! + :let line=ScreenChar(winwidth(0)) + :call DoRecordScreen() ++ :" ++ :let g:test ="Test 3: set linebreak nolist" ++ :$put =\"\t*mask = nil;\" ++ :$ ++ :norm! zt ++ :set nolist linebreak ++ :redraw! ++ :let line=ScreenChar(winwidth(0)) ++ :call DoRecordScreen() ++ :" + :%w! test.out + :qa! + ENDTEST +*** ../vim-7.4.387/src/testdir/test_listlbr_utf8.ok 2014-07-16 17:01:38.279570568 +0200 +--- src/testdir/test_listlbr_utf8.ok 2014-07-30 16:40:17.043536451 +0200 +*************** +*** 12,14 **** +--- 12,21 ---- + +pqrstuvwxyz␣1060ABC + +DEFGHIJKLMNOPˑ¶ + ¶ ++ *mask = nil; ++ ++ Test 3: set linebreak nolist ++ *mask = nil; ++ ~ ++ ~ ++ ~ +*** ../vim-7.4.387/src/version.c 2014-07-30 16:00:45.551553496 +0200 +--- src/version.c 2014-07-30 16:40:57.659536159 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 388, + /**/ + +-- +You can test a person's importance in the organization by asking how much RAM +his computer has. Anybody who knows the answer to that question is not a +decision-maker. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.389 b/7.4.389 new file mode 100644 index 0000000..6778941 --- /dev/null +++ b/7.4.389 @@ -0,0 +1,490 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.389 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.389 +Problem: Still sometimes Vim enters Replace mode when starting up. +Solution: Use a different solution in detecting the termresponse and + location response. (Hayaki Saito) +Files: src/globals.h, src/os_unix.c, src/term.c, src/proto/term.pro + + +*** ../vim-7.4.388/src/globals.h 2014-06-12 14:01:27.575769788 +0200 +--- src/globals.h 2014-07-30 17:02:57.711526671 +0200 +*************** +*** 1336,1344 **** + #if defined(UNIX) || defined(VMS) + EXTERN int term_is_xterm INIT(= FALSE); /* xterm-like 'term' */ + #endif +- #if defined(UNIX) +- EXTERN int xterm_conflict_mouse INIT(= FALSE); +- #endif + + #ifdef BACKSLASH_IN_FILENAME + EXTERN char psepc INIT(= '\\'); /* normal path separator character */ +--- 1336,1341 ---- +*** ../vim-7.4.388/src/os_unix.c 2014-07-09 19:13:45.007701718 +0200 +--- src/os_unix.c 2014-07-30 17:06:02.375525344 +0200 +*************** +*** 3667,3674 **** + void + check_mouse_termcode() + { +- xterm_conflict_mouse = FALSE; +- + # ifdef FEAT_MOUSE_XTERM + if (use_xterm_mouse() + # ifdef FEAT_MOUSE_URXVT +--- 3667,3672 ---- +*************** +*** 3713,3719 **** + # endif + + # ifdef FEAT_MOUSE_JSB +! /* There is no conflict, but it was disabled for xterm before. */ + if (!use_xterm_mouse() + # ifdef FEAT_GUI + && !gui.in_use +--- 3711,3717 ---- + # endif + + # ifdef FEAT_MOUSE_JSB +! /* Conflicts with xterm mouse: "\033[" and "\033[M" ??? */ + if (!use_xterm_mouse() + # ifdef FEAT_GUI + && !gui.in_use +*************** +*** 3740,3784 **** + # endif + + # ifdef FEAT_MOUSE_DEC +! /* Conflicts with xterm mouse: "\033[" and "\033[M". +! * Also conflicts with the xterm termresponse, skip this if it was +! * requested already. */ + if (!use_xterm_mouse() +- # ifdef FEAT_TERMRESPONSE +- && !did_request_esc_sequence() +- # endif + # ifdef FEAT_GUI + && !gui.in_use + # endif + ) +- { + set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME) + ? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "["))); +- xterm_conflict_mouse = TRUE; +- } + else + del_mouse_termcode(KS_DEC_MOUSE); + # endif + # ifdef FEAT_MOUSE_PTERM +! /* same as the dec mouse */ + if (!use_xterm_mouse() +- # ifdef FEAT_TERMRESPONSE +- && !did_request_esc_sequence() +- # endif + # ifdef FEAT_GUI + && !gui.in_use + # endif + ) +- { + set_mouse_termcode(KS_PTERM_MOUSE, + (char_u *) IF_EB("\033[", ESC_STR "[")); +- xterm_conflict_mouse = TRUE; +- } + else + del_mouse_termcode(KS_PTERM_MOUSE); + # endif + # ifdef FEAT_MOUSE_URXVT +! /* same as the dec mouse */ + if (use_xterm_mouse() == 3 + # ifdef FEAT_GUI + && !gui.in_use +--- 3738,3768 ---- + # endif + + # ifdef FEAT_MOUSE_DEC +! /* Conflicts with xterm mouse: "\033[" and "\033[M" */ + if (!use_xterm_mouse() + # ifdef FEAT_GUI + && !gui.in_use + # endif + ) + set_mouse_termcode(KS_DEC_MOUSE, (char_u *)(term_is_8bit(T_NAME) + ? IF_EB("\233", CSI_STR) : IF_EB("\033[", ESC_STR "["))); + else + del_mouse_termcode(KS_DEC_MOUSE); + # endif + # ifdef FEAT_MOUSE_PTERM +! /* same conflict as the dec mouse */ + if (!use_xterm_mouse() + # ifdef FEAT_GUI + && !gui.in_use + # endif + ) + set_mouse_termcode(KS_PTERM_MOUSE, + (char_u *) IF_EB("\033[", ESC_STR "[")); + else + del_mouse_termcode(KS_PTERM_MOUSE); + # endif + # ifdef FEAT_MOUSE_URXVT +! /* same conflict as the dec mouse */ + if (use_xterm_mouse() == 3 + # ifdef FEAT_GUI + && !gui.in_use +*************** +*** 3794,3801 **** + mch_setmouse(FALSE); + setmouse(); + } +- /* It's OK to request the xterm version for uxterm. */ +- resume_get_esc_sequence(); + } + else + del_mouse_termcode(KS_URXVT_MOUSE); +--- 3778,3783 ---- +*** ../vim-7.4.388/src/term.c 2014-07-09 20:51:04.519583033 +0200 +--- src/term.c 2014-07-30 17:20:54.915518929 +0200 +*************** +*** 153,163 **** + static char_u *vim_tgetstr __ARGS((char *s, char_u **pp)); + #endif /* HAVE_TGETENT */ + +- #if defined(FEAT_TERMRESPONSE) +- static int xt_index_in = 0; +- static int xt_index_out = 0; +- #endif +- + static int detected_8bit = FALSE; /* detected 8-bit terminal */ + + static struct builtin_term builtin_termcaps[] = +--- 153,158 ---- +*************** +*** 3312,3351 **** + } + + #if defined(FEAT_TERMRESPONSE) || defined(PROTO) +- # if defined(UNIX) || defined(PROTO) +- /* +- * Return TRUE when the xterm version was requested or anything else that +- * would send an ESC sequence back to Vim. +- * If not sent yet, prevent it from being sent soon. +- * Used to check whether it is OK to enable checking for DEC mouse codes, +- * which conflict with may xterm ESC sequences. +- */ +- int +- did_request_esc_sequence() +- { +- if (crv_status == CRV_GET) +- crv_status = 0; +- if (u7_status == U7_GET) +- u7_status = 0; +- return crv_status == CRV_SENT || u7_status == U7_SENT +- || xt_index_out > xt_index_in; +- } +- +- /* +- * If requesting the version was disabled in did_request_esc_sequence(), +- * enable it again. +- */ +- void +- resume_get_esc_sequence() +- { +- if (crv_status == 0) +- crv_status = CRV_GET; +- if (u7_status == 0) +- u7_status = U7_GET; +- } +- # endif +- +- + /* + * Request version string (for xterm) when needed. + * Only do this after switching to raw mode, otherwise the result will be +--- 3307,3312 ---- +*************** +*** 3358,3365 **** + * Insert mode. + * On Unix only do it when both output and input are a tty (avoid writing + * request to terminal while reading from a file). +- * Do not do this when a mouse is being detected that starts with the same ESC +- * sequence as the termresponse. + * The result is caught in check_termcode(). + */ + void +--- 3319,3324 ---- +*************** +*** 3373,3379 **** + # ifdef UNIX + && isatty(1) + && isatty(read_cmd_fd) +- && !xterm_conflict_mouse + # endif + && *T_CRV != NUL) + { +--- 3332,3337 ---- +*************** +*** 3742,3749 **** + #if defined(WIN3264) && !defined(FEAT_GUI) + if (s[0] == K_NUL) + { +! STRMOVE(s + 1, s); +! s[1] = 3; + } + #endif + +--- 3700,3707 ---- + #if defined(WIN3264) && !defined(FEAT_GUI) + if (s[0] == K_NUL) + { +! STRMOVE(s + 1, s); +! s[1] = 3; + } + #endif + +*************** +*** 4212,4235 **** + + #ifdef FEAT_TERMRESPONSE + if (key_name[0] == NUL +! /* URXVT mouse uses [#;#;#M, but we are matching [ */ + || key_name[0] == KS_URXVT_MOUSE +- # ifdef FEAT_MBYTE +- || u7_status == U7_SENT + # endif +! ) + { +! /* Check for some responses from terminal start with "[" or +! * CSI. + * +! * - xterm version string: [>{x};{vers};{y}c + * Also eat other possible responses to t_RV, rxvt returns + * "[?1;2c". Also accept CSI instead of [. + * mrxvt has been reported to have "+" in the version. Assume + * the escape sequence ends with a letter or one of "{|}~". + * +! * - cursor position report: [{row};{col}R +! * The final byte is 'R'. now it is only used for checking for + * ambiguous-width character state. + */ + p = tp[0] == CSI ? tp + 1 : tp + 2; +--- 4170,4200 ---- + + #ifdef FEAT_TERMRESPONSE + if (key_name[0] == NUL +! /* Mouse codes of DEC, pterm, and URXVT start with [. When +! * detecting the start of these mouse codes they might as well be +! * another key code or terminal response. */ +! # ifdef FEAT_MOUSE_DEC +! || key_name[0] == KS_DEC_MOUSE +! # endif +! # ifdef FEAT_MOUSE_PTERM +! || key_name[0] == KS_PTERM_MOUSE +! # endif +! # ifdef FEAT_MOUSE_URXVT + || key_name[0] == KS_URXVT_MOUSE + # endif +! ) + { +! /* Check for some responses from the terminal starting with +! * "[" or CSI: + * +! * - Xterm version string: [>{x};{vers};{y}c + * Also eat other possible responses to t_RV, rxvt returns + * "[?1;2c". Also accept CSI instead of [. + * mrxvt has been reported to have "+" in the version. Assume + * the escape sequence ends with a letter or one of "{|}~". + * +! * - Cursor position report: [{row};{col}R +! * The final byte must be 'R'. It is used for checking the + * ambiguous-width character state. + */ + p = tp[0] == CSI ? tp + 1 : tp + 2; +*************** +*** 4269,4304 **** + * u7_status is not "sent", it may be from a previous Vim that + * just exited. But not for , it sends something + * similar, check for row and column to make sense. */ +! if (j == 1 && tp[i] == 'R' && row_char == '2' && col >= 2) + { +! char *aw = NULL; + +! LOG_TR("Received U7 status"); +! u7_status = U7_GOT; + # ifdef FEAT_AUTOCMD +! did_cursorhold = TRUE; + # endif +! if (col == 2) +! aw = "single"; +! else if (col == 3) +! aw = "double"; +! if (aw != NULL && STRCMP(aw, p_ambw) != 0) +! { +! /* Setting the option causes a screen redraw. Do that +! * right away if possible, keeping any messages. */ +! set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0); +! # ifdef DEBUG_TERMRESPONSE + { +! char buf[100]; +! int r = redraw_asap(CLEAR); + +! sprintf(buf, "set 'ambiwidth', redraw_asap(): %d", +! r); +! log_tr(buf); +! } + # else +! redraw_asap(CLEAR); + # endif + } + key_name[0] = (int)KS_EXTRA; + key_name[1] = (int)KE_IGNORE; +--- 4234,4275 ---- + * u7_status is not "sent", it may be from a previous Vim that + * just exited. But not for , it sends something + * similar, check for row and column to make sense. */ +! if (j == 1 && tp[i] == 'R') + { +! if (row_char == '2' && col >= 2) +! { +! char *aw = NULL; + +! LOG_TR("Received U7 status"); +! u7_status = U7_GOT; + # ifdef FEAT_AUTOCMD +! did_cursorhold = TRUE; + # endif +! if (col == 2) +! aw = "single"; +! else if (col == 3) +! aw = "double"; +! if (aw != NULL && STRCMP(aw, p_ambw) != 0) + { +! /* Setting the option causes a screen redraw. Do +! * that right away if possible, keeping any +! * messages. */ +! set_option_value((char_u *)"ambw", 0L, +! (char_u *)aw, 0); +! # ifdef DEBUG_TERMRESPONSE +! { +! char buf[100]; +! int r = redraw_asap(CLEAR); + +! sprintf(buf, +! "set 'ambiwidth', redraw_asap(): %d", +! r); +! log_tr(buf); +! } + # else +! redraw_asap(CLEAR); + # endif ++ } + } + key_name[0] = (int)KS_EXTRA; + key_name[1] = (int)KE_IGNORE; +*************** +*** 4563,4581 **** + return -1; + + /* when mouse reporting is SGR, add 32 to mouse code */ +! if (key_name[0] == KS_SGR_MOUSE) +! mouse_code += 32; + + mouse_col = getdigits(&p) - 1; + if (*p++ != ';') + return -1; + + mouse_row = getdigits(&p) - 1; +! if (key_name[0] == KS_SGR_MOUSE && *p == 'm') + mouse_code |= MOUSE_RELEASE; +! else if (*p != 'M') + return -1; +! p++; + + slen += (int)(p - (tp + slen)); + +--- 4534,4552 ---- + return -1; + + /* when mouse reporting is SGR, add 32 to mouse code */ +! if (key_name[0] == KS_SGR_MOUSE) +! mouse_code += 32; + + mouse_col = getdigits(&p) - 1; + if (*p++ != ';') + return -1; + + mouse_row = getdigits(&p) - 1; +! if (key_name[0] == KS_SGR_MOUSE && *p == 'm') + mouse_code |= MOUSE_RELEASE; +! else if (*p != 'M') + return -1; +! p++; + + slen += (int)(p - (tp + slen)); + +*************** +*** 4592,4598 **** + for (slen2 = slen; slen2 < len; slen2++) + { + if (tp[slen2] == 'M' +! || (key_name[0] == KS_SGR_MOUSE + && tp[slen2] == 'm')) + { + cmd_complete = 1; +--- 4563,4569 ---- + for (slen2 = slen; slen2 < len; slen2++) + { + if (tp[slen2] == 'M' +! || (key_name[0] == KS_SGR_MOUSE + && tp[slen2] == 'm')) + { + cmd_complete = 1; +*************** +*** 5769,5774 **** +--- 5740,5748 ---- + * termcap codes from the terminal itself. + * We get them one by one to avoid a very long response string. + */ ++ static int xt_index_in = 0; ++ static int xt_index_out = 0; ++ + static void + req_codes_from_term() + { +*** ../vim-7.4.388/src/proto/term.pro 2014-07-09 19:13:45.007701718 +0200 +--- src/proto/term.pro 2014-07-30 17:04:40.791525930 +0200 +*************** +*** 34,41 **** + void settmode __ARGS((int tmode)); + void starttermcap __ARGS((void)); + void stoptermcap __ARGS((void)); +- int did_request_esc_sequence __ARGS((void)); +- void resume_get_esc_sequence __ARGS((void)); + void may_req_termresponse __ARGS((void)); + void may_req_ambiguous_char_width __ARGS((void)); + int swapping_screen __ARGS((void)); +--- 34,39 ---- +*** ../vim-7.4.388/src/version.c 2014-07-30 16:44:17.503534723 +0200 +--- src/version.c 2014-07-30 17:03:13.715526556 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 389, + /**/ + +-- +The only way the average employee can speak to an executive is by taking a +second job as a golf caddie. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.390 b/7.4.390 new file mode 100644 index 0000000..5dcc9c5 --- /dev/null +++ b/7.4.390 @@ -0,0 +1,51 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.390 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.390 +Problem: Advancing pointer over end of a string. +Solution: Init quote character to -1 instead of zero. (Dominique Pelle) +Files: src/misc1.c + + +*** ../vim-7.4.389/src/misc1.c 2014-07-03 22:57:51.299862927 +0200 +--- src/misc1.c 2014-08-06 12:43:33.191291602 +0200 +*************** +*** 5503,5509 **** + char_u *text; + { + char_u *s = skipwhite(text); +! int quote = 0; + + if (*s == '\'' || *s == '"') + { +--- 5503,5509 ---- + char_u *text; + { + char_u *s = skipwhite(text); +! int quote = -1; + + if (*s == '\'' || *s == '"') + { +*** ../vim-7.4.389/src/version.c 2014-07-30 17:21:53.819518506 +0200 +--- src/version.c 2014-08-06 12:44:31.643291182 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 390, + /**/ + +-- +A radioactive cat has eighteen half-lives. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.391 b/7.4.391 new file mode 100644 index 0000000..e2edae0 --- /dev/null +++ b/7.4.391 @@ -0,0 +1,118 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.391 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.391 +Problem: No 'cursorline' highlighting when the cursor is on a line with + diff highlighting. (Benjamin Fritz) +Solution: Combine the highlight attributes. (Christian Brabandt) +Files: src/screen.c + + +*** ../vim-7.4.390/src/screen.c 2014-07-30 16:44:17.499534723 +0200 +--- src/screen.c 2014-08-06 13:14:02.163278457 +0200 +*************** +*** 3702,3708 **** +--- 3702,3713 ---- + char_attr = 0; /* was: hl_attr(HLF_AT); */ + #ifdef FEAT_DIFF + if (diff_hlf != (hlf_T)0) ++ { + char_attr = hl_attr(diff_hlf); ++ if (wp->w_p_cul && lnum == wp->w_cursor.lnum) ++ char_attr = hl_combine_attr(char_attr, ++ hl_attr(HLF_CUL)); ++ } + #endif + p_extra = NULL; + c_extra = ' '; +*************** +*** 3753,3759 **** + #ifdef FEAT_SYN_HL + /* combine 'showbreak' with 'cursorline' */ + if (wp->w_p_cul && lnum == wp->w_cursor.lnum) +! char_attr = hl_combine_attr(char_attr, HLF_CLN); + #endif + } + # endif +--- 3758,3765 ---- + #ifdef FEAT_SYN_HL + /* combine 'showbreak' with 'cursorline' */ + if (wp->w_p_cul && lnum == wp->w_cursor.lnum) +! char_attr = hl_combine_attr(char_attr, +! hl_attr(HLF_CUL)); + #endif + } + # endif +*************** +*** 3931,3936 **** +--- 3937,3944 ---- + && n_extra == 0) + diff_hlf = HLF_CHD; /* changed line */ + line_attr = hl_attr(diff_hlf); ++ if (wp->w_p_cul && lnum == wp->w_cursor.lnum) ++ line_attr = hl_combine_attr(line_attr, hl_attr(HLF_CUL)); + } + #endif + +*************** +*** 4729,4735 **** +--- 4737,4748 ---- + { + diff_hlf = HLF_CHD; + if (attr == 0 || char_attr != attr) ++ { + char_attr = hl_attr(diff_hlf); ++ if (wp->w_p_cul && lnum == wp->w_cursor.lnum) ++ char_attr = hl_combine_attr(char_attr, ++ hl_attr(HLF_CUL)); ++ } + } + # endif + } +*************** +*** 10174,10182 **** + break; + screen_puts_len(NameBuff, len, 0, col, + #if defined(FEAT_SYN_HL) +! hl_combine_attr(attr, hl_attr(HLF_T)) + #else +! attr + #endif + ); + col += len; +--- 10187,10195 ---- + break; + screen_puts_len(NameBuff, len, 0, col, + #if defined(FEAT_SYN_HL) +! hl_combine_attr(attr, hl_attr(HLF_T)) + #else +! attr + #endif + ); + col += len; +*** ../vim-7.4.390/src/version.c 2014-08-06 12:49:06.711289205 +0200 +--- src/version.c 2014-08-06 13:19:19.135276179 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 391, + /**/ + +-- +It's totally unfair to suggest - as many have - that engineers are socially +inept. Engineers simply have different objectives when it comes to social +interaction. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.392 b/7.4.392 new file mode 100644 index 0000000..48a7328 --- /dev/null +++ b/7.4.392 @@ -0,0 +1,86 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.392 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.392 +Problem: Not easy to detect type of command line window. +Solution: Add the getcmdwintype() function. (Jacob Niehus) +Files: src/eval.c + + +*** ../vim-7.4.391/src/eval.c 2014-07-09 17:51:46.075801693 +0200 +--- src/eval.c 2014-08-06 13:35:59.303268990 +0200 +*************** +*** 554,559 **** +--- 554,560 ---- + static void f_getcmdline __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getcmdpos __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getcmdtype __ARGS((typval_T *argvars, typval_T *rettv)); ++ static void f_getcmdwintype __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getcwd __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getfontname __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_getfperm __ARGS((typval_T *argvars, typval_T *rettv)); +*************** +*** 7984,7989 **** +--- 7985,7991 ---- + {"getcmdline", 0, 0, f_getcmdline}, + {"getcmdpos", 0, 0, f_getcmdpos}, + {"getcmdtype", 0, 0, f_getcmdtype}, ++ {"getcmdwintype", 0, 0, f_getcmdwintype}, + {"getcurpos", 0, 0, f_getcurpos}, + {"getcwd", 0, 0, f_getcwd}, + {"getfontname", 0, 1, f_getfontname}, +*************** +*** 11503,11508 **** +--- 11505,11530 ---- + } + + /* ++ * "getcmdwintype()" function ++ */ ++ static void ++ f_getcmdwintype(argvars, rettv) ++ typval_T *argvars UNUSED; ++ typval_T *rettv; ++ { ++ rettv->v_type = VAR_STRING; ++ rettv->vval.v_string = NULL; ++ #ifdef FEAT_CMDWIN ++ rettv->vval.v_string = alloc(2); ++ if (rettv->vval.v_string != NULL) ++ { ++ rettv->vval.v_string[0] = cmdwin_type; ++ rettv->vval.v_string[1] = NUL; ++ } ++ #endif ++ } ++ ++ /* + * "getcwd()" function + */ + static void +*** ../vim-7.4.391/src/version.c 2014-08-06 13:20:51.799275513 +0200 +--- src/version.c 2014-08-06 13:34:42.903269539 +0200 +*************** +*** 736,737 **** +--- 736,739 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 392, + /**/ + +-- +I learned the customs and mannerisms of engineers by observing them, much the +way Jane Goodall learned about the great apes, but without the hassle of +grooming. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.393 b/7.4.393 new file mode 100644 index 0000000..957ce24 --- /dev/null +++ b/7.4.393 @@ -0,0 +1,1946 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.393 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.393 +Problem: Text drawing on newer MS-Windows systems is suboptimal. Some + multi-byte characters are not displayed, even though the same font + in Notepad can display them. (Srinath Avadhanula) +Solution: Add the 'renderoptions' option to enable Direct-X drawing. (Taro + Muraoka) +Files: runtime/doc/eval.txt, runtime/doc/options.txt, + runtime/doc/various.txt, src/Make_cyg.mak, src/Make_ming.mak, + src/Make_mvc.mak, src/eval.c, src/gui_dwrite.cpp, + src/gui_dwrite.h, src/gui_w32.c, src/gui_w48.c, src/option.c, + src/option.h, src/version.c, src/vim.h, src/proto/gui_w32.pro + + +*** ../vim-7.4.392/runtime/doc/eval.txt 2014-06-25 18:15:18.442838249 +0200 +--- runtime/doc/eval.txt 2014-08-06 14:35:24.871243363 +0200 +*************** +*** 6606,6611 **** +--- 6622,6628 ---- + dialog_gui Compiled with GUI dialog support. + diff Compiled with |vimdiff| and 'diff' support. + digraphs Compiled with support for digraphs. ++ directx Compiled with support for Direct-X and 'renderoptions'. + dnd Compiled with support for the "~ register |quote_~|. + dos16 16 bits DOS version of Vim. + dos32 32 bits DOS (DJGPP) version of Vim. +*************** +*** 6744,6750 **** + writebackup Compiled with 'writebackup' default on. + xfontset Compiled with X fontset support |xfontset|. + xim Compiled with X input method support |xim|. +! xpm_w32 Compiled with pixmap support for Win32. + xsmp Compiled with X session management support. + xsmp_interact Compiled with interactive X session management support. + xterm_clipboard Compiled with support for xterm clipboard. +--- 6761,6769 ---- + writebackup Compiled with 'writebackup' default on. + xfontset Compiled with X fontset support |xfontset|. + xim Compiled with X input method support |xim|. +! xpm Compiled with pixmap support. +! xpm_w32 Compiled with pixmap support for Win32. (Only for +! backward compatibility. Use "xpm" instead.) + xsmp Compiled with X session management support. + xsmp_interact Compiled with interactive X session management support. + xterm_clipboard Compiled with support for xterm clipboard. +*** ../vim-7.4.392/runtime/doc/options.txt 2014-07-02 19:59:35.446375136 +0200 +--- runtime/doc/options.txt 2014-08-06 14:36:59.591242682 +0200 +*************** +*** 5647,5652 **** +--- 5650,5726 ---- + this option at the default "on". Only switch it off when working with + old Vi scripts. + ++ *'renderoptions'* *'rop'* ++ 'renderoptions' 'rop' string (default: empty) ++ global ++ {not in Vi} ++ {only available when compiled with GUI and DIRECTX on ++ MS-Windows} ++ Select a text renderer and set its options. The options depend on the ++ renderer. ++ ++ Syntax: > ++ set rop=type:{renderer}(,{name}:{value})* ++ < ++ Currently, only one optional renderer is available. ++ ++ render behavior ~ ++ directx Vim will draw text using DirectX (DirectWrite). It makes ++ drawn glyphs more beautiful than default GDI. ++ It requires 'encoding' is "utf-8", and only works on ++ MS-Windows Vista or newer version. ++ ++ Options: ++ name meaning type value ~ ++ gamma gamma float 1.0 - 2.2 (maybe) ++ contrast enhancedContrast float (unknown) ++ level clearTypeLevel float (unknown) ++ geom pixelGeometry int 0 - 2 (see below) ++ renmode renderingMode int 0 - 6 (see below) ++ taamode textAntialiasMode int 0 - 3 (see below) ++ ++ See this URL for detail: ++ http://msdn.microsoft.com/en-us/library/dd368190.aspx ++ ++ For geom: structure of a device pixel. ++ 0 - DWRITE_PIXEL_GEOMETRY_FLAT ++ 1 - DWRITE_PIXEL_GEOMETRY_RGB ++ 2 - DWRITE_PIXEL_GEOMETRY_BGR ++ ++ See this URL for detail: ++ http://msdn.microsoft.com/en-us/library/dd368114.aspx ++ ++ For renmode: method of rendering glyphs. ++ 0 - DWRITE_RENDERING_MODE_DEFAULT ++ 1 - DWRITE_RENDERING_MODE_ALIASED ++ 2 - DWRITE_RENDERING_MODE_GDI_CLASSIC ++ 3 - DWRITE_RENDERING_MODE_GDI_NATURAL ++ 4 - DWRITE_RENDERING_MODE_NATURAL ++ 5 - DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC ++ 6 - DWRITE_RENDERING_MODE_OUTLINE ++ ++ See this URL for detail: ++ http://msdn.microsoft.com/en-us/library/dd368118.aspx ++ ++ For taamode: antialiasing mode used for drawing text. ++ 0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT ++ 1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE ++ 2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE ++ 3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED ++ ++ See this URL for detail: ++ http://msdn.microsoft.com/en-us/library/dd368170.aspx ++ ++ Example: > ++ set encoding=utf-8 ++ set gfn=Ricty_Diminished:h12:cSHIFTJIS ++ set rop=type:directx ++ < ++ If select a raster font (Courier, Terminal or FixedSys) to ++ 'guifont', it fallbacks to be drawn by GDI automatically. ++ ++ Other render types are currently not supported. ++ + *'report'* + 'report' number (default 2) + global +*** ../vim-7.4.392/runtime/doc/various.txt 2013-08-10 13:25:06.000000000 +0200 +--- runtime/doc/various.txt 2014-08-06 14:37:28.843242472 +0200 +*************** +*** 320,325 **** +--- 337,343 ---- + N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog. + N *+diff* |vimdiff| and 'diff' + N *+digraphs* |digraphs| *E196* ++ m *+directx* Win32 GUI only: DirectX and |'renderoptions'| + *+dnd* Support for DnD into the "~ register |quote_~|. + B *+emacs_tags* |emacs-tags| files + N *+eval* expression evaluation |eval.txt| +*************** +*** 426,431 **** +--- 445,451 ---- + m *+writebackup* |'writebackup'| is default on + m *+xim* X input method |xim| + *+xfontset* X fontset support |xfontset| ++ *+xpm* pixmap support + m *+xpm_w32* Win32 GUI only: pixmap support |w32-xpm-support| + *+xsmp* XSMP (X session management) support + *+xsmp_interact* interactive XSMP (X session management) support +*** ../vim-7.4.392/src/Make_cyg.mak 2013-12-11 15:06:36.000000000 +0100 +--- src/Make_cyg.mak 2014-08-06 14:21:57.455249166 +0200 +*************** +*** 8,13 **** +--- 8,14 ---- + # Cygwin application use the Makefile (just like on Unix). + # + # GUI no or yes: set to yes if you want the GUI version (yes) ++ # DIRECTX no or yes: set to yes if you want use DirectWrite (no) + # PERL define to path to Perl dir to get Perl support (not defined) + # PERL_VER define to version of Perl being used (56) + # DYNAMIC_PERL no or yes: set to yes to load the Perl DLL dynamically (yes) +*************** +*** 88,93 **** +--- 89,98 ---- + ARCH = i386 + endif + ++ ifndef DIRECTX ++ DIRECTX = no ++ endif ++ + ifndef WINVER + WINVER = 0x0500 + endif +*************** +*** 470,475 **** +--- 475,489 ---- + endif + + ############################## ++ ifeq (yes, $(DIRECTX)) ++ # Only allow DIRECTX for a GUI build. ++ DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX ++ EXTRA_OBJS += $(OUTDIR)/gui_dwrite.o ++ EXTRA_LIBS += -ld2d1 -ldwrite ++ USE_STDCPLUS = yes ++ endif ++ ++ ############################## + ifdef XPM + # Only allow XPM for a GUI build. + DEFINES += -DFEAT_XPM_W32 +*************** +*** 495,505 **** + DEFINES += -DFEAT_OLE + EXTRA_OBJS += $(OUTDIR)/if_ole.o + EXTRA_LIBS += -loleaut32 +! ifeq (yes, $(STATIC_STDCPLUS)) +! EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic +! else +! EXTRA_LIBS += -lstdc++ +! endif + endif + + ############################## +--- 509,515 ---- + DEFINES += -DFEAT_OLE + EXTRA_OBJS += $(OUTDIR)/if_ole.o + EXTRA_LIBS += -loleaut32 +! USE_STDCPLUS = yes + endif + + ############################## +*************** +*** 513,518 **** +--- 523,537 ---- + DIRSLASH = \\ + endif + ++ ############################## ++ ifeq (yes, $(USE_STDCPLUS)) ++ ifeq (yes, $(STATIC_STDCPLUS)) ++ EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic ++ else ++ EXTRA_LIBS += -lstdc++ ++ endif ++ endif ++ + #>>>>> end of choices + ########################################################################### + +*************** +*** 643,648 **** +--- 662,670 ---- + $(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL) + $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o + ++ $(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h ++ $(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o ++ + $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h + $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o + +*** ../vim-7.4.392/src/Make_ming.mak 2014-01-06 15:44:59.000000000 +0100 +--- src/Make_ming.mak 2014-08-06 14:21:57.455249166 +0200 +*************** +*** 31,36 **** +--- 31,38 ---- + OPTIMIZE=MAXSPEED + # set to yes to make gvim, no for vim + GUI=yes ++ # set to yes if you want to use DirectWrite (DirectX) ++ DIRECTX=no + # FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE] + # Set to TINY to make minimal version (few features). + FEATURES=BIG +*************** +*** 456,461 **** +--- 458,471 ---- + endif + endif + ++ # DirectWrite (DirectX) ++ ifeq ($(DIRECTX),yes) ++ # Only allow DirectWrite for a GUI build. ++ ifeq (yes, $(GUI)) ++ DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX ++ endif ++ endif ++ + # Only allow XPM for a GUI build. + ifeq (yes, $(GUI)) + +*************** +*** 593,598 **** +--- 603,616 ---- + LIB += -lwsock32 + endif + endif ++ ifeq ($(DIRECTX),yes) ++ # Only allow DIRECTX for a GUI build. ++ ifeq (yes, $(GUI)) ++ OBJ += $(OUTDIR)/gui_dwrite.o ++ LIB += -ld2d1 -ldwrite ++ USE_STDCPLUS = yes ++ endif ++ endif + ifdef XPM + # Only allow XPM for a GUI build. + ifeq (yes, $(GUI)) +*************** +*** 650,660 **** + ifeq (yes, $(OLE)) + LIB += -loleaut32 + OBJ += $(OUTDIR)/if_ole.o +! ifeq (yes, $(STATIC_STDCPLUS)) +! LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic +! else +! LIB += -lstdc++ +! endif + endif + + ifeq (yes, $(MBYTE)) +--- 668,674 ---- + ifeq (yes, $(OLE)) + LIB += -loleaut32 + OBJ += $(OUTDIR)/if_ole.o +! USE_STDCPLUS = yes + endif + + ifeq (yes, $(MBYTE)) +*************** +*** 678,683 **** +--- 692,705 ---- + DEFINES+=-DDYNAMIC_ICONV + endif + ++ ifeq (yes, $(USE_STDCPLUS)) ++ ifeq (yes, $(STATIC_STDCPLUS)) ++ LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic ++ else ++ LIB += -lstdc++ ++ endif ++ endif ++ + all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll + + vimrun.exe: vimrun.c +*************** +*** 751,756 **** +--- 773,781 ---- + $(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL) + $(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o + ++ $(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h ++ $(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o ++ + $(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h + $(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o + +*** ../vim-7.4.392/src/Make_mvc.mak 2014-05-22 16:29:03.374353200 +0200 +--- src/Make_mvc.mak 2014-08-06 14:21:57.455249166 +0200 +*************** +*** 24,29 **** +--- 24,32 ---- + # + # GUI interface: GUI=yes (default is no) + # ++ # GUI with DirectWrite(DirectX): DIRECTX=yes ++ # (default is no, requires GUI=yes) ++ # + # OLE interface: OLE=yes (usually with GUI=yes) + # + # Multibyte support: MBYTE=yes (default is no) +*************** +*** 168,173 **** +--- 171,179 ---- + !else + OBJDIR = .\ObjC + !endif ++ !if "$(DIRECTX)" == "yes" ++ OBJDIR = $(OBJDIR)X ++ !endif + !if "$(OLE)" == "yes" + OBJDIR = $(OBJDIR)O + !endif +*************** +*** 292,297 **** +--- 298,310 ---- + NETBEANS_LIB = WSock32.lib + !endif + ++ # DirectWrite(DirectX) ++ !if "$(DIRECTX)" == "yes" ++ DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX ++ DIRECTX_INCL = gui_dwrite.h ++ DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj ++ !endif ++ + !ifndef XPM + # XPM is not set, use the included xpm files, depending on the architecture. + !if "$(CPU)" == "AMD64" +*************** +*** 642,647 **** +--- 655,666 ---- + SUBSYSTEM = console + !endif + ++ !if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes" ++ CFLAGS = $(CFLAGS) $(DIRECTX_DEFS) ++ GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL) ++ GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ) ++ !endif ++ + # iconv.dll library (dynamically loaded) + !ifndef ICONV + ICONV = yes +*************** +*** 1107,1112 **** +--- 1126,1133 ---- + + $(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL) + ++ $(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL) ++ + $(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL) + + $(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL) +*** ../vim-7.4.392/src/eval.c 2014-08-06 13:36:56.091268582 +0200 +--- src/eval.c 2014-08-06 14:21:57.459249166 +0200 +*************** +*** 12464,12469 **** +--- 12464,12472 ---- + #ifdef FEAT_DIGRAPHS + "digraphs", + #endif ++ #ifdef FEAT_DIRECTX ++ "directx", ++ #endif + #ifdef FEAT_DND + "dnd", + #endif +*** ../vim-7.4.392/src/gui_dwrite.cpp 2014-08-06 14:49:19.663237363 +0200 +--- src/gui_dwrite.cpp 2014-08-06 14:39:48.775241466 +0200 +*************** +*** 0 **** +--- 1,901 ---- ++ /* vi:set ts=8 sts=4 sw=4 noet: */ ++ /* ++ * Author: MURAOKA Taro ++ * ++ * Contributors: ++ * - Ken Takata ++ * ++ * Copyright (C) 2013 MURAOKA Taro ++ * THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. ++ */ ++ ++ #define WIN32_LEAN_AND_MEAN ++ ++ #ifndef DYNAMIC_DIRECTX ++ # if WINVER < 0x0600 ++ # error WINVER must be 0x0600 or above to use DirectWrite(DirectX) ++ # endif ++ #endif ++ ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ ++ #include "gui_dwrite.h" ++ ++ #ifdef __MINGW32__ ++ # define __maybenull SAL__maybenull ++ # define __in SAL__in ++ # define __out SAL__out ++ #endif ++ ++ #ifdef DYNAMIC_DIRECTX ++ extern "C" HINSTANCE vimLoadLib(char *name); ++ ++ typedef int (WINAPI *PGETUSERDEFAULTLOCALENAME)(LPWSTR, int); ++ typedef HRESULT (WINAPI *PD2D1CREATEFACTORY)(D2D1_FACTORY_TYPE, ++ REFIID, const D2D1_FACTORY_OPTIONS *, void **); ++ typedef HRESULT (WINAPI *PDWRITECREATEFACTORY)(DWRITE_FACTORY_TYPE, ++ REFIID, IUnknown **); ++ ++ static HINSTANCE hD2D1DLL = NULL; ++ static HINSTANCE hDWriteDLL = NULL; ++ ++ static PGETUSERDEFAULTLOCALENAME pGetUserDefaultLocaleName = NULL; ++ static PD2D1CREATEFACTORY pD2D1CreateFactory = NULL; ++ static PDWRITECREATEFACTORY pDWriteCreateFactory = NULL; ++ ++ #define GetUserDefaultLocaleName (*pGetUserDefaultLocaleName) ++ #define D2D1CreateFactory (*pD2D1CreateFactory) ++ #define DWriteCreateFactory (*pDWriteCreateFactory) ++ ++ static void ++ unload(HINSTANCE &hinst) ++ { ++ if (hinst != NULL) ++ { ++ FreeLibrary(hinst); ++ hinst = NULL; ++ } ++ } ++ #endif // DYNAMIC_DIRECTX ++ ++ template inline void SafeRelease(T **ppT) ++ { ++ if (*ppT) ++ { ++ (*ppT)->Release(); ++ *ppT = NULL; ++ } ++ } ++ ++ struct GdiTextRendererContext ++ { ++ // const fields. ++ COLORREF color; ++ FLOAT cellWidth; ++ ++ // working fields. ++ FLOAT offsetX; ++ }; ++ ++ static DWRITE_PIXEL_GEOMETRY ++ ToPixelGeometry(int value) ++ { ++ switch (value) ++ { ++ default: ++ case 0: ++ return DWRITE_PIXEL_GEOMETRY_FLAT; ++ case 1: ++ return DWRITE_PIXEL_GEOMETRY_RGB; ++ case 2: ++ return DWRITE_PIXEL_GEOMETRY_BGR; ++ } ++ } ++ ++ static int ++ ToInt(DWRITE_PIXEL_GEOMETRY value) ++ { ++ switch (value) ++ { ++ case DWRITE_PIXEL_GEOMETRY_FLAT: ++ return 0; ++ case DWRITE_PIXEL_GEOMETRY_RGB: ++ return 1; ++ case DWRITE_PIXEL_GEOMETRY_BGR: ++ return 2; ++ default: ++ return -1; ++ } ++ } ++ ++ static DWRITE_RENDERING_MODE ++ ToRenderingMode(int value) ++ { ++ switch (value) ++ { ++ default: ++ case 0: ++ return DWRITE_RENDERING_MODE_DEFAULT; ++ case 1: ++ return DWRITE_RENDERING_MODE_ALIASED; ++ case 2: ++ return DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC; ++ case 3: ++ return DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL; ++ case 4: ++ return DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL; ++ case 5: ++ return DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC; ++ case 6: ++ return DWRITE_RENDERING_MODE_OUTLINE; ++ } ++ } ++ ++ static D2D1_TEXT_ANTIALIAS_MODE ++ ToTextAntialiasMode(int value) ++ { ++ switch (value) ++ { ++ default: ++ case 0: ++ return D2D1_TEXT_ANTIALIAS_MODE_DEFAULT; ++ case 1: ++ return D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE; ++ case 2: ++ return D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE; ++ case 3: ++ return D2D1_TEXT_ANTIALIAS_MODE_ALIASED; ++ } ++ } ++ ++ static int ++ ToInt(DWRITE_RENDERING_MODE value) ++ { ++ switch (value) ++ { ++ case DWRITE_RENDERING_MODE_DEFAULT: ++ return 0; ++ case DWRITE_RENDERING_MODE_ALIASED: ++ return 1; ++ case DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC: ++ return 2; ++ case DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL: ++ return 3; ++ case DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL: ++ return 4; ++ case DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC: ++ return 5; ++ case DWRITE_RENDERING_MODE_OUTLINE: ++ return 6; ++ default: ++ return -1; ++ } ++ } ++ ++ class AdjustedGlyphRun : public DWRITE_GLYPH_RUN ++ { ++ private: ++ FLOAT mDelta; ++ FLOAT *mAdjustedAdvances; ++ ++ public: ++ AdjustedGlyphRun( ++ const DWRITE_GLYPH_RUN *glyphRun, ++ FLOAT cellWidth) : ++ DWRITE_GLYPH_RUN(*glyphRun), ++ mDelta(0.0f), ++ mAdjustedAdvances(new FLOAT[glyphRun->glyphCount]) ++ { ++ assert(cellWidth != 0.0f); ++ for (UINT32 i = 0; i < glyphRun->glyphCount; ++i) ++ { ++ FLOAT orig = glyphRun->glyphAdvances[i]; ++ FLOAT adjusted = adjustToCell(orig, cellWidth); ++ mAdjustedAdvances[i] = adjusted; ++ mDelta += adjusted - orig; ++ } ++ glyphAdvances = mAdjustedAdvances; ++ } ++ ++ ~AdjustedGlyphRun(void) ++ { ++ delete[] mAdjustedAdvances; ++ } ++ ++ FLOAT getDelta(void) const ++ { ++ return mDelta; ++ } ++ ++ static FLOAT adjustToCell(FLOAT value, FLOAT cellWidth) ++ { ++ int cellCount = (int)floor(value / cellWidth + 0.5f); ++ if (cellCount < 1) ++ cellCount = 1; ++ return cellCount * cellWidth; ++ } ++ }; ++ ++ class GdiTextRenderer : public IDWriteTextRenderer ++ { ++ public: ++ GdiTextRenderer( ++ IDWriteBitmapRenderTarget* bitmapRenderTarget, ++ IDWriteRenderingParams* renderingParams) : ++ cRefCount_(0), ++ pRenderTarget_(bitmapRenderTarget), ++ pRenderingParams_(renderingParams) ++ { ++ pRenderTarget_->AddRef(); ++ pRenderingParams_->AddRef(); ++ AddRef(); ++ } ++ ++ ~GdiTextRenderer() ++ { ++ SafeRelease(&pRenderTarget_); ++ SafeRelease(&pRenderingParams_); ++ } ++ ++ IFACEMETHOD(IsPixelSnappingDisabled)( ++ __maybenull void* clientDrawingContext, ++ __out BOOL* isDisabled) ++ { ++ *isDisabled = FALSE; ++ return S_OK; ++ } ++ ++ IFACEMETHOD(GetCurrentTransform)( ++ __maybenull void* clientDrawingContext, ++ __out DWRITE_MATRIX* transform) ++ { ++ //forward the render target's transform ++ pRenderTarget_->GetCurrentTransform(transform); ++ return S_OK; ++ } ++ ++ IFACEMETHOD(GetPixelsPerDip)( ++ __maybenull void* clientDrawingContext, ++ __out FLOAT* pixelsPerDip) ++ { ++ *pixelsPerDip = pRenderTarget_->GetPixelsPerDip(); ++ return S_OK; ++ } ++ ++ IFACEMETHOD(DrawGlyphRun)( ++ __maybenull void* clientDrawingContext, ++ FLOAT baselineOriginX, ++ FLOAT baselineOriginY, ++ DWRITE_MEASURING_MODE measuringMode, ++ __in DWRITE_GLYPH_RUN const* glyphRun, ++ __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription, ++ IUnknown* clientDrawingEffect) ++ { ++ HRESULT hr = S_OK; ++ ++ GdiTextRendererContext *context = ++ reinterpret_cast(clientDrawingContext); ++ ++ AdjustedGlyphRun adjustedGlyphRun(glyphRun, context->cellWidth); ++ ++ // Pass on the drawing call to the render target to do the real work. ++ RECT dirtyRect = {0}; ++ ++ hr = pRenderTarget_->DrawGlyphRun( ++ baselineOriginX + context->offsetX, ++ baselineOriginY, ++ measuringMode, ++ &adjustedGlyphRun, ++ pRenderingParams_, ++ context->color, ++ &dirtyRect); ++ ++ context->offsetX += adjustedGlyphRun.getDelta(); ++ ++ return hr; ++ } ++ ++ IFACEMETHOD(DrawUnderline)( ++ __maybenull void* clientDrawingContext, ++ FLOAT baselineOriginX, ++ FLOAT baselineOriginY, ++ __in DWRITE_UNDERLINE const* underline, ++ IUnknown* clientDrawingEffect) ++ { ++ return E_NOTIMPL; ++ } ++ ++ IFACEMETHOD(DrawStrikethrough)( ++ __maybenull void* clientDrawingContext, ++ FLOAT baselineOriginX, ++ FLOAT baselineOriginY, ++ __in DWRITE_STRIKETHROUGH const* strikethrough, ++ IUnknown* clientDrawingEffect) ++ { ++ return E_NOTIMPL; ++ } ++ ++ IFACEMETHOD(DrawInlineObject)( ++ __maybenull void* clientDrawingContext, ++ FLOAT originX, ++ FLOAT originY, ++ IDWriteInlineObject* inlineObject, ++ BOOL isSideways, ++ BOOL isRightToLeft, ++ IUnknown* clientDrawingEffect) ++ { ++ return E_NOTIMPL; ++ } ++ ++ public: ++ IFACEMETHOD_(unsigned long, AddRef) () ++ { ++ return InterlockedIncrement(&cRefCount_); ++ } ++ ++ IFACEMETHOD_(unsigned long, Release) () ++ { ++ long newCount = InterlockedDecrement(&cRefCount_); ++ ++ if (newCount == 0) ++ { ++ delete this; ++ return 0; ++ } ++ return newCount; ++ } ++ ++ IFACEMETHOD(QueryInterface)( ++ IID const& riid, ++ void** ppvObject) ++ { ++ if (__uuidof(IDWriteTextRenderer) == riid) ++ { ++ *ppvObject = this; ++ } ++ else if (__uuidof(IDWritePixelSnapping) == riid) ++ { ++ *ppvObject = this; ++ } ++ else if (__uuidof(IUnknown) == riid) ++ { ++ *ppvObject = this; ++ } ++ else ++ { ++ *ppvObject = NULL; ++ return E_FAIL; ++ } ++ ++ return S_OK; ++ } ++ ++ private: ++ unsigned long cRefCount_; ++ IDWriteBitmapRenderTarget* pRenderTarget_; ++ IDWriteRenderingParams* pRenderingParams_; ++ }; ++ ++ struct DWriteContext { ++ FLOAT mDpiScaleX; ++ FLOAT mDpiScaleY; ++ bool mDrawing; ++ ++ ID2D1Factory *mD2D1Factory; ++ ++ ID2D1DCRenderTarget *mRT; ++ ID2D1SolidColorBrush *mBrush; ++ ++ IDWriteFactory *mDWriteFactory; ++ IDWriteGdiInterop *mGdiInterop; ++ IDWriteRenderingParams *mRenderingParams; ++ IDWriteTextFormat *mTextFormat; ++ ++ HFONT mLastHFont; ++ DWRITE_FONT_WEIGHT mFontWeight; ++ DWRITE_FONT_STYLE mFontStyle; ++ ++ D2D1_TEXT_ANTIALIAS_MODE mTextAntialiasMode; ++ ++ // METHODS ++ ++ DWriteContext(); ++ ++ virtual ~DWriteContext(); ++ ++ HRESULT SetLOGFONT(const LOGFONTW &logFont, float fontSize); ++ ++ void SetFont(HFONT hFont); ++ ++ void SetFont(const LOGFONTW &logFont); ++ ++ void DrawText(HDC hdc, const WCHAR* text, int len, ++ int x, int y, int w, int h, int cellWidth, COLORREF color); ++ ++ float PixelsToDipsX(int x); ++ ++ float PixelsToDipsY(int y); ++ ++ void SetRenderingParams( ++ const DWriteRenderingParams *params); ++ ++ DWriteRenderingParams *GetRenderingParams( ++ DWriteRenderingParams *params); ++ }; ++ ++ DWriteContext::DWriteContext() : ++ mDpiScaleX(1.f), ++ mDpiScaleY(1.f), ++ mDrawing(false), ++ mD2D1Factory(NULL), ++ mRT(NULL), ++ mBrush(NULL), ++ mDWriteFactory(NULL), ++ mGdiInterop(NULL), ++ mRenderingParams(NULL), ++ mTextFormat(NULL), ++ mLastHFont(NULL), ++ mFontWeight(DWRITE_FONT_WEIGHT_NORMAL), ++ mFontStyle(DWRITE_FONT_STYLE_NORMAL), ++ mTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_DEFAULT) ++ { ++ HRESULT hr; ++ ++ HDC screen = ::GetDC(0); ++ mDpiScaleX = ::GetDeviceCaps(screen, LOGPIXELSX) / 96.0f; ++ mDpiScaleY = ::GetDeviceCaps(screen, LOGPIXELSY) / 96.0f; ++ ::ReleaseDC(0, screen); ++ ++ hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, ++ __uuidof(ID2D1Factory), NULL, ++ reinterpret_cast(&mD2D1Factory)); ++ _RPT2(_CRT_WARN, "D2D1CreateFactory: hr=%p p=%p\n", hr, mD2D1Factory); ++ ++ if (SUCCEEDED(hr)) ++ { ++ D2D1_RENDER_TARGET_PROPERTIES props = { ++ D2D1_RENDER_TARGET_TYPE_DEFAULT, ++ { DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE }, ++ 0, 0, ++ D2D1_RENDER_TARGET_USAGE_NONE, ++ D2D1_FEATURE_LEVEL_DEFAULT ++ }; ++ hr = mD2D1Factory->CreateDCRenderTarget(&props, &mRT); ++ _RPT2(_CRT_WARN, "CreateDCRenderTarget: hr=%p p=%p\n", hr, mRT); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ hr = mRT->CreateSolidColorBrush( ++ D2D1::ColorF(D2D1::ColorF::Black), ++ &mBrush); ++ _RPT2(_CRT_WARN, "CreateSolidColorBrush: hr=%p p=%p\n", hr, mBrush); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ hr = DWriteCreateFactory( ++ DWRITE_FACTORY_TYPE_SHARED, ++ __uuidof(IDWriteFactory), ++ reinterpret_cast(&mDWriteFactory)); ++ _RPT2(_CRT_WARN, "DWriteCreateFactory: hr=%p p=%p\n", hr, ++ mDWriteFactory); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ hr = mDWriteFactory->GetGdiInterop(&mGdiInterop); ++ _RPT2(_CRT_WARN, "GetGdiInterop: hr=%p p=%p\n", hr, mGdiInterop); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ hr = mDWriteFactory->CreateRenderingParams(&mRenderingParams); ++ _RPT2(_CRT_WARN, "CreateRenderingParams: hr=%p p=%p\n", hr, ++ mRenderingParams); ++ } ++ } ++ ++ DWriteContext::~DWriteContext() ++ { ++ SafeRelease(&mTextFormat); ++ SafeRelease(&mRenderingParams); ++ SafeRelease(&mGdiInterop); ++ SafeRelease(&mDWriteFactory); ++ SafeRelease(&mBrush); ++ SafeRelease(&mRT); ++ SafeRelease(&mD2D1Factory); ++ } ++ ++ HRESULT ++ DWriteContext::SetLOGFONT(const LOGFONTW &logFont, float fontSize) ++ { ++ // Most of this function is copy from: http://msdn.microsoft.com/en-us/library/windows/desktop/dd941783(v=vs.85).aspx ++ HRESULT hr = S_OK; ++ ++ IDWriteFont *font = NULL; ++ IDWriteFontFamily *fontFamily = NULL; ++ IDWriteLocalizedStrings *localizedFamilyNames = NULL; ++ ++ if (SUCCEEDED(hr)) ++ { ++ hr = mGdiInterop->CreateFontFromLOGFONT(&logFont, &font); ++ } ++ ++ // Get the font family to which this font belongs. ++ if (SUCCEEDED(hr)) ++ { ++ hr = font->GetFontFamily(&fontFamily); ++ } ++ ++ // Get the family names. This returns an object that encapsulates one or ++ // more names with the same meaning but in different languages. ++ if (SUCCEEDED(hr)) ++ { ++ hr = fontFamily->GetFamilyNames(&localizedFamilyNames); ++ } ++ ++ // Get the family name at index zero. If we were going to display the name ++ // we'd want to try to find one that matched the use locale, but for ++ // purposes of creating a text format object any language will do. ++ ++ wchar_t familyName[100]; ++ if (SUCCEEDED(hr)) ++ { ++ hr = localizedFamilyNames->GetString(0, familyName, ++ ARRAYSIZE(familyName)); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ // If no font size was passed in use the lfHeight of the LOGFONT. ++ if (fontSize == 0) ++ { ++ // Convert from pixels to DIPs. ++ fontSize = PixelsToDipsY(logFont.lfHeight); ++ if (fontSize < 0) ++ { ++ // Negative lfHeight represents the size of the em unit. ++ fontSize = -fontSize; ++ } ++ else ++ { ++ // Positive lfHeight represents the cell height (ascent + ++ // descent). ++ DWRITE_FONT_METRICS fontMetrics; ++ font->GetMetrics(&fontMetrics); ++ ++ // Convert the cell height (ascent + descent) from design units ++ // to ems. ++ float cellHeight = static_cast( ++ fontMetrics.ascent + fontMetrics.descent) ++ / fontMetrics.designUnitsPerEm; ++ ++ // Divide the font size by the cell height to get the font em ++ // size. ++ fontSize /= cellHeight; ++ } ++ } ++ } ++ ++ // The text format includes a locale name. Ideally, this would be the ++ // language of the text, which may or may not be the same as the primary ++ // language of the user. However, for our purposes the user locale will do. ++ wchar_t localeName[LOCALE_NAME_MAX_LENGTH]; ++ if (SUCCEEDED(hr)) ++ { ++ if (GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH) == 0) ++ hr = HRESULT_FROM_WIN32(GetLastError()); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ // Create the text format object. ++ hr = mDWriteFactory->CreateTextFormat( ++ familyName, ++ NULL, // no custom font collection ++ font->GetWeight(), ++ font->GetStyle(), ++ font->GetStretch(), ++ fontSize, ++ localeName, ++ &mTextFormat); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ mFontWeight = static_cast(logFont.lfWeight); ++ mFontStyle = logFont.lfItalic ? DWRITE_FONT_STYLE_ITALIC ++ : DWRITE_FONT_STYLE_NORMAL; ++ } ++ ++ SafeRelease(&localizedFamilyNames); ++ SafeRelease(&fontFamily); ++ SafeRelease(&font); ++ ++ return hr; ++ } ++ ++ void ++ DWriteContext::SetFont(HFONT hFont) ++ { ++ if (mLastHFont != hFont) ++ { ++ LOGFONTW lf; ++ if (GetObjectW(hFont, sizeof(lf), &lf)) ++ { ++ SetFont(lf); ++ mLastHFont = hFont; ++ } ++ } ++ } ++ ++ void ++ DWriteContext::SetFont(const LOGFONTW &logFont) ++ { ++ SafeRelease(&mTextFormat); ++ mLastHFont = NULL; ++ ++ HRESULT hr = SetLOGFONT(logFont, 0.f); ++ ++ if (SUCCEEDED(hr)) ++ hr = mTextFormat->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING); ++ ++ if (SUCCEEDED(hr)) ++ hr = mTextFormat->SetParagraphAlignment( ++ DWRITE_PARAGRAPH_ALIGNMENT_CENTER); ++ ++ if (SUCCEEDED(hr)) ++ hr = mTextFormat->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP); ++ } ++ ++ void ++ DWriteContext::DrawText(HDC hdc, const WCHAR* text, int len, ++ int x, int y, int w, int h, int cellWidth, COLORREF color) ++ { ++ HRESULT hr = S_OK; ++ IDWriteBitmapRenderTarget *bmpRT = NULL; ++ ++ // Skip when any fonts are not set. ++ if (mTextFormat == NULL) ++ return; ++ ++ // Check possibility of zero divided error. ++ if (cellWidth == 0 || mDpiScaleX == 0.0f || mDpiScaleY == 0.0f) ++ return; ++ ++ if (SUCCEEDED(hr)) ++ hr = mGdiInterop->CreateBitmapRenderTarget(hdc, w, h, &bmpRT); ++ ++ if (SUCCEEDED(hr)) ++ { ++ IDWriteTextLayout *textLayout = NULL; ++ ++ HDC memdc = bmpRT->GetMemoryDC(); ++ BitBlt(memdc, 0, 0, w, h, hdc, x, y, SRCCOPY); ++ ++ hr = mDWriteFactory->CreateGdiCompatibleTextLayout( ++ text, len, mTextFormat, PixelsToDipsX(w), ++ PixelsToDipsY(h), mDpiScaleX, NULL, TRUE, &textLayout); ++ ++ if (SUCCEEDED(hr)) ++ { ++ DWRITE_TEXT_RANGE textRange = { 0, len }; ++ textLayout->SetFontWeight(mFontWeight, textRange); ++ textLayout->SetFontStyle(mFontStyle, textRange); ++ } ++ ++ if (SUCCEEDED(hr)) ++ { ++ GdiTextRenderer *renderer = new GdiTextRenderer(bmpRT, ++ mRenderingParams); ++ GdiTextRendererContext data = { ++ color, ++ PixelsToDipsX(cellWidth), ++ 0.0f ++ }; ++ textLayout->Draw(&data, renderer, 0, 0); ++ SafeRelease(&renderer); ++ } ++ ++ BitBlt(hdc, x, y, w, h, memdc, 0, 0, SRCCOPY); ++ ++ SafeRelease(&textLayout); ++ } ++ ++ SafeRelease(&bmpRT); ++ } ++ ++ float ++ DWriteContext::PixelsToDipsX(int x) ++ { ++ return x / mDpiScaleX; ++ } ++ ++ float ++ DWriteContext::PixelsToDipsY(int y) ++ { ++ return y / mDpiScaleY; ++ } ++ ++ void ++ DWriteContext::SetRenderingParams( ++ const DWriteRenderingParams *params) ++ { ++ if (mDWriteFactory == NULL) ++ return; ++ ++ IDWriteRenderingParams *renderingParams = NULL; ++ D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode = ++ D2D1_TEXT_ANTIALIAS_MODE_DEFAULT; ++ HRESULT hr; ++ if (params != NULL) ++ { ++ hr = mDWriteFactory->CreateCustomRenderingParams(params->gamma, ++ params->enhancedContrast, params->clearTypeLevel, ++ ToPixelGeometry(params->pixelGeometry), ++ ToRenderingMode(params->renderingMode), &renderingParams); ++ textAntialiasMode = ToTextAntialiasMode(params->textAntialiasMode); ++ } ++ else ++ hr = mDWriteFactory->CreateRenderingParams(&renderingParams); ++ if (SUCCEEDED(hr) && renderingParams != NULL) ++ { ++ SafeRelease(&mRenderingParams); ++ mRenderingParams = renderingParams; ++ mTextAntialiasMode = textAntialiasMode; ++ } ++ } ++ ++ DWriteRenderingParams * ++ DWriteContext::GetRenderingParams( ++ DWriteRenderingParams *params) ++ { ++ if (params != NULL && mRenderingParams != NULL) ++ { ++ params->gamma = mRenderingParams->GetGamma(); ++ params->enhancedContrast = mRenderingParams->GetEnhancedContrast(); ++ params->clearTypeLevel = mRenderingParams->GetClearTypeLevel(); ++ params->pixelGeometry = ToInt(mRenderingParams->GetPixelGeometry()); ++ params->renderingMode = ToInt(mRenderingParams->GetRenderingMode()); ++ params->textAntialiasMode = mTextAntialiasMode; ++ } ++ return params; ++ } ++ ++ //////////////////////////////////////////////////////////////////////////// ++ // PUBLIC C INTERFACES ++ ++ void ++ DWrite_Init(void) ++ { ++ #ifdef DYNAMIC_DIRECTX ++ // Load libraries. ++ hD2D1DLL = vimLoadLib(const_cast("d2d1.dll")); ++ hDWriteDLL = vimLoadLib(const_cast("dwrite.dll")); ++ if (hD2D1DLL == NULL || hDWriteDLL == NULL) ++ { ++ DWrite_Final(); ++ return; ++ } ++ // Get address of procedures. ++ pGetUserDefaultLocaleName = (PGETUSERDEFAULTLOCALENAME)GetProcAddress( ++ GetModuleHandle("kernel32.dll"), "GetUserDefaultLocaleName"); ++ pD2D1CreateFactory = (PD2D1CREATEFACTORY)GetProcAddress(hD2D1DLL, ++ "D2D1CreateFactory"); ++ pDWriteCreateFactory = (PDWRITECREATEFACTORY)GetProcAddress(hDWriteDLL, ++ "DWriteCreateFactory"); ++ #endif ++ } ++ ++ void ++ DWrite_Final(void) ++ { ++ #ifdef DYNAMIC_DIRECTX ++ pGetUserDefaultLocaleName = NULL; ++ pD2D1CreateFactory = NULL; ++ pDWriteCreateFactory = NULL; ++ unload(hDWriteDLL); ++ unload(hD2D1DLL); ++ #endif ++ } ++ ++ DWriteContext * ++ DWriteContext_Open(void) ++ { ++ #ifdef DYNAMIC_DIRECTX ++ if (pGetUserDefaultLocaleName == NULL || pD2D1CreateFactory == NULL ++ || pDWriteCreateFactory == NULL) ++ return NULL; ++ #endif ++ return new DWriteContext(); ++ } ++ ++ void ++ DWriteContext_BeginDraw(DWriteContext *ctx) ++ { ++ if (ctx != NULL && ctx->mRT != NULL) ++ { ++ ctx->mRT->BeginDraw(); ++ ctx->mRT->SetTransform(D2D1::IdentityMatrix()); ++ ctx->mDrawing = true; ++ } ++ } ++ ++ void ++ DWriteContext_BindDC(DWriteContext *ctx, HDC hdc, RECT *rect) ++ { ++ if (ctx != NULL && ctx->mRT != NULL) ++ { ++ ctx->mRT->BindDC(hdc, rect); ++ ctx->mRT->SetTextAntialiasMode(ctx->mTextAntialiasMode); ++ } ++ } ++ ++ void ++ DWriteContext_SetFont(DWriteContext *ctx, HFONT hFont) ++ { ++ if (ctx != NULL) ++ { ++ ctx->SetFont(hFont); ++ } ++ } ++ ++ void ++ DWriteContext_DrawText( ++ DWriteContext *ctx, ++ HDC hdc, ++ const WCHAR* text, ++ int len, ++ int x, ++ int y, ++ int w, ++ int h, ++ int cellWidth, ++ COLORREF color) ++ { ++ if (ctx != NULL) ++ ctx->DrawText(hdc, text, len, x, y, w, h, cellWidth, color); ++ } ++ ++ void ++ DWriteContext_EndDraw(DWriteContext *ctx) ++ { ++ if (ctx != NULL && ctx->mRT != NULL) ++ { ++ ctx->mRT->EndDraw(); ++ ctx->mDrawing = false; ++ } ++ } ++ ++ void ++ DWriteContext_Close(DWriteContext *ctx) ++ { ++ delete ctx; ++ } ++ ++ void ++ DWriteContext_SetRenderingParams( ++ DWriteContext *ctx, ++ const DWriteRenderingParams *params) ++ { ++ if (ctx != NULL) ++ ctx->SetRenderingParams(params); ++ } ++ ++ DWriteRenderingParams * ++ DWriteContext_GetRenderingParams( ++ DWriteContext *ctx, ++ DWriteRenderingParams *params) ++ { ++ if (ctx != NULL) ++ return ctx->GetRenderingParams(params); ++ else ++ return NULL; ++ } +*** ../vim-7.4.392/src/gui_dwrite.h 2014-08-06 14:49:19.667237363 +0200 +--- src/gui_dwrite.h 2014-08-06 14:21:57.459249166 +0200 +*************** +*** 0 **** +--- 1,85 ---- ++ /* vi:set ts=8 sts=4 sw=4 noet: */ ++ /* ++ * Author: MURAOKA Taro ++ * ++ * Contributors: ++ * - Ken Takata ++ * ++ * Copyright (C) 2013 MURAOKA Taro ++ * THIS FILE IS DISTRIBUTED UNDER THE VIM LICENSE. ++ */ ++ ++ #ifndef GUI_DWRITE_H ++ #define GUI_DWRITE_H ++ ++ #ifdef __cplusplus ++ extern "C" { ++ #endif ++ ++ typedef struct DWriteContext DWriteContext; ++ ++ typedef struct DWriteRenderingParams { ++ float gamma; ++ float enhancedContrast; ++ float clearTypeLevel; ++ /* ++ * pixelGeometry: ++ * 0 - DWRITE_PIXEL_GEOMETRY_FLAT ++ * 1 - DWRITE_PIXEL_GEOMETRY_RGB ++ * 2 - DWRITE_PIXEL_GEOMETRY_BGR ++ */ ++ int pixelGeometry; ++ /* ++ * renderingMode: ++ * 0 - DWRITE_RENDERING_MODE_DEFAULT ++ * 1 - DWRITE_RENDERING_MODE_ALIASED ++ * 2 - DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC ++ * 3 - DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL ++ * 4 - DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL ++ * 5 - DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC ++ * 6 - DWRITE_RENDERING_MODE_OUTLINE ++ */ ++ int renderingMode; ++ /* ++ * antialiasMode: ++ * 0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT ++ * 1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE ++ * 2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE ++ * 3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED ++ */ ++ int textAntialiasMode; ++ } DWriteRenderingParams; ++ ++ void DWrite_Init(void); ++ void DWrite_Final(void); ++ ++ DWriteContext *DWriteContext_Open(void); ++ void DWriteContext_BeginDraw(DWriteContext *ctx); ++ void DWriteContext_BindDC(DWriteContext *ctx, HDC hdc, RECT *rect); ++ void DWriteContext_SetFont(DWriteContext *ctx, HFONT hFont); ++ void DWriteContext_DrawText( ++ DWriteContext *ctx, ++ HDC hdc, ++ const WCHAR* text, ++ int len, ++ int x, ++ int y, ++ int w, ++ int h, ++ int cellWidth, ++ COLORREF color); ++ void DWriteContext_EndDraw(DWriteContext *ctx); ++ void DWriteContext_Close(DWriteContext *ctx); ++ ++ void DWriteContext_SetRenderingParams( ++ DWriteContext *ctx, ++ const DWriteRenderingParams *params); ++ ++ DWriteRenderingParams *DWriteContext_GetRenderingParams( ++ DWriteContext *ctx, ++ DWriteRenderingParams *params); ++ ++ #ifdef __cplusplus ++ } ++ #endif ++ #endif/*GUI_DWRITE_H*/ +*** ../vim-7.4.392/src/gui_w32.c 2013-08-04 16:15:37.000000000 +0200 +--- src/gui_w32.c 2014-08-06 14:45:43.495238916 +0200 +*************** +*** 25,30 **** +--- 25,169 ---- + + #include "vim.h" + ++ #if defined(FEAT_DIRECTX) ++ # include "gui_dwrite.h" ++ #endif ++ ++ #if defined(FEAT_DIRECTX) || defined(PROTO) ++ static DWriteContext *s_dwc = NULL; ++ static int s_directx_enabled = 0; ++ static int s_directx_load_attempted = 0; ++ # define IS_ENABLE_DIRECTX() (s_directx_enabled && s_dwc != NULL) ++ ++ int ++ directx_enabled(void) ++ { ++ if (s_dwc != NULL) ++ return 1; ++ else if (s_directx_load_attempted) ++ return 0; ++ /* load DirectX */ ++ DWrite_Init(); ++ s_directx_load_attempted = 1; ++ s_dwc = DWriteContext_Open(); ++ return s_dwc != NULL ? 1 : 0; ++ } ++ #endif ++ ++ #if defined(FEAT_RENDER_OPTIONS) || defined(PROTO) ++ int ++ gui_mch_set_rendering_options(char_u *s) ++ { ++ #ifdef FEAT_DIRECTX ++ int retval = FAIL; ++ char_u *p, *q; ++ ++ int dx_enable = 0; ++ int dx_flags = 0; ++ float dx_gamma = 0.0f; ++ float dx_contrast = 0.0f; ++ float dx_level = 0.0f; ++ int dx_geom = 0; ++ int dx_renmode = 0; ++ int dx_taamode = 0; ++ ++ /* parse string as rendering options. */ ++ for (p = s; p != NULL && *p != NUL; ) ++ { ++ char_u item[256]; ++ char_u name[128]; ++ char_u value[128]; ++ ++ copy_option_part(&p, item, sizeof(item), ","); ++ if (p == NULL) ++ break; ++ q = &item[0]; ++ copy_option_part(&q, name, sizeof(name), ":"); ++ if (q == NULL) ++ return FAIL; ++ copy_option_part(&q, value, sizeof(value), ":"); ++ ++ if (STRCMP(name, "type") == 0) ++ { ++ if (STRCMP(value, "directx") == 0) ++ dx_enable = 1; ++ else ++ return FAIL; ++ } ++ else if (STRCMP(name, "gamma") == 0) ++ { ++ dx_flags |= 1 << 0; ++ dx_gamma = (float)atof(value); ++ } ++ else if (STRCMP(name, "contrast") == 0) ++ { ++ dx_flags |= 1 << 1; ++ dx_contrast = (float)atof(value); ++ } ++ else if (STRCMP(name, "level") == 0) ++ { ++ dx_flags |= 1 << 2; ++ dx_level = (float)atof(value); ++ } ++ else if (STRCMP(name, "geom") == 0) ++ { ++ dx_flags |= 1 << 3; ++ dx_geom = atoi(value); ++ if (dx_geom < 0 || dx_geom > 2) ++ return FAIL; ++ } ++ else if (STRCMP(name, "renmode") == 0) ++ { ++ dx_flags |= 1 << 4; ++ dx_renmode = atoi(value); ++ if (dx_renmode < 0 || dx_renmode > 6) ++ return FAIL; ++ } ++ else if (STRCMP(name, "taamode") == 0) ++ { ++ dx_flags |= 1 << 5; ++ dx_taamode = atoi(value); ++ if (dx_taamode < 0 || dx_taamode > 3) ++ return FAIL; ++ } ++ else ++ return FAIL; ++ } ++ ++ /* Enable DirectX/DirectWrite */ ++ if (dx_enable) ++ { ++ if (!directx_enabled()) ++ return FAIL; ++ DWriteContext_SetRenderingParams(s_dwc, NULL); ++ if (dx_flags) ++ { ++ DWriteRenderingParams param; ++ DWriteContext_GetRenderingParams(s_dwc, ¶m); ++ if (dx_flags & (1 << 0)) ++ param.gamma = dx_gamma; ++ if (dx_flags & (1 << 1)) ++ param.enhancedContrast = dx_contrast; ++ if (dx_flags & (1 << 2)) ++ param.clearTypeLevel = dx_level; ++ if (dx_flags & (1 << 3)) ++ param.pixelGeometry = dx_geom; ++ if (dx_flags & (1 << 4)) ++ param.renderingMode = dx_renmode; ++ if (dx_flags & (1 << 5)) ++ param.textAntialiasMode = dx_taamode; ++ DWriteContext_SetRenderingParams(s_dwc, ¶m); ++ } ++ } ++ s_directx_enabled = dx_enable; ++ ++ return OK; ++ #else ++ return FAIL; ++ #endif ++ } ++ #endif ++ + /* + * These are new in Windows ME/XP, only defined in recent compilers. + */ +*************** +*** 1624,1629 **** +--- 1763,1773 ---- + set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd)); + #endif + ++ #ifdef FEAT_RENDER_OPTIONS ++ if (p_rop) ++ (void)gui_mch_set_rendering_options(p_rop); ++ #endif ++ + theend: + /* Display any pending error messages */ + display_errors(); +*************** +*** 1695,1703 **** + + /* compute the size of the outside of the window */ + win_width = width + (GetSystemMetrics(SM_CXFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + win_height = height + (GetSystemMetrics(SM_CYFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + + GetSystemMetrics(SM_CYCAPTION) + #ifdef FEAT_MENU + + gui_mswin_get_menu_height(FALSE) +--- 1839,1847 ---- + + /* compute the size of the outside of the window */ + win_width = width + (GetSystemMetrics(SM_CXFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + win_height = height + (GetSystemMetrics(SM_CYFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + + GetSystemMetrics(SM_CYCAPTION) + #ifdef FEAT_MENU + + gui_mswin_get_menu_height(FALSE) +*************** +*** 2239,2244 **** +--- 2383,2391 ---- + #endif + HPEN hpen, old_pen; + int y; ++ #ifdef FEAT_DIRECTX ++ int font_is_ttf_or_vector = 0; ++ #endif + + #ifndef MSWIN16_FASTTEXT + /* +*************** +*** 2326,2331 **** +--- 2473,2492 ---- + SetTextColor(s_hdc, gui.currFgColor); + SelectFont(s_hdc, gui.currFont); + ++ #ifdef FEAT_DIRECTX ++ if (IS_ENABLE_DIRECTX()) ++ { ++ TEXTMETRIC tm; ++ ++ GetTextMetrics(s_hdc, &tm); ++ if (tm.tmPitchAndFamily & (TMPF_TRUETYPE | TMPF_VECTOR)) ++ { ++ font_is_ttf_or_vector = 1; ++ DWriteContext_SetFont(s_dwc, (HFONT)gui.currFont); ++ } ++ } ++ #endif ++ + if (pad_size != Columns || padding == NULL || padding[0] != gui.char_width) + { + vim_free(padding); +*************** +*** 2360,2365 **** +--- 2521,2534 ---- + if (text[n] >= 0x80) + break; + ++ #if defined(FEAT_DIRECTX) ++ /* Quick hack to enable DirectWrite. To use DirectWrite (antialias), it is ++ * required that unicode drawing routine, currently. So this forces it ++ * enabled. */ ++ if (enc_utf8 && IS_ENABLE_DIRECTX()) ++ n = 0; /* Keep n < len, to enter block for unicode. */ ++ #endif ++ + /* Check if the Unicode buffer exists and is big enough. Create it + * with the same length as the multi-byte string, the number of wide + * characters is always equal or smaller. */ +*************** +*** 2418,2425 **** + i += utfc_ptr2len_len(text + i, len - i); + ++clen; + } +! ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row), +! foptions, pcliprect, unicodebuf, wlen, unicodepdy); + len = cells; /* used for underlining */ + } + else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9) +--- 2587,2603 ---- + i += utfc_ptr2len_len(text + i, len - i); + ++clen; + } +! #if defined(FEAT_DIRECTX) +! if (IS_ENABLE_DIRECTX() && font_is_ttf_or_vector) +! { +! DWriteContext_DrawText(s_dwc, s_hdc, unicodebuf, wlen, +! TEXT_X(col), TEXT_Y(row), FILL_X(cells), FILL_Y(1), +! gui.char_width, gui.currFgColor); +! } +! else +! #endif +! ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row), +! foptions, pcliprect, unicodebuf, wlen, unicodepdy); + len = cells; /* used for underlining */ + } + else if ((enc_codepage > 0 && (int)GetACP() != enc_codepage) || enc_latin9) +*************** +*** 2549,2562 **** + + *screen_w = workarea_rect.right - workarea_rect.left + - (GetSystemMetrics(SM_CXFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + + /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include + * the menubar for MSwin, we subtract it from the screen height, so that + * the window size can be made to fit on the screen. */ + *screen_h = workarea_rect.bottom - workarea_rect.top + - (GetSystemMetrics(SM_CYFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + - GetSystemMetrics(SM_CYCAPTION) + #ifdef FEAT_MENU + - gui_mswin_get_menu_height(FALSE) +--- 2727,2740 ---- + + *screen_w = workarea_rect.right - workarea_rect.left + - (GetSystemMetrics(SM_CXFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + + /* FIXME: dirty trick: Because the gui_get_base_height() doesn't include + * the menubar for MSwin, we subtract it from the screen height, so that + * the window size can be made to fit on the screen. */ + *screen_h = workarea_rect.bottom - workarea_rect.top + - (GetSystemMetrics(SM_CYFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2 + - GetSystemMetrics(SM_CYCAPTION) + #ifdef FEAT_MENU + - gui_mswin_get_menu_height(FALSE) +*************** +*** 3188,3200 **** + GetWindowRect(s_hwnd, &rect); + maxDialogWidth = rect.right - rect.left + - (GetSystemMetrics(SM_CXFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + if (maxDialogWidth < DLG_MIN_MAX_WIDTH) + maxDialogWidth = DLG_MIN_MAX_WIDTH; + + maxDialogHeight = rect.bottom - rect.top + - (GetSystemMetrics(SM_CYFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 4 + - GetSystemMetrics(SM_CYCAPTION); + if (maxDialogHeight < DLG_MIN_MAX_HEIGHT) + maxDialogHeight = DLG_MIN_MAX_HEIGHT; +--- 3366,3378 ---- + GetWindowRect(s_hwnd, &rect); + maxDialogWidth = rect.right - rect.left + - (GetSystemMetrics(SM_CXFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 2; + if (maxDialogWidth < DLG_MIN_MAX_WIDTH) + maxDialogWidth = DLG_MIN_MAX_WIDTH; + + maxDialogHeight = rect.bottom - rect.top + - (GetSystemMetrics(SM_CYFRAME) + +! GetSystemMetrics(SM_CXPADDEDBORDER)) * 4 + - GetSystemMetrics(SM_CYCAPTION); + if (maxDialogHeight < DLG_MIN_MAX_HEIGHT) + maxDialogHeight = DLG_MIN_MAX_HEIGHT; +*************** +*** 3351,3361 **** + /* Restrict the size to a maximum. Causes a scrollbar to show up. */ + if (dlgheight > maxDialogHeight) + { +! msgheight = msgheight - (dlgheight - maxDialogHeight); +! dlgheight = maxDialogHeight; +! scroll_flag = WS_VSCROLL; +! /* Make sure scrollbar doesn't appear in the middle of the dialog */ +! messageWidth = dlgwidth - DLG_ICON_WIDTH - 3 * dlgPaddingX; + } + + add_word(PixelToDialogY(dlgheight)); +--- 3529,3539 ---- + /* Restrict the size to a maximum. Causes a scrollbar to show up. */ + if (dlgheight > maxDialogHeight) + { +! msgheight = msgheight - (dlgheight - maxDialogHeight); +! dlgheight = maxDialogHeight; +! scroll_flag = WS_VSCROLL; +! /* Make sure scrollbar doesn't appear in the middle of the dialog */ +! messageWidth = dlgwidth - DLG_ICON_WIDTH - 3 * dlgPaddingX; + } + + add_word(PixelToDialogY(dlgheight)); +*** ../vim-7.4.392/src/gui_w48.c 2014-03-23 15:12:29.923264336 +0100 +--- src/gui_w48.c 2014-08-06 14:21:57.463249166 +0200 +*************** +*** 2785,2790 **** +--- 2785,2794 ---- + + out_flush(); /* make sure all output has been processed */ + (void)BeginPaint(hwnd, &ps); ++ #if defined(FEAT_DIRECTX) ++ if (IS_ENABLE_DIRECTX()) ++ DWriteContext_BeginDraw(s_dwc); ++ #endif + + #ifdef FEAT_MBYTE + /* prevent multi-byte characters from misprinting on an invalid +*************** +*** 2800,2808 **** +--- 2804,2823 ---- + #endif + + if (!IsRectEmpty(&ps.rcPaint)) ++ { ++ #if defined(FEAT_DIRECTX) ++ if (IS_ENABLE_DIRECTX()) ++ DWriteContext_BindDC(s_dwc, s_hdc, &ps.rcPaint); ++ #endif + gui_redraw(ps.rcPaint.left, ps.rcPaint.top, + ps.rcPaint.right - ps.rcPaint.left + 1, + ps.rcPaint.bottom - ps.rcPaint.top + 1); ++ } ++ ++ #if defined(FEAT_DIRECTX) ++ if (IS_ENABLE_DIRECTX()) ++ DWriteContext_EndDraw(s_dwc); ++ #endif + EndPaint(hwnd, &ps); + } + } +*************** +*** 3043,3048 **** +--- 3058,3069 ---- + void + gui_mch_exit(int rc) + { ++ #if defined(FEAT_DIRECTX) ++ DWriteContext_Close(s_dwc); ++ DWrite_Final(); ++ s_dwc = NULL; ++ #endif ++ + ReleaseDC(s_textArea, s_hdc); + DeleteObject(s_brush); + +*** ../vim-7.4.392/src/option.c 2014-06-25 14:44:04.458358774 +0200 +--- src/option.c 2014-08-06 14:33:24.503244228 +0200 +*************** +*** 2124,2129 **** +--- 2124,2138 ---- + {"remap", NULL, P_BOOL|P_VI_DEF, + (char_u *)&p_remap, PV_NONE, + {(char_u *)TRUE, (char_u *)0L} SCRIPTID_INIT}, ++ {"renderoptions", "rop", P_STRING|P_COMMA|P_RCLR|P_VI_DEF, ++ #ifdef FEAT_RENDER_OPTIONS ++ (char_u *)&p_rop, PV_NONE, ++ {(char_u *)"", (char_u *)0L} ++ #else ++ (char_u *)NULL, PV_NONE, ++ {(char_u *)NULL, (char_u *)0L} ++ #endif ++ SCRIPTID_INIT}, + {"report", NULL, P_NUM|P_VI_DEF, + (char_u *)&p_report, PV_NONE, + {(char_u *)2L, (char_u *)0L} SCRIPTID_INIT}, +*************** +*** 6999,7004 **** +--- 7008,7021 ---- + } + #endif + ++ #if defined(FEAT_RENDER_OPTIONS) ++ else if (varp == &p_rop && gui.in_use) ++ { ++ if (!gui_mch_set_rendering_options(p_rop)) ++ errmsg = e_invarg; ++ } ++ #endif ++ + /* Options that are a list of flags. */ + else + { +*** ../vim-7.4.392/src/option.h 2014-06-25 14:39:35.110348584 +0200 +--- src/option.h 2014-08-06 14:23:25.419248534 +0200 +*************** +*** 655,660 **** +--- 655,663 ---- + #endif + EXTERN int p_remap; /* 'remap' */ + EXTERN long p_re; /* 'regexpengine' */ ++ #ifdef FEAT_RENDER_OPTIONS ++ EXTERN char_u *p_rop; /* 'renderoptions' */ ++ #endif + EXTERN long p_report; /* 'report' */ + #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) + EXTERN long p_pvh; /* 'previewheight' */ +*** ../vim-7.4.392/src/version.c 2014-08-06 13:36:56.091268582 +0200 +--- src/version.c 2014-08-06 14:29:39.183245847 +0200 +*************** +*** 189,194 **** +--- 189,201 ---- + #else + "-digraphs", + #endif ++ #ifdef FEAT_GUI_W32 ++ # ifdef FEAT_DIRECTX ++ "+directx", ++ # else ++ "-directx", ++ # endif ++ #endif + #ifdef FEAT_DND + "+dnd", + #else +*** ../vim-7.4.392/src/vim.h 2014-04-02 19:54:58.275599459 +0200 +--- src/vim.h 2014-08-06 14:21:57.467249166 +0200 +*************** +*** 134,139 **** +--- 134,146 ---- + # endif + #endif + ++ /* Check support for rendering options */ ++ #ifdef FEAT_GUI ++ # if defined(FEAT_DIRECTX) ++ # define FEAT_RENDER_OPTIONS ++ # endif ++ #endif ++ + /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */ + #if _MSC_VER >= 1400 + # define _CRT_SECURE_NO_DEPRECATE +*** ../vim-7.4.392/src/proto/gui_w32.pro 2013-08-10 13:37:36.000000000 +0200 +--- src/proto/gui_w32.pro 2014-08-06 14:33:04.155244374 +0200 +*************** +*** 1,4 **** +--- 1,6 ---- + /* gui_w32.c */ ++ int directx_enabled __ARGS((void)); ++ int gui_mch_set_rendering_options __ARGS((char_u *s)); + void gui_mch_set_blinking __ARGS((long wait, long on, long off)); + void gui_mch_stop_blink __ARGS((void)); + void gui_mch_start_blink __ARGS((void)); +*** ../vim-7.4.392/src/version.c 2014-08-06 13:36:56.091268582 +0200 +--- src/version.c 2014-08-06 14:29:39.183245847 +0200 +*************** +*** 736,737 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 393, + /**/ + +-- +A consultant is a person who takes your money and annoys your employees while +tirelessly searching for the best way to extend the consulting contract. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.394 b/7.4.394 new file mode 100644 index 0000000..fbe199c --- /dev/null +++ b/7.4.394 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.394 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.394 (after 7.4.393) +Problem: When using DirectX last italic character is incomplete. +Solution: Add one to the number of cells. (Ken Takata) +Files: src/gui_w32.c + + +*** ../vim-7.4.393/src/gui_w32.c 2014-08-06 14:52:05.043236174 +0200 +--- src/gui_w32.c 2014-08-06 16:45:56.927187071 +0200 +*************** +*** 2590,2597 **** + #if defined(FEAT_DIRECTX) + if (IS_ENABLE_DIRECTX() && font_is_ttf_or_vector) + { + DWriteContext_DrawText(s_dwc, s_hdc, unicodebuf, wlen, +! TEXT_X(col), TEXT_Y(row), FILL_X(cells), FILL_Y(1), + gui.char_width, gui.currFgColor); + } + else +--- 2590,2598 ---- + #if defined(FEAT_DIRECTX) + if (IS_ENABLE_DIRECTX() && font_is_ttf_or_vector) + { ++ /* Add one to "cells" for italics. */ + DWriteContext_DrawText(s_dwc, s_hdc, unicodebuf, wlen, +! TEXT_X(col), TEXT_Y(row), FILL_X(cells + 1), FILL_Y(1), + gui.char_width, gui.currFgColor); + } + else +*** ../vim-7.4.393/src/version.c 2014-08-06 14:52:05.047236174 +0200 +--- src/version.c 2014-08-06 16:46:54.279186658 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 394, + /**/ + +-- +The average life of an organization chart is six months. You can safely +ignore any order from your boss that would take six months to complete. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.395 b/7.4.395 new file mode 100644 index 0000000..943b44e --- /dev/null +++ b/7.4.395 @@ -0,0 +1,99 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.395 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.395 (after 7.4.355) +Problem: C indent is wrong below an if with wrapped condition followed by + curly braces. (Trevor Powell) +Solution: Make a copy of tryposBrace. +Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok + + +*** ../vim-7.4.394/src/misc1.c 2014-08-06 12:49:06.711289205 +0200 +--- src/misc1.c 2014-08-06 17:35:45.003165594 +0200 +*************** +*** 6995,7000 **** +--- 6995,7001 ---- + char_u *linecopy; + pos_T *trypos; + pos_T *tryposBrace = NULL; ++ pos_T tryposBraceCopy; + pos_T our_paren_pos; + char_u *start; + int start_brace; +*************** +*** 7532,7538 **** +--- 7533,7543 ---- + /* + * We are inside braces, there is a { before this line at the position + * stored in tryposBrace. ++ * Make a copy of tryposBrace, it may point to pos_copy inside ++ * find_start_brace(), which may be changed somewhere. + */ ++ tryposBraceCopy = *tryposBrace; ++ tryposBrace = &tryposBraceCopy; + trypos = tryposBrace; + ourscope = trypos->lnum; + start = ml_get(ourscope); +*** ../vim-7.4.394/src/testdir/test3.in 2014-07-03 22:57:51.299862927 +0200 +--- src/testdir/test3.in 2014-08-06 17:19:41.099172522 +0200 +*************** +*** 464,469 **** +--- 464,477 ---- + asdfasdf + } + ++ { ++ for ( int i = 0; ++ i < 10; i++ ) ++ { ++ } ++ i = 0; ++ } ++ + class bob + { + int foo() {return 1;} +*** ../vim-7.4.394/src/testdir/test3.ok 2014-07-03 22:57:51.299862927 +0200 +--- src/testdir/test3.ok 2014-08-06 17:20:11.867172301 +0200 +*************** +*** 452,457 **** +--- 452,465 ---- + asdfasdf + } + ++ { ++ for ( int i = 0; ++ i < 10; i++ ) ++ { ++ } ++ i = 0; ++ } ++ + class bob + { + int foo() {return 1;} +*** ../vim-7.4.394/src/version.c 2014-08-06 16:49:51.203185387 +0200 +--- src/version.c 2014-08-06 17:43:44.243162150 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 395, + /**/ + +-- +An operatingsystem is just a name you give to the rest of bloating +idiosyncratic machine-based-features you left out of your editor. + (author unknown) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.396 b/7.4.396 new file mode 100644 index 0000000..47b9a0c --- /dev/null +++ b/7.4.396 @@ -0,0 +1,291 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.396 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.396 +Problem: When 'clipboard' is "unnamed", :g/pat/d is very slow. (Praful) +Solution: Only set the clipboard after the last delete. (Christian Brabandt) +Files: src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/globals.h, + src/ops.c, src/proto/ui.pro, src/ui.c + + +*** ../vim-7.4.395/src/ex_cmds.c 2014-07-09 21:17:59.755550204 +0200 +--- src/ex_cmds.c 2014-08-06 18:06:37.931152276 +0200 +*************** +*** 5514,5520 **** +--- 5514,5528 ---- + smsg((char_u *)_("Pattern not found: %s"), pat); + } + else ++ { ++ #ifdef FEAT_CLIPBOARD ++ start_global_changes(); ++ #endif + global_exe(cmd); ++ #ifdef FEAT_CLIPBOARD ++ end_global_changes(); ++ #endif ++ } + + ml_clearmarked(); /* clear rest of the marks */ + vim_regfree(regmatch.regprog); +*** ../vim-7.4.395/src/ex_cmds2.c 2014-04-05 19:44:36.903160723 +0200 +--- src/ex_cmds2.c 2014-08-06 18:05:07.563152926 +0200 +*************** +*** 2464,2469 **** +--- 2464,2472 ---- + * great speed improvement. */ + save_ei = au_event_disable(",Syntax"); + #endif ++ #ifdef FEAT_CLIPBOARD ++ start_global_changes(); ++ #endif + + if (eap->cmdidx == CMD_windo + || eap->cmdidx == CMD_tabdo +*************** +*** 2591,2596 **** +--- 2594,2602 ---- + curbuf->b_fname, TRUE, curbuf); + } + #endif ++ #ifdef FEAT_CLIPBOARD ++ end_global_changes(); ++ #endif + } + + /* +*************** +*** 2750,2757 **** + * used. + * Returns OK when at least one match found, FAIL otherwise. + * +! * If "name" is NULL calls callback for each entry in runtimepath. Cookie is +! * passed by reference in this case, setting it to NULL indicates that callback + * has done its job. + */ + int +--- 2756,2763 ---- + * used. + * Returns OK when at least one match found, FAIL otherwise. + * +! * If "name" is NULL calls callback for each entry in runtimepath. Cookie is +! * passed by reference in this case, setting it to NULL indicates that callback + * has done its job. + */ + int +*** ../vim-7.4.395/src/ex_docmd.c 2014-06-17 17:48:21.780628008 +0200 +--- src/ex_docmd.c 2014-08-06 18:05:07.563152926 +0200 +*************** +*** 11534,11539 **** +--- 11534,11543 ---- + { + linenr_T lnum; + ++ #ifdef FEAT_CLIPBOARD ++ start_global_changes(); ++ #endif ++ + /* First set the marks for all lines closed/open. */ + for (lnum = eap->line1; lnum <= eap->line2; ++lnum) + if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed)) +*************** +*** 11542,11546 **** +--- 11546,11553 ---- + /* Execute the command on the marked lines. */ + global_exe(eap->arg); + ml_clearmarked(); /* clear rest of the marks */ ++ #ifdef FEAT_CLIPBOARD ++ end_global_changes(); ++ #endif + } + #endif +*** ../vim-7.4.395/src/globals.h 2014-07-30 17:21:53.815518506 +0200 +--- src/globals.h 2014-08-06 18:05:07.563152926 +0200 +*************** +*** 533,538 **** +--- 533,540 ---- + EXTERN int clip_autoselectml INIT(= FALSE); + EXTERN int clip_html INIT(= FALSE); + EXTERN regprog_T *clip_exclude_prog INIT(= NULL); ++ EXTERN int clip_did_set_selection INIT(= TRUE); ++ EXTERN int clip_unnamed_saved INIT(= 0); + #endif + + /* +*** ../vim-7.4.395/src/ops.c 2014-06-25 14:39:35.106348584 +0200 +--- src/ops.c 2014-08-06 18:05:07.563152926 +0200 +*************** +*** 1597,1605 **** + { + /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard', + * use '*' or '+' reg, respectively. "unnamedplus" prevails. */ +! if (*rp == 0 && clip_unnamed != 0) +! *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) + ? '+' : '*'; + if (!clip_star.available && *rp == '*') + *rp = 0; + if (!clip_plus.available && *rp == '+') +--- 1597,1611 ---- + { + /* If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard', + * use '*' or '+' reg, respectively. "unnamedplus" prevails. */ +! if (*rp == 0 && (clip_unnamed != 0 || clip_unnamed_saved != 0)) +! { +! if (clip_unnamed != 0) +! *rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available) +! ? '+' : '*'; +! else +! *rp = ((clip_unnamed_saved & CLIP_UNNAMED_PLUS) && clip_plus.available) + ? '+' : '*'; ++ } + if (!clip_star.available && *rp == '*') + *rp = 0; + if (!clip_plus.available && *rp == '+') +*************** +*** 3203,3209 **** + if (clip_star.available + && (curr == &(y_regs[STAR_REGISTER]) + || (!deleting && oap->regname == 0 +! && (clip_unnamed & CLIP_UNNAMED)))) + { + if (curr != &(y_regs[STAR_REGISTER])) + /* Copy the text from register 0 to the clipboard register. */ +--- 3209,3215 ---- + if (clip_star.available + && (curr == &(y_regs[STAR_REGISTER]) + || (!deleting && oap->regname == 0 +! && ((clip_unnamed | clip_unnamed_saved) & CLIP_UNNAMED)))) + { + if (curr != &(y_regs[STAR_REGISTER])) + /* Copy the text from register 0 to the clipboard register. */ +*************** +*** 3224,3230 **** + if (clip_plus.available + && (curr == &(y_regs[PLUS_REGISTER]) + || (!deleting && oap->regname == 0 +! && (clip_unnamed & CLIP_UNNAMED_PLUS)))) + { + if (curr != &(y_regs[PLUS_REGISTER])) + /* Copy the text from register 0 to the clipboard register. */ +--- 3230,3237 ---- + if (clip_plus.available + && (curr == &(y_regs[PLUS_REGISTER]) + || (!deleting && oap->regname == 0 +! && ((clip_unnamed | clip_unnamed_saved) & +! CLIP_UNNAMED_PLUS)))) + { + if (curr != &(y_regs[PLUS_REGISTER])) + /* Copy the text from register 0 to the clipboard register. */ +*** ../vim-7.4.395/src/proto/ui.pro 2013-08-10 13:37:29.000000000 +0200 +--- src/proto/ui.pro 2014-08-06 18:05:07.563152926 +0200 +*************** +*** 14,19 **** +--- 14,21 ---- + void clip_update_selection __ARGS((VimClipboard *clip)); + void clip_own_selection __ARGS((VimClipboard *cbd)); + void clip_lose_selection __ARGS((VimClipboard *cbd)); ++ void start_global_changes __ARGS((void)); ++ void end_global_changes __ARGS((void)); + void clip_auto_select __ARGS((void)); + int clip_isautosel_star __ARGS((void)); + int clip_isautosel_plus __ARGS((void)); +*** ../vim-7.4.395/src/ui.c 2014-06-25 14:39:35.114348584 +0200 +--- src/ui.c 2014-08-06 18:13:13.475149434 +0200 +*************** +*** 558,563 **** +--- 558,608 ---- + } + + /* ++ * Save and restore clip_unnamed before doing possibly many changes. This ++ * prevents accessing the clipboard very often which might slow down Vim ++ * considerably. ++ */ ++ ++ /* ++ * Save clip_unnamed and reset it. ++ */ ++ void ++ start_global_changes() ++ { ++ clip_unnamed_saved = clip_unnamed; ++ ++ if (clip_did_set_selection) ++ { ++ clip_unnamed = FALSE; ++ clip_did_set_selection = FALSE; ++ } ++ } ++ ++ /* ++ * Restore clip_unnamed and set the selection when needed. ++ */ ++ void ++ end_global_changes() ++ { ++ if (!clip_did_set_selection) ++ { ++ clip_did_set_selection = TRUE; ++ clip_unnamed = clip_unnamed_saved; ++ if (clip_unnamed & CLIP_UNNAMED) ++ { ++ clip_own_selection(&clip_star); ++ clip_gen_set_selection(&clip_star); ++ } ++ if (clip_unnamed & CLIP_UNNAMED_PLUS) ++ { ++ clip_own_selection(&clip_plus); ++ clip_gen_set_selection(&clip_plus); ++ } ++ } ++ clip_unnamed_saved = FALSE; ++ } ++ ++ /* + * Called when Visual mode is ended: update the selection. + */ + void +*************** +*** 1428,1433 **** +--- 1473,1487 ---- + clip_gen_set_selection(cbd) + VimClipboard *cbd; + { ++ if (!clip_did_set_selection) ++ { ++ /* Updating postponed, so that accessing the system clipboard won't ++ * hang Vim when accessing it many times (e.g. on a :g comand). */ ++ if (cbd == &clip_plus && (clip_unnamed_saved & CLIP_UNNAMED_PLUS)) ++ return; ++ else if (cbd == &clip_star && (clip_unnamed_saved & CLIP_UNNAMED)) ++ return; ++ } + #ifdef FEAT_XCLIPBOARD + # ifdef FEAT_GUI + if (gui.in_use) +*** ../vim-7.4.395/src/version.c 2014-08-06 17:44:09.867161966 +0200 +--- src/version.c 2014-08-06 18:04:47.359153071 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 396, + /**/ + +-- +You have heard the saying that if you put a thousand monkeys in a room with a +thousand typewriters and waited long enough, eventually you would have a room +full of dead monkeys. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.397 b/7.4.397 new file mode 100644 index 0000000..4d70ca6 --- /dev/null +++ b/7.4.397 @@ -0,0 +1,150 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.397 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.397 +Problem: Matchparen only uses the topmost syntax item. +Solution: Go through the syntax stack to find items. (James McCoy) + Also use getcurpos() when possible. +Files: runtime/plugin/matchparen.vim + + +*** ../vim-7.4.396/runtime/plugin/matchparen.vim 2014-06-17 17:48:21.772628007 +0200 +--- runtime/plugin/matchparen.vim 2014-08-06 19:02:04.967128364 +0200 +*************** +*** 1,6 **** + " Vim plugin for showing matching parens + " Maintainer: Bram Moolenaar +! " Last Change: 2014 Jun 17 + + " Exit quickly when: + " - this plugin was already loaded (or disabled) +--- 1,6 ---- + " Vim plugin for showing matching parens + " Maintainer: Bram Moolenaar +! " Last Change: 2014 Jul 19 + + " Exit quickly when: + " - this plugin was already loaded (or disabled) +*************** +*** 54,67 **** + let c_col = col('.') + let before = 0 + +! let c = getline(c_lnum)[c_col - 1] + let plist = split(&matchpairs, '.\zs[:,]') + let i = index(plist, c) + if i < 0 + " not found, in Insert mode try character before the cursor + if c_col > 1 && (mode() == 'i' || mode() == 'R') + let before = 1 +! let c = getline(c_lnum)[c_col - 2] + let i = index(plist, c) + endif + if i < 0 +--- 54,68 ---- + let c_col = col('.') + let before = 0 + +! let text = getline(c_lnum) +! let c = text[c_col - 1] + let plist = split(&matchpairs, '.\zs[:,]') + let i = index(plist, c) + if i < 0 + " not found, in Insert mode try character before the cursor + if c_col > 1 && (mode() == 'i' || mode() == 'R') + let before = 1 +! let c = text[c_col - 2] + let i = index(plist, c) + endif + if i < 0 +*************** +*** 87,100 **** + " Find the match. When it was just before the cursor move it there for a + " moment. + if before > 0 +! let save_cursor = winsaveview() + call cursor(c_lnum, c_col - before) + endif + +! " When not in a string or comment ignore matches inside them. + " We match "escape" for special items, such as lispEscapeSpecial. +! let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' . +! \ '=~? "string\\|character\\|singlequote\\|escape\\|comment"' + execute 'if' s_skip '| let s_skip = 0 | endif' + + " Limit the search to lines visible in the window. +--- 88,114 ---- + " Find the match. When it was just before the cursor move it there for a + " moment. + if before > 0 +! let has_getcurpos = exists("*getcurpos") +! if has_getcurpos +! " getcurpos() is more efficient but doesn't exist before 7.4.313. +! let save_cursor = getcurpos() +! else +! let save_cursor = winsaveview() +! endif + call cursor(c_lnum, c_col - before) + endif + +! " Build an expression that detects whether the current cursor position is in +! " certain syntax types (string, comment, etc.), for use as searchpairpos()'s +! " skip argument. + " We match "escape" for special items, such as lispEscapeSpecial. +! let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' . +! \ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))' +! " If executing the expression determines that the cursor is currently in +! " one of the syntax types, then we want searchpairpos() to find the pair +! " within those syntax types (i.e., not skip). Otherwise, the cursor is +! " outside of the syntax types and s_skip should keep its value so we skip any +! " matching pair inside the syntax types. + execute 'if' s_skip '| let s_skip = 0 | endif' + + " Limit the search to lines visible in the window. +*************** +*** 147,153 **** + endtry + + if before > 0 +! call winrestview(save_cursor) + endif + + " If a match is found setup match highlighting. +--- 161,171 ---- + endtry + + if before > 0 +! if has_getcurpos +! call setpos('.', save_cursor) +! else +! call winrestview(save_cursor) +! endif + endif + + " If a match is found setup match highlighting. +*** ../vim-7.4.396/src/version.c 2014-08-06 18:17:03.475147780 +0200 +--- src/version.c 2014-08-06 19:06:44.627126354 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 397, + /**/ + +-- +Often you're less important than your furniture. If you think about it, you +can get fired but your furniture stays behind, gainfully employed at the +company that didn't need _you_ anymore. + (Scott Adams - The Dilbert principle) + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.398 b/7.4.398 new file mode 100644 index 0000000..e710505 --- /dev/null +++ b/7.4.398 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.398 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.398 (after 7.4.393) +Problem: Gcc error for the argument of InterlockedIncrement() and + InterlockedDecrement(). (Axel Bender) +Solution: Remove "unsigned" from the cRefCount_ declaration. +Files: src/gui_dwrite.cpp + + +*** ../vim-7.4.397/src/gui_dwrite.cpp 2014-08-06 14:52:05.043236174 +0200 +--- src/gui_dwrite.cpp 2014-08-06 18:39:01.611138306 +0200 +*************** +*** 377,383 **** + } + + private: +! unsigned long cRefCount_; + IDWriteBitmapRenderTarget* pRenderTarget_; + IDWriteRenderingParams* pRenderingParams_; + }; +--- 377,383 ---- + } + + private: +! long cRefCount_; + IDWriteBitmapRenderTarget* pRenderTarget_; + IDWriteRenderingParams* pRenderingParams_; + }; +*** ../vim-7.4.397/src/version.c 2014-08-06 19:08:33.563125571 +0200 +--- src/version.c 2014-08-07 13:54:40.162639943 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 398, + /**/ + +-- +A)bort, R)etry, D)o it right this time + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.399 b/7.4.399 new file mode 100644 index 0000000..ef0fc69 --- /dev/null +++ b/7.4.399 @@ -0,0 +1,5057 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.399 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.399 +Problem: Encryption implementation is messy. Blowfish encryption has a + weakness. +Solution: Refactor the encryption, store the state in an allocated struct + instead of using a save/restore mechanism. Introduce the + "blowfish2" method, which does not have the weakness and encrypts + the whole undo file. (largely by David Leadbeater) +Files: runtime/doc/editing.txt, runtime/doc/options.txt, src/Makefile, + src/blowfish.c, src/crypt.c, src/crypt_zip.c, src/ex_docmd.c, + src/fileio.c, src/globals.h, src/main.c, src/memline.c, + src/misc2.c, src/option.c, src/proto.h, src/proto/blowfish.pro, + src/proto/crypt.pro, src/proto/crypt_zip.pro, + src/proto/fileio.pro, src/proto/misc2.pro, src/structs.h, + src/undo.c, src/testdir/test71.in, src/testdir/test71.ok, + src/testdir/test71a.in, src/testdir/test72.in, + src/testdir/test72.ok + + +*** ../vim-7.4.398/runtime/doc/editing.txt 2013-08-10 13:24:53.000000000 +0200 +--- runtime/doc/editing.txt 2014-08-09 15:35:40.101354406 +0200 +*************** +*** 1361,1371 **** + {only available when compiled with the |+cryptv| feature} *E833* + + The text in the swap file and the undo file is also encrypted. *E843* + + Note: The text in memory is not encrypted. A system administrator may be able + to see your text while you are editing it. When filtering text with +! ":!filter" or using ":w !command" the text is not encrypted, this may reveal +! it to others. The 'viminfo' file is not encrypted. + + WARNING: If you make a typo when entering the key and then write the file and + exit, the text will be lost! +--- 1362,1382 ---- + {only available when compiled with the |+cryptv| feature} *E833* + + The text in the swap file and the undo file is also encrypted. *E843* ++ However, this is done block-by-block and may reduce the time needed to crack a ++ password. You can disable the swap file, but then a crash will cause you to ++ lose your work. The undo file can be disabled without much disadvantage. > ++ :set noundofile ++ :noswapfile edit secrets + + Note: The text in memory is not encrypted. A system administrator may be able + to see your text while you are editing it. When filtering text with +! ":!filter" or using ":w !command" the text is also not encrypted, this may +! reveal it to others. The 'viminfo' file is not encrypted. +! +! You could do this to edit very secret text: > +! :set noundofile viminfo= +! :noswapfile edit secrets.txt +! Keep in mind that without a swap file you risk loosing your work in a crash. + + WARNING: If you make a typo when entering the key and then write the file and + exit, the text will be lost! +*************** +*** 1392,1409 **** + :set key= + + You can use the 'cryptmethod' option to select the type of encryption, use one +! of these two: > +! :setlocal cm=zip " weak method, backwards compatible +! :setlocal cm=blowfish " strong method + Do this before writing the file. When reading an encrypted file it will be + set automatically to the method used when that file was written. You can + change 'cryptmethod' before writing that file to change the method. + To set the default method, used for new files, use one of these in your + |vimrc| file: > + set cm=zip +! set cm=blowfish + The message given for reading and writing a file will show "[crypted]" when +! using zip, "[blowfish]" when using blowfish. + + When writing an undo file, the same key and method will be used for the text + in the undo file. |persistent-undo|. +--- 1403,1427 ---- + :set key= + + You can use the 'cryptmethod' option to select the type of encryption, use one +! of these: > +! :setlocal cm=zip " weak method, backwards compatible +! :setlocal cm=blowfish " method with flaws +! :setlocal cm=blowfish2 " medium strong method +! + Do this before writing the file. When reading an encrypted file it will be + set automatically to the method used when that file was written. You can + change 'cryptmethod' before writing that file to change the method. ++ + To set the default method, used for new files, use one of these in your + |vimrc| file: > + set cm=zip +! set cm=blowfish2 +! Use the first one if you need to be compatible with Vim 7.2 and older. Using +! "blowfish2" is highly recommended if you can use a Vim version that supports +! it. +! + The message given for reading and writing a file will show "[crypted]" when +! using zip, "[blowfish]" when using blowfish, etc. + + When writing an undo file, the same key and method will be used for the text + in the undo file. |persistent-undo|. +*************** +*** 1438,1444 **** + 0 string VimCrypt~ Vim encrypted file + >9 string 01 - "zip" cryptmethod + >9 string 02 - "blowfish" cryptmethod +! + + Notes: + - Encryption is not possible when doing conversion with 'charconvert'. +--- 1456,1462 ---- + 0 string VimCrypt~ Vim encrypted file + >9 string 01 - "zip" cryptmethod + >9 string 02 - "blowfish" cryptmethod +! >9 string 03 - "blowfish2" cryptmethod + + Notes: + - Encryption is not possible when doing conversion with 'charconvert'. +*************** +*** 1462,1481 **** + - Pkzip uses the same encryption as 'cryptmethod' "zip", and US Govt has no + objection to its export. Pkzip's public file APPNOTE.TXT describes this + algorithm in detail. + - Vim originates from the Netherlands. That is where the sources come from. + Thus the encryption code is not exported from the USA. + + ============================================================================== + 10. Timestamps *timestamp* *timestamps* + +! Vim remembers the modification timestamp of a file when you begin editing it. +! This is used to avoid that you have two different versions of the same file +! (without you knowing this). +! +! After a shell command is run (|:!cmd| |suspend| |:read!| |K|) timestamps are +! compared for all buffers in a window. Vim will run any associated +! |FileChangedShell| autocommands or display a warning for any files that have +! changed. In the GUI this happens when Vim regains input focus. + + *E321* *E462* + If you want to automatically reload a file when it has been changed outside of +--- 1480,1504 ---- + - Pkzip uses the same encryption as 'cryptmethod' "zip", and US Govt has no + objection to its export. Pkzip's public file APPNOTE.TXT describes this + algorithm in detail. ++ - The implmentation of 'cryptmethod' "blowfish" has a flaw. It is possible to ++ crack the first 64 bytes of a file and in some circumstances more of the ++ file. Use of it is not recommended, but it's still the strongest method ++ supported by Vim 7.3 and 7.4. The "zip" method is even weaker. + - Vim originates from the Netherlands. That is where the sources come from. + Thus the encryption code is not exported from the USA. + + ============================================================================== + 10. Timestamps *timestamp* *timestamps* + +! Vim remembers the modification timestamp, mode and size of a file when you +! begin editing it. This is used to avoid that you have two different versions +! of the same file (without you knowing this). +! +! After a shell command is run (|:!cmd| |suspend| |:read!| |K|) timestamps, +! file modes and file sizes are compared for all buffers in a window. Vim will +! run any associated |FileChangedShell| autocommands or display a warning for +! any files that have changed. In the GUI this happens when Vim regains input +! focus. + + *E321* *E462* + If you want to automatically reload a file when it has been changed outside of +*** ../vim-7.4.398/runtime/doc/options.txt 2014-08-06 14:52:05.039236174 +0200 +--- runtime/doc/options.txt 2014-08-09 15:36:48.165353916 +0200 +*************** +*** 2229,2238 **** + zip PkZip compatible method. A weak kind of encryption. + Backwards compatible with Vim 7.2 and older. + *blowfish* +! blowfish Blowfish method. Strong encryption. Requires Vim 7.3 +! or later, files can NOT be read by Vim 7.2 and older. +! This adds a "seed" to the file, every time you write +! the file the encrypted bytes will be different. + + When reading an encrypted file 'cryptmethod' will be set automatically + to the detected method of the file being read. Thus if you write it +--- 2229,2246 ---- + zip PkZip compatible method. A weak kind of encryption. + Backwards compatible with Vim 7.2 and older. + *blowfish* +! blowfish Blowfish method. Medium strong encryption but it has +! an implementation flaw. Requires Vim 7.3 or later, +! files can NOT be read by Vim 7.2 and older. This adds +! a "seed" to the file, every time you write the file +! the encrypted bytes will be different. +! *blowfish2* +! blowfish2 Blowfish method. Medium strong encryption. Requires +! Vim 7.4.399 or later, files can NOT be read by Vim 7.3 +! and older. This adds a "seed" to the file, every time +! you write the file the encrypted bytes will be +! different. The whole undo file is encrypted, not just +! the pieces of text. + + When reading an encrypted file 'cryptmethod' will be set automatically + to the detected method of the file being read. Thus if you write it +*** ../vim-7.4.398/src/Makefile 2014-05-22 14:54:22.850468654 +0200 +--- src/Makefile 2014-08-09 15:37:19.689353690 +0200 +*************** +*** 1431,1436 **** +--- 1431,1438 ---- + blowfish.c \ + buffer.c \ + charset.c \ ++ crypt.c \ ++ crypt_zip.c \ + diff.c \ + digraph.c \ + edit.c \ +*************** +*** 1520,1525 **** +--- 1522,1529 ---- + objects/buffer.o \ + objects/blowfish.o \ + objects/charset.o \ ++ objects/crypt.o \ ++ objects/crypt_zip.o \ + objects/diff.o \ + objects/digraph.o \ + objects/edit.o \ +*************** +*** 1589,1594 **** +--- 1593,1600 ---- + blowfish.pro \ + buffer.pro \ + charset.pro \ ++ crypt.pro \ ++ crypt_zip.pro \ + diff.pro \ + digraph.pro \ + edit.pro \ +*************** +*** 1753,1762 **** + languages: + @if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ + cd $(PODIR); \ +! CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \ + fi + -@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ +! cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \ + fi + + # Update the *.po files for changes in the sources. Only run manually. +--- 1759,1769 ---- + languages: + @if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ + cd $(PODIR); \ +! CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \ + fi + -@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \ +! cd $(PODIR); \ +! CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \ + fi + + # Update the *.po files for changes in the sources. Only run manually. +*************** +*** 1883,1890 **** +--- 1890,1903 ---- + # Run individual test, assuming that Vim was already compiled. + test1 test2 test3 test4 test5 test6 test7 test8 test9 \ + test_autoformat_join \ ++ test_breakindent \ ++ test_changelist \ + test_eval \ ++ test_insertcount \ ++ test_listlbr \ ++ test_listlbr_utf8 \ + test_options \ ++ test_qf_title \ + test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \ + test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \ + test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \ +*************** +*** 2506,2511 **** +--- 2519,2530 ---- + objects/charset.o: charset.c + $(CCC) -o $@ charset.c + ++ objects/crypt.o: crypt.c ++ $(CCC) -o $@ crypt.c ++ ++ objects/crypt_zip.o: crypt_zip.c ++ $(CCC) -o $@ crypt_zip.c ++ + objects/diff.o: diff.c + $(CCC) -o $@ diff.c + +*************** +*** 2855,2860 **** +--- 2874,2887 ---- + ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ + gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \ + arabic.h ++ objects/crypt.o: crypt.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ ++ ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ ++ gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \ ++ arabic.h ++ objects/crypt_zip.o: crypt_zip.c vim.h auto/config.h feature.h os_unix.h \ ++ auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \ ++ regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \ ++ globals.h farsi.h arabic.h + objects/diff.o: diff.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \ + ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \ + gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \ +*** ../vim-7.4.398/src/blowfish.c 2014-02-11 15:23:27.930123631 +0100 +--- src/blowfish.c 2014-08-09 15:31:32.493356185 +0200 +*************** +*** 9,25 **** + * Blowfish encryption for Vim; in Blowfish cipher feedback mode. + * Contributed by Mohsin Ahmed, http://www.cs.albany.edu/~mosh + * Based on http://www.schneier.com/blowfish.html by Bruce Schneier. + */ + + #include "vim.h" + +! #if defined(FEAT_CRYPT) + + #define ARRAY_LENGTH(A) (sizeof(A)/sizeof(A[0])) + + #define BF_BLOCK 8 + #define BF_BLOCK_MASK 7 +! #define BF_CFB_LEN (8*(BF_BLOCK)) + + typedef union { + UINT32_T ul[2]; +--- 9,33 ---- + * Blowfish encryption for Vim; in Blowfish cipher feedback mode. + * Contributed by Mohsin Ahmed, http://www.cs.albany.edu/~mosh + * Based on http://www.schneier.com/blowfish.html by Bruce Schneier. ++ * ++ * There are two variants: ++ * - The old one "blowfish" has a flaw which makes it much easier to crack the ++ * key. To see this, make a text file with one line of 1000 "x" characters ++ * and write it encrypted. Use "xxd" to inspect the bytes in the file. You ++ * will see that a block of 8 bytes repeats 8 times. ++ * - The new one "blowfish2" is better. It uses an 8 byte CFB to avoid the ++ * repeats. + */ + + #include "vim.h" + +! #if defined(FEAT_CRYPT) || defined(PROTO) + + #define ARRAY_LENGTH(A) (sizeof(A)/sizeof(A[0])) + + #define BF_BLOCK 8 + #define BF_BLOCK_MASK 7 +! #define BF_MAX_CFB_LEN (8 * BF_BLOCK) + + typedef union { + UINT32_T ul[2]; +*************** +*** 37,50 **** + # endif + #endif + +! static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr)); +! static void bf_e_cblock __ARGS((char_u *block)); +! static int bf_check_tables __ARGS((UINT32_T a_ipa[18], UINT32_T a_sbi[4][256], UINT32_T val)); + static int bf_self_test __ARGS((void)); + + /* Blowfish code */ +! static UINT32_T pax[18]; +! static UINT32_T ipa[18] = { + 0x243f6a88u, 0x85a308d3u, 0x13198a2eu, + 0x03707344u, 0xa4093822u, 0x299f31d0u, + 0x082efa98u, 0xec4e6c89u, 0x452821e6u, +--- 45,70 ---- + # endif + #endif + +! /* The state of encryption, referenced by cryptstate_T. */ +! typedef struct { +! UINT32_T pax[18]; /* P-array */ +! UINT32_T sbx[4][256]; /* S-boxes */ +! int randbyte_offset; +! int update_offset; +! char_u cfb_buffer[BF_MAX_CFB_LEN]; /* up to 64 bytes used */ +! int cfb_len; /* size of cfb_buffer actually used */ +! } bf_state_T; +! +! +! static void bf_e_block __ARGS((bf_state_T *state, UINT32_T *p_xl, UINT32_T *p_xr)); +! static void bf_e_cblock __ARGS((bf_state_T *state, char_u *block)); +! static int bf_check_tables __ARGS((UINT32_T pax[18], UINT32_T sbx[4][256], UINT32_T val)); + static int bf_self_test __ARGS((void)); ++ static void bf_key_init __ARGS((bf_state_T *state, char_u *password, char_u *salt, int salt_len)); ++ static void bf_cfb_init __ARGS((bf_state_T *state, char_u *seed, int seed_len)); + + /* Blowfish code */ +! static UINT32_T pax_init[18] = { + 0x243f6a88u, 0x85a308d3u, 0x13198a2eu, + 0x03707344u, 0xa4093822u, 0x299f31d0u, + 0x082efa98u, 0xec4e6c89u, 0x452821e6u, +*************** +*** 53,60 **** + 0xb5470917u, 0x9216d5d9u, 0x8979fb1bu + }; + +! static UINT32_T sbx[4][256]; +! static UINT32_T sbi[4][256] = { + {0xd1310ba6u, 0x98dfb5acu, 0x2ffd72dbu, 0xd01adfb7u, + 0xb8e1afedu, 0x6a267e96u, 0xba7c9045u, 0xf12c7f99u, + 0x24a19947u, 0xb3916cf7u, 0x0801f2e2u, 0x858efc16u, +--- 73,79 ---- + 0xb5470917u, 0x9216d5d9u, 0x8979fb1bu + }; + +! static UINT32_T sbx_init[4][256] = { + {0xd1310ba6u, 0x98dfb5acu, 0x2ffd72dbu, 0xd01adfb7u, + 0xb8e1afedu, 0x6a267e96u, 0xba7c9045u, 0xf12c7f99u, + 0x24a19947u, 0xb3916cf7u, 0x0801f2e2u, 0x858efc16u, +*************** +*** 314,346 **** + } + }; + +- + #define F1(i) \ +! xl ^= pax[i]; \ +! xr ^= ((sbx[0][xl >> 24] + \ +! sbx[1][(xl & 0xFF0000) >> 16]) ^ \ +! sbx[2][(xl & 0xFF00) >> 8]) + \ +! sbx[3][xl & 0xFF]; + + #define F2(i) \ +! xr ^= pax[i]; \ +! xl ^= ((sbx[0][xr >> 24] + \ +! sbx[1][(xr & 0xFF0000) >> 16]) ^ \ +! sbx[2][(xr & 0xFF00) >> 8]) + \ +! sbx[3][xr & 0xFF]; +! + + static void +! bf_e_block(p_xl, p_xr) + UINT32_T *p_xl; + UINT32_T *p_xr; + { +! UINT32_T temp, xl = *p_xl, xr = *p_xr; +! +! F1(0) F2(1) F1(2) F2(3) F1(4) F2(5) F1(6) F2(7) +! F1(8) F2(9) F1(10) F2(11) F1(12) F2(13) F1(14) F2(15) +! xl ^= pax[16]; +! xr ^= pax[17]; + temp = xl; + xl = xr; + xr = temp; +--- 333,372 ---- + } + }; + + #define F1(i) \ +! xl ^= bfs->pax[i]; \ +! xr ^= ((bfs->sbx[0][xl >> 24] + \ +! bfs->sbx[1][(xl & 0xFF0000) >> 16]) ^ \ +! bfs->sbx[2][(xl & 0xFF00) >> 8]) + \ +! bfs->sbx[3][xl & 0xFF]; + + #define F2(i) \ +! xr ^= bfs->pax[i]; \ +! xl ^= ((bfs->sbx[0][xr >> 24] + \ +! bfs->sbx[1][(xr & 0xFF0000) >> 16]) ^ \ +! bfs->sbx[2][(xr & 0xFF00) >> 8]) + \ +! bfs->sbx[3][xr & 0xFF]; + + static void +! bf_e_block(bfs, p_xl, p_xr) +! bf_state_T *bfs; + UINT32_T *p_xl; + UINT32_T *p_xr; + { +! UINT32_T temp; +! UINT32_T xl = *p_xl; +! UINT32_T xr = *p_xr; +! +! F1(0) F2(1) +! F1(2) F2(3) +! F1(4) F2(5) +! F1(6) F2(7) +! F1(8) F2(9) +! F1(10) F2(11) +! F1(12) F2(13) +! F1(14) F2(15) +! xl ^= bfs->pax[16]; +! xr ^= bfs->pax[17]; + temp = xl; + xl = xr; + xr = temp; +*************** +*** 348,369 **** + *p_xr = xr; + } + +- #if 0 /* not used */ +- static void +- bf_d_block(p_xl, p_xr) +- UINT32_T *p_xl; +- UINT32_T *p_xr; +- { +- UINT32_T temp, xl = *p_xl, xr = *p_xr; +- F1(17) F2(16) F1(15) F2(14) F1(13) F2(12) F1(11) F2(10) +- F1(9) F2(8) F1(7) F2(6) F1(5) F2(4) F1(3) F2(2) +- xl ^= pax[1]; +- xr ^= pax[0]; +- temp = xl; xl = xr; xr = temp; +- *p_xl = xl; *p_xr = xr; +- } +- #endif +- + + #ifdef WORDS_BIGENDIAN + # define htonl2(x) \ +--- 374,379 ---- +*************** +*** 374,380 **** + #endif + + static void +! bf_e_cblock(block) + char_u *block; + { + block8 bk; +--- 384,391 ---- + #endif + + static void +! bf_e_cblock(bfs, block) +! bf_state_T *bfs; + char_u *block; + { + block8 bk; +*************** +*** 382,416 **** + memcpy(bk.uc, block, 8); + htonl2(bk.ul[0]); + htonl2(bk.ul[1]); +! bf_e_block(&bk.ul[0], &bk.ul[1]); + htonl2(bk.ul[0]); + htonl2(bk.ul[1]); + memcpy(block, bk.uc, 8); + } + +- #if 0 /* not used */ +- void +- bf_d_cblock(block) +- char_u *block; +- { +- block8 bk; +- memcpy(bk.uc, block, 8); +- htonl2(bk.ul[0]); htonl2(bk.ul[1]); +- bf_d_block(&bk.ul[0], &bk.ul[1]); +- htonl2(bk.ul[0]); htonl2(bk.ul[1]); +- memcpy(block, bk.uc, 8); +- } +- #endif +- + /* + * Initialize the crypt method using "password" as the encryption key and + * "salt[salt_len]" as the salt. + */ +! void +! bf_key_init(password, salt, salt_len) +! char_u *password; +! char_u *salt; +! int salt_len; + { + int i, j, keypos = 0; + unsigned u; +--- 393,414 ---- + memcpy(bk.uc, block, 8); + htonl2(bk.ul[0]); + htonl2(bk.ul[1]); +! bf_e_block(bfs, &bk.ul[0], &bk.ul[1]); + htonl2(bk.ul[0]); + htonl2(bk.ul[1]); + memcpy(block, bk.uc, 8); + } + + /* + * Initialize the crypt method using "password" as the encryption key and + * "salt[salt_len]" as the salt. + */ +! static void +! bf_key_init(bfs, password, salt, salt_len) +! bf_state_T *bfs; +! char_u *password; +! char_u *salt; +! int salt_len; + { + int i, j, keypos = 0; + unsigned u; +*************** +*** 418,424 **** + char_u *key; + int keylen; + +! /* Process the key 1000 times. + * See http://en.wikipedia.org/wiki/Key_strengthening. */ + key = sha256_key(password, salt, salt_len); + for (i = 0; i < 1000; i++) +--- 416,422 ---- + char_u *key; + int keylen; + +! /* Process the key 1001 times. + * See http://en.wikipedia.org/wiki/Key_strengthening. */ + key = sha256_key(password, salt, salt_len); + for (i = 0; i < 1000; i++) +*************** +*** 437,488 **** + key[i] = u; + } + +! mch_memmove(sbx, sbi, 4 * 4 * 256); + + for (i = 0; i < 18; ++i) + { + val = 0; + for (j = 0; j < 4; ++j) + val = (val << 8) | key[keypos++ % keylen]; +! pax[i] = ipa[i] ^ val; + } + + data_l = data_r = 0; + for (i = 0; i < 18; i += 2) + { +! bf_e_block(&data_l, &data_r); +! pax[i + 0] = data_l; +! pax[i + 1] = data_r; + } + + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 256; j += 2) + { +! bf_e_block(&data_l, &data_r); +! sbx[i][j + 0] = data_l; +! sbx[i][j + 1] = data_r; + } + } + } + + /* +! * BF Self test for corrupted tables or instructions + */ + static int +! bf_check_tables(a_ipa, a_sbi, val) +! UINT32_T a_ipa[18]; +! UINT32_T a_sbi[4][256]; + UINT32_T val; + { + int i, j; + UINT32_T c = 0; + + for (i = 0; i < 18; i++) +! c ^= a_ipa[i]; + for (i = 0; i < 4; i++) + for (j = 0; j < 256; j++) +! c ^= a_sbi[i][j]; + return c == val; + } + +--- 435,488 ---- + key[i] = u; + } + +! /* Use "key" to initialize the P-array ("pax") and S-boxes ("sbx") of +! * Blowfish. */ +! mch_memmove(bfs->sbx, sbx_init, 4 * 4 * 256); + + for (i = 0; i < 18; ++i) + { + val = 0; + for (j = 0; j < 4; ++j) + val = (val << 8) | key[keypos++ % keylen]; +! bfs->pax[i] = pax_init[i] ^ val; + } + + data_l = data_r = 0; + for (i = 0; i < 18; i += 2) + { +! bf_e_block(bfs, &data_l, &data_r); +! bfs->pax[i + 0] = data_l; +! bfs->pax[i + 1] = data_r; + } + + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 256; j += 2) + { +! bf_e_block(bfs, &data_l, &data_r); +! bfs->sbx[i][j + 0] = data_l; +! bfs->sbx[i][j + 1] = data_r; + } + } + } + + /* +! * Blowfish self-test for corrupted tables or instructions. + */ + static int +! bf_check_tables(pax, sbx, val) +! UINT32_T pax[18]; +! UINT32_T sbx[4][256]; + UINT32_T val; + { + int i, j; + UINT32_T c = 0; + + for (i = 0; i < 18; i++) +! c ^= pax[i]; + for (i = 0; i < 4; i++) + for (j = 0; j < 256; j++) +! c ^= sbx[i][j]; + return c == val; + } + +*************** +*** 520,525 **** +--- 520,529 ---- + int err = 0; + block8 bk; + UINT32_T ui = 0xffffffffUL; ++ bf_state_T state; ++ ++ vim_memset(&state, 0, sizeof(bf_state_T)); ++ state.cfb_len = BF_MAX_CFB_LEN; + + /* We can't simply use sizeof(UINT32_T), it would generate a compiler + * warning. */ +*************** +*** 528,548 **** + EMSG(_("E820: sizeof(uint32_t) != 4")); + } + +! if (!bf_check_tables(ipa, sbi, 0x6ffa520a)) + err++; + + bn = ARRAY_LENGTH(bf_test_data); + for (i = 0; i < bn; i++) + { +! bf_key_init((char_u *)(bf_test_data[i].password), + bf_test_data[i].salt, + (int)STRLEN(bf_test_data[i].salt)); +! if (!bf_check_tables(pax, sbx, bf_test_data[i].keysum)) + err++; + + /* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */ + memcpy(bk.uc, bf_test_data[i].plaintxt, 8); +! bf_e_cblock(bk.uc); + if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0) + { + if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0) +--- 532,552 ---- + EMSG(_("E820: sizeof(uint32_t) != 4")); + } + +! if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a)) + err++; + + bn = ARRAY_LENGTH(bf_test_data); + for (i = 0; i < bn; i++) + { +! bf_key_init(&state, (char_u *)(bf_test_data[i].password), + bf_test_data[i].salt, + (int)STRLEN(bf_test_data[i].salt)); +! if (!bf_check_tables(state.pax, state.sbx, bf_test_data[i].keysum)) + err++; + + /* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */ + memcpy(bk.uc, bf_test_data[i].plaintxt, 8); +! bf_e_cblock(&state, bk.uc); + if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0) + { + if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0) +*************** +*** 554,596 **** + return err > 0 ? FAIL : OK; + } + +! /* Cipher feedback mode. */ +! static int randbyte_offset = 0; +! static int update_offset = 0; +! static char_u cfb_buffer[BF_CFB_LEN]; /* 64 bytes */ + + /* +! * Initialize with seed "iv[iv_len]". + */ +! void +! bf_cfb_init(iv, iv_len) +! char_u *iv; +! int iv_len; + { + int i, mi; + +! randbyte_offset = update_offset = 0; +! vim_memset(cfb_buffer, 0, BF_CFB_LEN); +! if (iv_len > 0) + { +! mi = iv_len > BF_CFB_LEN ? iv_len : BF_CFB_LEN; + for (i = 0; i < mi; i++) +! cfb_buffer[i % BF_CFB_LEN] ^= iv[i % iv_len]; + } + } + +! #define BF_CFB_UPDATE(c) { \ +! cfb_buffer[update_offset] ^= (char_u)c; \ +! if (++update_offset == BF_CFB_LEN) \ +! update_offset = 0; \ + } + +! #define BF_RANBYTE(t) { \ +! if ((randbyte_offset & BF_BLOCK_MASK) == 0) \ +! bf_e_cblock(&cfb_buffer[randbyte_offset]); \ +! t = cfb_buffer[randbyte_offset]; \ +! if (++randbyte_offset == BF_CFB_LEN) \ +! randbyte_offset = 0; \ + } + + /* +--- 558,600 ---- + return err > 0 ? FAIL : OK; + } + +! /* +! * CFB: Cipher Feedback Mode. +! */ + + /* +! * Initialize with seed "seed[seed_len]". + */ +! static void +! bf_cfb_init(bfs, seed, seed_len) +! bf_state_T *bfs; +! char_u *seed; +! int seed_len; + { + int i, mi; + +! bfs->randbyte_offset = bfs->update_offset = 0; +! vim_memset(bfs->cfb_buffer, 0, bfs->cfb_len); +! if (seed_len > 0) + { +! mi = seed_len > bfs->cfb_len ? seed_len : bfs->cfb_len; + for (i = 0; i < mi; i++) +! bfs->cfb_buffer[i % bfs->cfb_len] ^= seed[i % seed_len]; + } + } + +! #define BF_CFB_UPDATE(bfs, c) { \ +! bfs->cfb_buffer[bfs->update_offset] ^= (char_u)c; \ +! if (++bfs->update_offset == bfs->cfb_len) \ +! bfs->update_offset = 0; \ + } + +! #define BF_RANBYTE(bfs, t) { \ +! if ((bfs->randbyte_offset & BF_BLOCK_MASK) == 0) \ +! bf_e_cblock(bfs, &(bfs->cfb_buffer[bfs->randbyte_offset])); \ +! t = bfs->cfb_buffer[bfs->randbyte_offset]; \ +! if (++bfs->randbyte_offset == bfs->cfb_len) \ +! bfs->randbyte_offset = 0; \ + } + + /* +*************** +*** 598,687 **** + * "from" and "to" can be equal to encrypt in place. + */ + void +! bf_crypt_encode(from, len, to) + char_u *from; + size_t len; + char_u *to; + { + size_t i; + int ztemp, t; + + for (i = 0; i < len; ++i) + { + ztemp = from[i]; +! BF_RANBYTE(t); +! BF_CFB_UPDATE(ztemp); + to[i] = t ^ ztemp; + } + } + + /* +! * Decrypt "ptr[len]" in place. + */ + void +! bf_crypt_decode(ptr, len) +! char_u *ptr; +! long len; + { +! char_u *p; + int t; + +! for (p = ptr; p < ptr + len; ++p) + { +! BF_RANBYTE(t); +! *p ^= t; +! BF_CFB_UPDATE(*p); + } + } + +- /* +- * Initialize the encryption keys and the random header according to +- * the given password. +- */ + void +! bf_crypt_init_keys(passwd) +! char_u *passwd; /* password string with which to modify keys */ +! { +! char_u *p; +! +! for (p = passwd; *p != NUL; ++p) +! { +! BF_CFB_UPDATE(*p); +! } +! } + +! static int save_randbyte_offset; +! static int save_update_offset; +! static char_u save_cfb_buffer[BF_CFB_LEN]; +! static UINT32_T save_pax[18]; +! static UINT32_T save_sbx[4][256]; +! +! /* +! * Save the current crypt state. Can only be used once before +! * bf_crypt_restore(). +! */ +! void +! bf_crypt_save() +! { +! save_randbyte_offset = randbyte_offset; +! save_update_offset = update_offset; +! mch_memmove(save_cfb_buffer, cfb_buffer, BF_CFB_LEN); +! mch_memmove(save_pax, pax, 4 * 18); +! mch_memmove(save_sbx, sbx, 4 * 4 * 256); +! } + +! /* +! * Restore the current crypt state. Can only be used after +! * bf_crypt_save(). +! */ +! void +! bf_crypt_restore() +! { +! randbyte_offset = save_randbyte_offset; +! update_offset = save_update_offset; +! mch_memmove(cfb_buffer, save_cfb_buffer, BF_CFB_LEN); +! mch_memmove(pax, save_pax, 4 * 18); +! mch_memmove(sbx, save_sbx, 4 * 4 * 256); + } + + /* +--- 602,670 ---- + * "from" and "to" can be equal to encrypt in place. + */ + void +! crypt_blowfish_encode(state, from, len, to) +! cryptstate_T *state; + char_u *from; + size_t len; + char_u *to; + { ++ bf_state_T *bfs = state->method_state; + size_t i; + int ztemp, t; + + for (i = 0; i < len; ++i) + { + ztemp = from[i]; +! BF_RANBYTE(bfs, t); +! BF_CFB_UPDATE(bfs, ztemp); + to[i] = t ^ ztemp; + } + } + + /* +! * Decrypt "from[len]" into "to[len]". + */ + void +! crypt_blowfish_decode(state, from, len, to) +! cryptstate_T *state; +! char_u *from; +! size_t len; +! char_u *to; + { +! bf_state_T *bfs = state->method_state; +! size_t i; + int t; + +! for (i = 0; i < len; ++i) + { +! BF_RANBYTE(bfs, t); +! to[i] = from[i] ^ t; +! BF_CFB_UPDATE(bfs, to[i]); + } + } + + void +! crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len) +! cryptstate_T *state; +! char_u* key; +! char_u* salt; +! int salt_len; +! char_u* seed; +! int seed_len; +! { +! bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T)); +! +! state->method_state = bfs; +! +! /* "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8 +! * times. "blowfish2" uses a 8 byte buffer to avoid repeating. */ +! bfs->cfb_len = state->method_nr == CRYPT_M_BF ? BF_MAX_CFB_LEN : BF_BLOCK; + +! if (blowfish_self_test() == FAIL) +! return; + +! bf_key_init(bfs, key, salt, salt_len); +! bf_cfb_init(bfs, seed, seed_len); + } + + /* +*** ../vim-7.4.398/src/crypt.c 2014-08-10 13:30:43.816787293 +0200 +--- src/crypt.c 2014-08-09 15:37:46.189353499 +0200 +*************** +*** 0 **** +--- 1,585 ---- ++ /* vi:set ts=8 sts=4 sw=4: ++ * ++ * VIM - Vi IMproved by Bram Moolenaar ++ * ++ * Do ":help uganda" in Vim to read copying and usage conditions. ++ * Do ":help credits" in Vim to see a list of people who contributed. ++ * See README.txt for an overview of the Vim source code. ++ */ ++ ++ /* ++ * crypt.c: Generic encryption support. ++ */ ++ #include "vim.h" ++ ++ #if defined(FEAT_CRYPT) || defined(PROTO) ++ /* ++ * Optional encryption support. ++ * Mohsin Ahmed, mosh@sasi.com, 1998-09-24 ++ * Based on zip/crypt sources. ++ * Refactored by David Leadbeater, 2014. ++ * ++ * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to ++ * most countries. There are a few exceptions, but that still should not be a ++ * problem since this code was originally created in Europe and India. ++ * ++ * Blowfish addition originally made by Mohsin Ahmed, ++ * http://www.cs.albany.edu/~mosh 2010-03-14 ++ * Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html) ++ * and sha256 by Christophe Devine. ++ */ ++ ++ typedef struct { ++ char *name; /* encryption name as used in 'cryptmethod' */ ++ char *magic; /* magic bytes stored in file header */ ++ int salt_len; /* length of salt, or 0 when not using salt */ ++ int seed_len; /* length of seed, or 0 when not using salt */ ++ int works_inplace; /* encryption/decryption can be done in-place */ ++ int whole_undofile; /* whole undo file is encrypted */ ++ ++ /* Optional function pointer for a self-test. */ ++ int (* self_test_fn)(); ++ ++ /* Function pointer for initializing encryption/decription. */ ++ void (* init_fn)(cryptstate_T *state, char_u *key, ++ char_u *salt, int salt_len, char_u *seed, int seed_len); ++ ++ /* Function pointers for encoding/decoding from one buffer into another. ++ * Optional, however, these or the _buffer ones should be configured. */ ++ void (*encode_fn)(cryptstate_T *state, char_u *from, size_t len, ++ char_u *to); ++ void (*decode_fn)(cryptstate_T *state, char_u *from, size_t len, ++ char_u *to); ++ ++ /* Function pointers for encoding and decoding, can buffer data if needed. ++ * Optional (however, these or the above should be configured). */ ++ long (*encode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len, ++ char_u **newptr); ++ long (*decode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len, ++ char_u **newptr); ++ ++ /* Function pointers for in-place encoding and decoding, used for ++ * crypt_*_inplace(). "from" and "to" arguments will be equal. ++ * These may be the same as decode_fn and encode_fn above, however an ++ * algorithm may implement them in a way that is not interchangeable with ++ * the crypt_(en|de)code() interface (for example because it wishes to add ++ * padding to files). ++ * This method is used for swap and undo files which have a rigid format. ++ */ ++ void (*encode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len, ++ char_u *p2); ++ void (*decode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len, ++ char_u *p2); ++ } cryptmethod_T; ++ ++ /* index is method_nr of cryptstate_T, CRYPT_M_* */ ++ static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = { ++ /* PK_Zip; very weak */ ++ { ++ "zip", ++ "VimCrypt~01!", ++ 0, ++ 0, ++ TRUE, ++ FALSE, ++ NULL, ++ crypt_zip_init, ++ crypt_zip_encode, crypt_zip_decode, ++ NULL, NULL, ++ crypt_zip_encode, crypt_zip_decode, ++ }, ++ ++ /* Blowfish/CFB + SHA-256 custom key derivation; implementation issues. */ ++ { ++ "blowfish", ++ "VimCrypt~02!", ++ 8, ++ 8, ++ TRUE, ++ FALSE, ++ blowfish_self_test, ++ crypt_blowfish_init, ++ crypt_blowfish_encode, crypt_blowfish_decode, ++ NULL, NULL, ++ crypt_blowfish_encode, crypt_blowfish_decode, ++ }, ++ ++ /* Blowfish/CFB + SHA-256 custom key derivation; fixed. */ ++ { ++ "blowfish2", ++ "VimCrypt~03!", ++ 8, ++ 8, ++ TRUE, ++ TRUE, ++ blowfish_self_test, ++ crypt_blowfish_init, ++ crypt_blowfish_encode, crypt_blowfish_decode, ++ NULL, NULL, ++ crypt_blowfish_encode, crypt_blowfish_decode, ++ }, ++ }; ++ ++ #define CRYPT_MAGIC_LEN 12 /* cannot change */ ++ static char crypt_magic_head[] = "VimCrypt~"; ++ ++ /* ++ * Return int value for crypt method name. ++ * 0 for "zip", the old method. Also for any non-valid value. ++ * 1 for "blowfish". ++ * 2 for "blowfish2". ++ */ ++ int ++ crypt_method_nr_from_name(name) ++ char_u *name; ++ { ++ int i; ++ ++ for (i = 0; i < CRYPT_M_COUNT; ++i) ++ if (STRCMP(name, cryptmethods[i].name) == 0) ++ return i; ++ return 0; ++ } ++ ++ /* ++ * Get the crypt method used for a file from "ptr[len]", the magic text at the ++ * start of the file. ++ * Returns -1 when no encryption used. ++ */ ++ int ++ crypt_method_nr_from_magic(ptr, len) ++ char *ptr; ++ int len; ++ { ++ int i; ++ ++ if (len < CRYPT_MAGIC_LEN) ++ return -1; ++ ++ for (i = 0; i < CRYPT_M_COUNT; i++) ++ if (memcmp(ptr, cryptmethods[i].magic, CRYPT_MAGIC_LEN) == 0) ++ return i; ++ ++ i = (int)STRLEN(crypt_magic_head); ++ if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0) ++ EMSG(_("E821: File is encrypted with unknown method")); ++ ++ return -1; ++ } ++ ++ /* ++ * Return TRUE if the crypt method for "method_nr" can be done in-place. ++ */ ++ int ++ crypt_works_inplace(state) ++ cryptstate_T *state; ++ { ++ return cryptmethods[state->method_nr].works_inplace; ++ } ++ ++ /* ++ * Get the crypt method for buffer "buf" as a number. ++ */ ++ int ++ crypt_get_method_nr(buf) ++ buf_T *buf; ++ { ++ return crypt_method_nr_from_name(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm); ++ } ++ ++ /* ++ * Return TRUE when the buffer uses an encryption method that encrypts the ++ * whole undo file, not only the text. ++ */ ++ int ++ crypt_whole_undofile(method_nr) ++ int method_nr; ++ { ++ return cryptmethods[method_nr].whole_undofile; ++ } ++ ++ /* ++ * Get crypt method specifc length of the file header in bytes. ++ */ ++ int ++ crypt_get_header_len(method_nr) ++ int method_nr; ++ { ++ return CRYPT_MAGIC_LEN ++ + cryptmethods[method_nr].salt_len ++ + cryptmethods[method_nr].seed_len; ++ } ++ ++ /* ++ * Set the crypt method for buffer "buf" to "method_nr" using the int value as ++ * returned by crypt_method_nr_from_name(). ++ */ ++ void ++ crypt_set_cm_option(buf, method_nr) ++ buf_T *buf; ++ int method_nr; ++ { ++ free_string_option(buf->b_p_cm); ++ buf->b_p_cm = vim_strsave((char_u *)cryptmethods[method_nr].name); ++ } ++ ++ /* ++ * If the crypt method for the current buffer has a self-test, run it and ++ * return OK/FAIL. ++ */ ++ int ++ crypt_self_test() ++ { ++ int method_nr = crypt_get_method_nr(curbuf); ++ ++ if (cryptmethods[method_nr].self_test_fn == NULL) ++ return OK; ++ return cryptmethods[method_nr].self_test_fn(); ++ } ++ ++ /* ++ * Allocate a crypt state and initialize it. ++ */ ++ cryptstate_T * ++ crypt_create(method_nr, key, salt, salt_len, seed, seed_len) ++ int method_nr; ++ char_u *key; ++ char_u *salt; ++ int salt_len; ++ char_u *seed; ++ int seed_len; ++ { ++ cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T)); ++ ++ state->method_nr = method_nr; ++ cryptmethods[method_nr].init_fn(state, key, salt, salt_len, seed, seed_len); ++ return state; ++ } ++ ++ /* ++ * Allocate a crypt state from a file header and initialize it. ++ * Assumes that header contains at least the number of bytes that ++ * crypt_get_header_len() returns for "method_nr". ++ */ ++ cryptstate_T * ++ crypt_create_from_header(method_nr, key, header) ++ int method_nr; ++ char_u *key; ++ char_u *header; ++ { ++ char_u *salt = NULL; ++ char_u *seed = NULL; ++ int salt_len = cryptmethods[method_nr].salt_len; ++ int seed_len = cryptmethods[method_nr].seed_len; ++ ++ if (salt_len > 0) ++ salt = header + CRYPT_MAGIC_LEN; ++ if (seed_len > 0) ++ seed = header + CRYPT_MAGIC_LEN + salt_len; ++ ++ return crypt_create(method_nr, key, salt, salt_len, seed, seed_len); ++ } ++ ++ /* ++ * Read the crypt method specific header data from "fp". ++ * Return an allocated cryptstate_T or NULL on error. ++ */ ++ cryptstate_T * ++ crypt_create_from_file(fp, key) ++ FILE *fp; ++ char_u *key; ++ { ++ int method_nr; ++ int header_len; ++ char magic_buffer[CRYPT_MAGIC_LEN]; ++ char_u *buffer; ++ cryptstate_T *state; ++ ++ if (fread(magic_buffer, CRYPT_MAGIC_LEN, 1, fp) != 1) ++ return NULL; ++ method_nr = crypt_method_nr_from_magic(magic_buffer, CRYPT_MAGIC_LEN); ++ if (method_nr < 0) ++ return NULL; ++ ++ header_len = crypt_get_header_len(method_nr); ++ if ((buffer = alloc(header_len)) == NULL) ++ return NULL; ++ mch_memmove(buffer, magic_buffer, CRYPT_MAGIC_LEN); ++ if (header_len > CRYPT_MAGIC_LEN ++ && fread(buffer + CRYPT_MAGIC_LEN, ++ header_len - CRYPT_MAGIC_LEN, 1, fp) != 1) ++ { ++ vim_free(buffer); ++ return NULL; ++ } ++ ++ state = crypt_create_from_header(method_nr, key, buffer); ++ vim_free(buffer); ++ return state; ++ } ++ ++ /* ++ * Allocate a cryptstate_T for writing and initialize it with "key". ++ * Allocates and fills in the header and stores it in "header", setting ++ * "header_len". The header may include salt and seed, depending on ++ * cryptmethod. Caller must free header. ++ * Returns the state or NULL on failure. ++ */ ++ cryptstate_T * ++ crypt_create_for_writing(method_nr, key, header, header_len) ++ int method_nr; ++ char_u *key; ++ char_u **header; ++ int *header_len; ++ { ++ int len = crypt_get_header_len(method_nr); ++ char_u *salt = NULL; ++ char_u *seed = NULL; ++ int salt_len = cryptmethods[method_nr].salt_len; ++ int seed_len = cryptmethods[method_nr].seed_len; ++ cryptstate_T *state; ++ ++ *header_len = len; ++ *header = alloc(len); ++ if (*header == NULL) ++ return NULL; ++ ++ mch_memmove(*header, cryptmethods[method_nr].magic, CRYPT_MAGIC_LEN); ++ if (salt_len > 0 || seed_len > 0) ++ { ++ if (salt_len > 0) ++ salt = *header + CRYPT_MAGIC_LEN; ++ if (seed_len > 0) ++ seed = *header + CRYPT_MAGIC_LEN + salt_len; ++ ++ /* TODO: Should this be crypt method specific? (Probably not worth ++ * it). sha2_seed is pretty bad for large amounts of entropy, so make ++ * that into something which is suitable for anything. */ ++ sha2_seed(salt, salt_len, seed, seed_len); ++ } ++ ++ state = crypt_create(method_nr, key, salt, salt_len, seed, seed_len); ++ if (state == NULL) ++ { ++ vim_free(*header); ++ *header = NULL; ++ } ++ return state; ++ } ++ ++ /* ++ * Free the crypt state. ++ */ ++ void ++ crypt_free_state(state) ++ cryptstate_T *state; ++ { ++ vim_free(state->method_state); ++ vim_free(state); ++ } ++ ++ /* ++ * Encode "from[len]" and store the result in a newly allocated buffer, which ++ * is stored in "newptr". ++ * Return number of bytes in "newptr", 0 for need more or -1 on error. ++ */ ++ long ++ crypt_encode_alloc(state, from, len, newptr) ++ cryptstate_T *state; ++ char_u *from; ++ size_t len; ++ char_u **newptr; ++ { ++ cryptmethod_T *method = &cryptmethods[state->method_nr]; ++ ++ if (method->encode_buffer_fn != NULL) ++ /* Has buffer function, pass through. */ ++ return method->encode_buffer_fn(state, from, len, newptr); ++ if (len == 0) ++ /* Not buffering, just return EOF. */ ++ return len; ++ ++ *newptr = alloc(len); ++ if (*newptr == NULL) ++ return -1; ++ method->encode_fn(state, from, len, *newptr); ++ return len; ++ } ++ ++ /* ++ * Decrypt "ptr[len]" and store the result in a newly allocated buffer, which ++ * is stored in "newptr". ++ * Return number of bytes in "newptr", 0 for need more or -1 on error. ++ */ ++ long ++ crypt_decode_alloc(state, ptr, len, newptr) ++ cryptstate_T *state; ++ char_u *ptr; ++ long len; ++ char_u **newptr; ++ { ++ cryptmethod_T *method = &cryptmethods[state->method_nr]; ++ ++ if (method->decode_buffer_fn != NULL) ++ /* Has buffer function, pass through. */ ++ return method->decode_buffer_fn(state, ptr, len, newptr); ++ ++ if (len == 0) ++ /* Not buffering, just return EOF. */ ++ return len; ++ ++ *newptr = alloc(len); ++ if (*newptr == NULL) ++ return -1; ++ method->decode_fn(state, ptr, len, *newptr); ++ return len; ++ } ++ ++ /* ++ * Encrypting "from[len]" into "to[len]". ++ */ ++ void ++ crypt_encode(state, from, len, to) ++ cryptstate_T *state; ++ char_u *from; ++ size_t len; ++ char_u *to; ++ { ++ cryptmethods[state->method_nr].encode_fn(state, from, len, to); ++ } ++ ++ /* ++ * decrypting "from[len]" into "to[len]". ++ */ ++ void ++ crypt_decode(state, from, len, to) ++ cryptstate_T *state; ++ char_u *from; ++ size_t len; ++ char_u *to; ++ { ++ cryptmethods[state->method_nr].decode_fn(state, from, len, to); ++ } ++ ++ /* ++ * Simple inplace encryption, modifies "buf[len]" in place. ++ */ ++ void ++ crypt_encode_inplace(state, buf, len) ++ cryptstate_T *state; ++ char_u *buf; ++ size_t len; ++ { ++ cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf); ++ } ++ ++ /* ++ * Simple inplace decryption, modifies "buf[len]" in place. ++ */ ++ void ++ crypt_decode_inplace(state, buf, len) ++ cryptstate_T *state; ++ char_u *buf; ++ size_t len; ++ { ++ cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf); ++ } ++ ++ /* ++ * Free an allocated crypt key. Clear the text to make sure it doesn't stay ++ * in memory anywhere. ++ */ ++ void ++ crypt_free_key(key) ++ char_u *key; ++ { ++ char_u *p; ++ ++ if (key != NULL) ++ { ++ for (p = key; *p != NUL; ++p) ++ *p = 0; ++ vim_free(key); ++ } ++ } ++ ++ /* ++ * Ask the user for a crypt key. ++ * When "store" is TRUE, the new key is stored in the 'key' option, and the ++ * 'key' option value is returned: Don't free it. ++ * When "store" is FALSE, the typed key is returned in allocated memory. ++ * Returns NULL on failure. ++ */ ++ char_u * ++ crypt_get_key(store, twice) ++ int store; ++ int twice; /* Ask for the key twice. */ ++ { ++ char_u *p1, *p2 = NULL; ++ int round; ++ ++ for (round = 0; ; ++round) ++ { ++ cmdline_star = TRUE; ++ cmdline_row = msg_row; ++ p1 = getcmdline_prompt(NUL, round == 0 ++ ? (char_u *)_("Enter encryption key: ") ++ : (char_u *)_("Enter same key again: "), 0, EXPAND_NOTHING, ++ NULL); ++ cmdline_star = FALSE; ++ ++ if (p1 == NULL) ++ break; ++ ++ if (round == twice) ++ { ++ if (p2 != NULL && STRCMP(p1, p2) != 0) ++ { ++ MSG(_("Keys don't match!")); ++ crypt_free_key(p1); ++ crypt_free_key(p2); ++ p2 = NULL; ++ round = -1; /* do it again */ ++ continue; ++ } ++ ++ if (store) ++ { ++ set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL); ++ crypt_free_key(p1); ++ p1 = curbuf->b_p_key; ++ } ++ break; ++ } ++ p2 = p1; ++ } ++ ++ /* since the user typed this, no need to wait for return */ ++ if (msg_didout) ++ msg_putchar('\n'); ++ need_wait_return = FALSE; ++ msg_didout = FALSE; ++ ++ crypt_free_key(p2); ++ return p1; ++ } ++ ++ ++ /* ++ * Append a message to IObuff for the encryption/decryption method being used. ++ */ ++ void ++ crypt_append_msg(buf) ++ buf_T *buf; ++ { ++ if (crypt_get_method_nr(buf) == 0) ++ STRCAT(IObuff, _("[crypted]")); ++ else ++ { ++ STRCAT(IObuff, "["); ++ STRCAT(IObuff, *buf->b_p_cm == NUL ? p_cm : buf->b_p_cm); ++ STRCAT(IObuff, "]"); ++ } ++ } ++ ++ #endif /* FEAT_CRYPT */ +*** ../vim-7.4.398/src/crypt_zip.c 2014-08-10 13:30:43.824787293 +0200 +--- src/crypt_zip.c 2014-08-09 15:31:32.493356185 +0200 +*************** +*** 0 **** +--- 1,158 ---- ++ /* vi:set ts=8 sts=4 sw=4: ++ * ++ * VIM - Vi IMproved by Bram Moolenaar ++ * ++ * Do ":help uganda" in Vim to read copying and usage conditions. ++ * Do ":help credits" in Vim to see a list of people who contributed. ++ * See README.txt for an overview of the Vim source code. ++ */ ++ ++ /* ++ * crypt_zip.c: Zip encryption support. ++ */ ++ #include "vim.h" ++ ++ #if defined(FEAT_CRYPT) || defined(PROTO) ++ /* ++ * Optional encryption support. ++ * Mohsin Ahmed, mosh@sasi.com, 98-09-24 ++ * Based on zip/crypt sources. ++ * ++ * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to ++ * most countries. There are a few exceptions, but that still should not be a ++ * problem since this code was originally created in Europe and India. ++ */ ++ ++ /* Need a type that should be 32 bits. 64 also works but wastes space. */ ++ # if VIM_SIZEOF_INT >= 4 ++ typedef unsigned int u32_T; /* int is at least 32 bits */ ++ # else ++ typedef unsigned long u32_T; /* long should be 32 bits or more */ ++ # endif ++ ++ /* The state of encryption, referenced by cryptstate_T. */ ++ typedef struct { ++ u32_T keys[3]; ++ } zip_state_T; ++ ++ ++ static void make_crc_tab __ARGS((void)); ++ ++ static u32_T crc_32_table[256]; ++ ++ /* ++ * Fill the CRC table, if not done already. ++ */ ++ static void ++ make_crc_tab() ++ { ++ u32_T s, t, v; ++ static int done = FALSE; ++ ++ if (done) ++ return; ++ for (t = 0; t < 256; t++) ++ { ++ v = t; ++ for (s = 0; s < 8; s++) ++ v = (v >> 1) ^ ((v & 1) * (u32_T)0xedb88320L); ++ crc_32_table[t] = v; ++ } ++ done = TRUE; ++ } ++ ++ #define CRC32(c, b) (crc_32_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) ++ ++ /* ++ * Return the next byte in the pseudo-random sequence. ++ */ ++ #define DECRYPT_BYTE_ZIP(keys, t) { \ ++ short_u temp = (short_u)keys[2] | 2; \ ++ t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \ ++ } ++ ++ /* ++ * Update the encryption keys with the next byte of plain text. ++ */ ++ #define UPDATE_KEYS_ZIP(keys, c) { \ ++ keys[0] = CRC32(keys[0], (c)); \ ++ keys[1] += keys[0] & 0xff; \ ++ keys[1] = keys[1] * 134775813L + 1; \ ++ keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \ ++ } ++ ++ /* ++ * Initialize for encryption/decryption. ++ */ ++ void ++ crypt_zip_init(state, key, salt, salt_len, seed, seed_len) ++ cryptstate_T *state; ++ char_u *key; ++ char_u *salt UNUSED; ++ int salt_len UNUSED; ++ char_u *seed UNUSED; ++ int seed_len UNUSED; ++ { ++ char_u *p; ++ zip_state_T *zs; ++ ++ zs = (zip_state_T *)alloc(sizeof(zip_state_T)); ++ state->method_state = zs; ++ ++ make_crc_tab(); ++ zs->keys[0] = 305419896L; ++ zs->keys[1] = 591751049L; ++ zs->keys[2] = 878082192L; ++ for (p = key; *p != NUL; ++p) ++ { ++ UPDATE_KEYS_ZIP(zs->keys, (int)*p); ++ } ++ } ++ ++ /* ++ * Encrypt "from[len]" into "to[len]". ++ * "from" and "to" can be equal to encrypt in place. ++ */ ++ void ++ crypt_zip_encode(state, from, len, to) ++ cryptstate_T *state; ++ char_u *from; ++ size_t len; ++ char_u *to; ++ { ++ zip_state_T *zs = state->method_state; ++ size_t i; ++ int ztemp, t; ++ ++ for (i = 0; i < len; ++i) ++ { ++ ztemp = from[i]; ++ DECRYPT_BYTE_ZIP(zs->keys, t); ++ UPDATE_KEYS_ZIP(zs->keys, ztemp); ++ to[i] = t ^ ztemp; ++ } ++ } ++ ++ /* ++ * Decrypt "from[len]" into "to[len]". ++ */ ++ void ++ crypt_zip_decode(state, from, len, to) ++ cryptstate_T *state; ++ char_u *from; ++ size_t len; ++ char_u *to; ++ { ++ zip_state_T *zs = state->method_state; ++ size_t i; ++ short_u temp; ++ ++ for (i = 0; i < len; ++i) ++ { ++ temp = (short_u)zs->keys[2] | 2; ++ temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); ++ UPDATE_KEYS_ZIP(zs->keys, to[i] = from[i] ^ temp); ++ } ++ } ++ ++ #endif /* FEAT_CRYPT */ +*** ../vim-7.4.398/src/ex_docmd.c 2014-08-06 18:17:03.475147780 +0200 +--- src/ex_docmd.c 2014-08-09 15:31:32.493356185 +0200 +*************** +*** 11506,11513 **** + ex_X(eap) + exarg_T *eap UNUSED; + { +! if (get_crypt_method(curbuf) == 0 || blowfish_self_test() == OK) +! (void)get_crypt_key(TRUE, TRUE); + } + #endif + +--- 11506,11512 ---- + ex_X(eap) + exarg_T *eap UNUSED; + { +! (void)crypt_get_key(TRUE, TRUE); + } + #endif + +*** ../vim-7.4.398/src/fileio.c 2014-06-12 14:01:27.575769788 +0200 +--- src/fileio.c 2014-08-09 15:31:32.497356185 +0200 +*************** +*** 24,43 **** + #define BUFSIZE 8192 /* size of normal write buffer */ + #define SMBUFSIZE 256 /* size of emergency write buffer */ + +- #ifdef FEAT_CRYPT +- /* crypt_magic[0] is pkzip crypt, crypt_magic[1] is sha2+blowfish */ +- static char *crypt_magic[] = {"VimCrypt~01!", "VimCrypt~02!"}; +- static char crypt_magic_head[] = "VimCrypt~"; +- # define CRYPT_MAGIC_LEN 12 /* must be multiple of 4! */ +- +- /* For blowfish, after the magic header, we store 8 bytes of salt and then 8 +- * bytes of seed (initialisation vector). */ +- static int crypt_salt_len[] = {0, 8}; +- static int crypt_seed_len[] = {0, 8}; +- #define CRYPT_SALT_LEN_MAX 8 +- #define CRYPT_SEED_LEN_MAX 8 +- #endif +- + /* Is there any system that doesn't have access()? */ + #define USE_MCH_ACCESS + +--- 24,29 ---- +*************** +*** 55,61 **** + static void check_marks_read __ARGS((void)); + #endif + #ifdef FEAT_CRYPT +- static int crypt_method_from_magic __ARGS((char *ptr, int len)); + static char_u *check_for_cryptkey __ARGS((char_u *cryptkey, char_u *ptr, long *sizep, off_t *filesizep, int newfile, char_u *fname, int *did_ask)); + #endif + #ifdef UNIX +--- 41,46 ---- +*************** +*** 116,121 **** +--- 101,109 ---- + #ifdef HAS_BW_FLAGS + int bw_flags; /* FIO_ flags */ + #endif ++ #ifdef FEAT_CRYPT ++ buf_T *bw_buffer; /* buffer being written */ ++ #endif + #ifdef FEAT_MBYTE + char_u bw_rest[CONV_RESTLEN]; /* not converted bytes */ + int bw_restlen; /* nr of bytes in bw_rest[] */ +*************** +*** 250,256 **** + #ifdef FEAT_CRYPT + char_u *cryptkey = NULL; + int did_ask_for_key = FALSE; +- int crypt_method_used; + #endif + #ifdef FEAT_PERSISTENT_UNDO + context_sha256_T sha_ctx; +--- 238,243 ---- +*************** +*** 966,978 **** + #endif + } + +- #ifdef FEAT_CRYPT +- if (cryptkey != NULL) +- /* Need to reset the state, but keep the key, don't want to ask for it +- * again. */ +- crypt_pop_state(); +- #endif +- + /* + * When retrying with another "fenc" and the first time "fileformat" + * will be reset. +--- 953,958 ---- +*************** +*** 1175,1180 **** +--- 1155,1169 ---- + if (read_undo_file) + sha256_start(&sha_ctx); + #endif ++ #ifdef FEAT_CRYPT ++ if (curbuf->b_cryptstate != NULL) ++ { ++ /* Need to free the state, but keep the key, don't want to ask for ++ * it again. */ ++ crypt_free_state(curbuf->b_cryptstate); ++ curbuf->b_cryptstate = NULL; ++ } ++ #endif + } + + while (!error && !got_int) +*************** +*** 1339,1344 **** +--- 1328,1403 ---- + size = read_eintr(fd, ptr, size); + } + ++ #ifdef FEAT_CRYPT ++ /* ++ * At start of file: Check for magic number of encryption. ++ */ ++ if (filesize == 0 && size > 0) ++ cryptkey = check_for_cryptkey(cryptkey, ptr, &size, ++ &filesize, newfile, sfname, ++ &did_ask_for_key); ++ /* ++ * Decrypt the read bytes. This is done before checking for ++ * EOF because the crypt layer may be buffering. ++ */ ++ if (cryptkey != NULL && size > 0) ++ { ++ if (crypt_works_inplace(curbuf->b_cryptstate)) ++ { ++ crypt_decode_inplace(curbuf->b_cryptstate, ptr, size); ++ } ++ else ++ { ++ char_u *newptr = NULL; ++ int decrypted_size; ++ ++ decrypted_size = crypt_decode_alloc( ++ curbuf->b_cryptstate, ptr, size, &newptr); ++ ++ /* If the crypt layer is buffering, not producing ++ * anything yet, need to read more. */ ++ if (size > 0 && decrypted_size == 0) ++ continue; ++ ++ if (linerest == 0) ++ { ++ /* Simple case: reuse returned buffer (may be ++ * NULL, checked later). */ ++ new_buffer = newptr; ++ } ++ else ++ { ++ long_u new_size; ++ ++ /* Need new buffer to add bytes carried over. */ ++ new_size = (long_u)(decrypted_size + linerest + 1); ++ new_buffer = lalloc(new_size, FALSE); ++ if (new_buffer == NULL) ++ { ++ do_outofmem_msg(new_size); ++ error = TRUE; ++ break; ++ } ++ ++ mch_memmove(new_buffer, buffer, linerest); ++ if (newptr != NULL) ++ mch_memmove(new_buffer + linerest, newptr, ++ decrypted_size); ++ } ++ ++ if (new_buffer != NULL) ++ { ++ vim_free(buffer); ++ buffer = new_buffer; ++ new_buffer = NULL; ++ line_start = buffer; ++ ptr = buffer + linerest; ++ } ++ size = decrypted_size; ++ } ++ } ++ #endif ++ + if (size <= 0) + { + if (size < 0) /* read error */ +*************** +*** 1403,1423 **** + } + #endif + } +- +- #ifdef FEAT_CRYPT +- /* +- * At start of file: Check for magic number of encryption. +- */ +- if (filesize == 0) +- cryptkey = check_for_cryptkey(cryptkey, ptr, &size, +- &filesize, newfile, sfname, +- &did_ask_for_key); +- /* +- * Decrypt the read bytes. +- */ +- if (cryptkey != NULL && size > 0) +- crypt_decode(ptr, size); +- #endif + } + skip_read = FALSE; + +--- 1462,1467 ---- +*************** +*** 1430,1439 **** + */ + if ((filesize == 0 + # ifdef FEAT_CRYPT +! || (filesize == (CRYPT_MAGIC_LEN +! + crypt_salt_len[use_crypt_method] +! + crypt_seed_len[use_crypt_method]) +! && cryptkey != NULL) + # endif + ) + && (fio_flags == FIO_UCSBOM +--- 1474,1482 ---- + */ + if ((filesize == 0 + # ifdef FEAT_CRYPT +! || (cryptkey != NULL +! && filesize == crypt_get_header_len( +! crypt_get_method_nr(curbuf))) + # endif + ) + && (fio_flags == FIO_UCSBOM +*************** +*** 2262,2276 **** + save_file_ff(curbuf); /* remember the current file format */ + + #ifdef FEAT_CRYPT +! crypt_method_used = use_crypt_method; +! if (cryptkey != NULL) + { +! crypt_pop_state(); +! if (cryptkey != curbuf->b_p_key) +! free_crypt_key(cryptkey); +! /* don't set cryptkey to NULL, it's used below as a flag that +! * encryption was used */ + } + #endif + + #ifdef FEAT_MBYTE +--- 2305,2319 ---- + save_file_ff(curbuf); /* remember the current file format */ + + #ifdef FEAT_CRYPT +! if (curbuf->b_cryptstate != NULL) + { +! crypt_free_state(curbuf->b_cryptstate); +! curbuf->b_cryptstate = NULL; + } ++ if (cryptkey != NULL && cryptkey != curbuf->b_p_key) ++ crypt_free_key(cryptkey); ++ /* Don't set cryptkey to NULL, it's used below as a flag that ++ * encryption was used. */ + #endif + + #ifdef FEAT_MBYTE +*************** +*** 2457,2466 **** + #ifdef FEAT_CRYPT + if (cryptkey != NULL) + { +! if (crypt_method_used == 1) +! STRCAT(IObuff, _("[blowfish]")); +! else +! STRCAT(IObuff, _("[crypted]")); + c = TRUE; + } + #endif +--- 2500,2506 ---- + #ifdef FEAT_CRYPT + if (cryptkey != NULL) + { +! crypt_append_msg(curbuf); + c = TRUE; + } + #endif +*************** +*** 2489,2497 **** + #ifdef FEAT_CRYPT + if (cryptkey != NULL) + msg_add_lines(c, (long)linecnt, filesize +! - CRYPT_MAGIC_LEN +! - crypt_salt_len[use_crypt_method] +! - crypt_seed_len[use_crypt_method]); + else + #endif + msg_add_lines(c, (long)linecnt, filesize); +--- 2529,2535 ---- + #ifdef FEAT_CRYPT + if (cryptkey != NULL) + msg_add_lines(c, (long)linecnt, filesize +! - crypt_get_header_len(crypt_get_method_nr(curbuf))); + else + #endif + msg_add_lines(c, (long)linecnt, filesize); +*************** +*** 2882,2914 **** + + #if defined(FEAT_CRYPT) || defined(PROTO) + /* +- * Get the crypt method used for a file from "ptr[len]", the magic text at the +- * start of the file. +- * Returns -1 when no encryption used. +- */ +- static int +- crypt_method_from_magic(ptr, len) +- char *ptr; +- int len; +- { +- int i; +- +- for (i = 0; i < (int)(sizeof(crypt_magic) / sizeof(crypt_magic[0])); i++) +- { +- if (len < (CRYPT_MAGIC_LEN + crypt_salt_len[i] + crypt_seed_len[i])) +- continue; +- if (memcmp(ptr, crypt_magic[i], CRYPT_MAGIC_LEN) == 0) +- return i; +- } +- +- i = (int)STRLEN(crypt_magic_head); +- if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0) +- EMSG(_("E821: File is encrypted with unknown method")); +- +- return -1; +- } +- +- /* + * Check for magic number used for encryption. Applies to the current buffer. + * If found, the magic number is removed from ptr[*sizep] and *sizep and + * *filesizep are updated. +--- 2920,2925 ---- +*************** +*** 2924,2930 **** + char_u *fname; /* file name to display */ + int *did_ask; /* flag: whether already asked for key */ + { +! int method = crypt_method_from_magic((char *)ptr, *sizep); + int b_p_ro = curbuf->b_p_ro; + + if (method >= 0) +--- 2935,2941 ---- + char_u *fname; /* file name to display */ + int *did_ask; /* flag: whether already asked for key */ + { +! int method = crypt_method_nr_from_magic((char *)ptr, *sizep); + int b_p_ro = curbuf->b_p_ro; + + if (method >= 0) +*************** +*** 2933,2941 **** + * Avoids accidentally overwriting the file with garbage. */ + curbuf->b_p_ro = TRUE; + +! set_crypt_method(curbuf, method); +! if (method > 0) +! (void)blowfish_self_test(); + if (cryptkey == NULL && !*did_ask) + { + if (*curbuf->b_p_key) +--- 2944,2950 ---- + * Avoids accidentally overwriting the file with garbage. */ + curbuf->b_p_ro = TRUE; + +! crypt_set_cm_option(curbuf, method); + if (cryptkey == NULL && !*did_ask) + { + if (*curbuf->b_p_key) +*************** +*** 2948,2954 **** + * Happens when retrying to detect encoding. */ + smsg((char_u *)_(need_key_msg), fname); + msg_scroll = TRUE; +! cryptkey = get_crypt_key(newfile, FALSE); + *did_ask = TRUE; + + /* check if empty key entered */ +--- 2957,2963 ---- + * Happens when retrying to detect encoding. */ + smsg((char_u *)_(need_key_msg), fname); + msg_scroll = TRUE; +! cryptkey = crypt_get_key(newfile, FALSE); + *did_ask = TRUE; + + /* check if empty key entered */ +*************** +*** 2963,2986 **** + + if (cryptkey != NULL) + { +! int seed_len = crypt_seed_len[method]; +! int salt_len = crypt_salt_len[method]; + +! crypt_push_state(); +! use_crypt_method = method; +! if (method == 0) +! crypt_init_keys(cryptkey); +! else +! { +! bf_key_init(cryptkey, ptr + CRYPT_MAGIC_LEN, salt_len); +! bf_cfb_init(ptr + CRYPT_MAGIC_LEN + salt_len, seed_len); +! } + +- /* Remove magic number from the text */ +- *filesizep += CRYPT_MAGIC_LEN + salt_len + seed_len; +- *sizep -= CRYPT_MAGIC_LEN + salt_len + seed_len; +- mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len, +- (size_t)*sizep); + /* Restore the read-only flag. */ + curbuf->b_p_ro = b_p_ro; + } +--- 2972,2989 ---- + + if (cryptkey != NULL) + { +! int header_len; + +! curbuf->b_cryptstate = crypt_create_from_header( +! method, cryptkey, ptr); +! crypt_set_cm_option(curbuf, method); +! +! /* Remove cryptmethod specific header from the text. */ +! header_len = crypt_get_header_len(method); +! *filesizep += header_len; +! *sizep -= header_len; +! mch_memmove(ptr, ptr + header_len, (size_t)*sizep); + + /* Restore the read-only flag. */ + curbuf->b_p_ro = b_p_ro; + } +*************** +*** 2992,3076 **** + + return cryptkey; + } +- +- /* +- * Check for magic number used for encryption. Applies to the current buffer. +- * If found and decryption is possible returns OK; +- */ +- int +- prepare_crypt_read(fp) +- FILE *fp; +- { +- int method; +- char_u buffer[CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX +- + CRYPT_SEED_LEN_MAX + 2]; +- +- if (fread(buffer, CRYPT_MAGIC_LEN, 1, fp) != 1) +- return FAIL; +- method = crypt_method_from_magic((char *)buffer, +- CRYPT_MAGIC_LEN + +- CRYPT_SEED_LEN_MAX + +- CRYPT_SALT_LEN_MAX); +- if (method < 0 || method != get_crypt_method(curbuf)) +- return FAIL; +- +- crypt_push_state(); +- if (method == 0) +- crypt_init_keys(curbuf->b_p_key); +- else +- { +- int salt_len = crypt_salt_len[method]; +- int seed_len = crypt_seed_len[method]; +- +- if (fread(buffer, salt_len + seed_len, 1, fp) != 1) +- return FAIL; +- bf_key_init(curbuf->b_p_key, buffer, salt_len); +- bf_cfb_init(buffer + salt_len, seed_len); +- } +- return OK; +- } +- +- /* +- * Prepare for writing encrypted bytes for buffer "buf". +- * Returns a pointer to an allocated header of length "*lenp". +- * When out of memory returns NULL. +- * Otherwise calls crypt_push_state(), call crypt_pop_state() later. +- */ +- char_u * +- prepare_crypt_write(buf, lenp) +- buf_T *buf; +- int *lenp; +- { +- char_u *header; +- int seed_len = crypt_seed_len[get_crypt_method(buf)]; +- int salt_len = crypt_salt_len[get_crypt_method(buf)]; +- char_u *salt; +- char_u *seed; +- +- header = alloc_clear(CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX +- + CRYPT_SEED_LEN_MAX + 2); +- if (header != NULL) +- { +- crypt_push_state(); +- use_crypt_method = get_crypt_method(buf); /* select zip or blowfish */ +- vim_strncpy(header, (char_u *)crypt_magic[use_crypt_method], +- CRYPT_MAGIC_LEN); +- if (use_crypt_method == 0) +- crypt_init_keys(buf->b_p_key); +- else +- { +- /* Using blowfish, add salt and seed. */ +- salt = header + CRYPT_MAGIC_LEN; +- seed = salt + salt_len; +- sha2_seed(salt, salt_len, seed, seed_len); +- bf_key_init(buf->b_p_key, salt, salt_len); +- bf_cfb_init(seed, seed_len); +- } +- } +- *lenp = CRYPT_MAGIC_LEN + salt_len + seed_len; +- return header; +- } +- + #endif /* FEAT_CRYPT */ + + #ifdef UNIX +--- 2995,3000 ---- +*************** +*** 3224,3232 **** + int write_undo_file = FALSE; + context_sha256_T sha_ctx; + #endif +- #ifdef FEAT_CRYPT +- int crypt_method_used; +- #endif + + if (fname == NULL || *fname == NUL) /* safety check */ + return FAIL; +--- 3148,3153 ---- +*************** +*** 3262,3267 **** +--- 3183,3191 ---- + write_info.bw_iconv_fd = (iconv_t)-1; + # endif + #endif ++ #ifdef FEAT_CRYPT ++ write_info.bw_buffer = buf; ++ #endif + + /* After writing a file changedtick changes but we don't want to display + * the line. */ +*************** +*** 4505,4521 **** + #ifdef FEAT_CRYPT + if (*buf->b_p_key != NUL && !filtering) + { +! char_u *header; +! int header_len; + +! header = prepare_crypt_write(buf, &header_len); +! if (header == NULL) + end = 0; + else + { +! /* Write magic number, so that Vim knows that this file is +! * encrypted when reading it again. This also undergoes utf-8 to +! * ucs-2/4 conversion when needed. */ + write_info.bw_buf = header; + write_info.bw_len = header_len; + write_info.bw_flags = FIO_NOCONVERT; +--- 4429,4445 ---- + #ifdef FEAT_CRYPT + if (*buf->b_p_key != NUL && !filtering) + { +! char_u *header; +! int header_len; + +! buf->b_cryptstate = crypt_create_for_writing(crypt_get_method_nr(buf), +! buf->b_p_key, &header, &header_len); +! if (buf->b_cryptstate == NULL || header == NULL) + end = 0; + else + { +! /* Write magic number, so that Vim knows how this file is +! * encrypted when reading it back. */ + write_info.bw_buf = header; + write_info.bw_len = header_len; + write_info.bw_flags = FIO_NOCONVERT; +*************** +*** 4769,4780 **** + mch_set_acl(wfname, acl); + #endif + #ifdef FEAT_CRYPT +! crypt_method_used = use_crypt_method; +! if (wb_flags & FIO_ENCRYPTED) +! crypt_pop_state(); + #endif + +- + #if defined(FEAT_MBYTE) && defined(FEAT_EVAL) + if (wfname != fname) + { +--- 4693,4705 ---- + mch_set_acl(wfname, acl); + #endif + #ifdef FEAT_CRYPT +! if (buf->b_cryptstate != NULL) +! { +! crypt_free_state(buf->b_cryptstate); +! buf->b_cryptstate = NULL; +! } + #endif + + #if defined(FEAT_MBYTE) && defined(FEAT_EVAL) + if (wfname != fname) + { +*************** +*** 4924,4933 **** + #ifdef FEAT_CRYPT + if (wb_flags & FIO_ENCRYPTED) + { +! if (crypt_method_used == 1) +! STRCAT(IObuff, _("[blowfish]")); +! else +! STRCAT(IObuff, _("[crypted]")); + c = TRUE; + } + #endif +--- 4849,4855 ---- + #ifdef FEAT_CRYPT + if (wb_flags & FIO_ENCRYPTED) + { +! crypt_append_msg(buf); + c = TRUE; + } + #endif +*************** +*** 5740,5747 **** + #endif /* FEAT_MBYTE */ + + #ifdef FEAT_CRYPT +! if (flags & FIO_ENCRYPTED) /* encrypt the data */ +! crypt_encode(buf, len, buf); + #endif + + wlen = write_eintr(ip->bw_fd, buf, len); +--- 5662,5687 ---- + #endif /* FEAT_MBYTE */ + + #ifdef FEAT_CRYPT +! if (flags & FIO_ENCRYPTED) +! { +! /* Encrypt the data. Do it in-place if possible, otherwise use an +! * allocated buffer. */ +! if (crypt_works_inplace(ip->bw_buffer->b_cryptstate)) +! { +! crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len); +! } +! else +! { +! char_u *outbuf; +! +! len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf); +! if (len == 0) +! return OK; /* Crypt layer is buffering, will flush later. */ +! wlen = write_eintr(ip->bw_fd, outbuf, len); +! vim_free(outbuf); +! return (wlen < len) ? FAIL : OK; +! } +! } + #endif + + wlen = write_eintr(ip->bw_fd, buf, len); +*** ../vim-7.4.398/src/globals.h 2014-08-06 18:17:03.475147780 +0200 +--- src/globals.h 2014-08-09 15:31:32.497356185 +0200 +*************** +*** 105,114 **** + + EXTERN int screen_cleared INIT(= FALSE); /* screen has been cleared */ + +- #ifdef FEAT_CRYPT +- EXTERN int use_crypt_method INIT(= 0); +- #endif +- + /* + * When '$' is included in 'cpoptions' option set: + * When a change command is given that deletes only part of a line, a dollar +--- 105,110 ---- +*** ../vim-7.4.398/src/main.c 2014-05-28 18:22:37.876225054 +0200 +--- src/main.c 2014-08-09 15:31:32.497356185 +0200 +*************** +*** 846,853 **** + #ifdef FEAT_CRYPT + if (params.ask_for_key) + { +! (void)blowfish_self_test(); +! (void)get_crypt_key(TRUE, TRUE); + TIME_MSG("getting crypt key"); + } + #endif +--- 846,852 ---- + #ifdef FEAT_CRYPT + if (params.ask_for_key) + { +! (void)crypt_get_key(TRUE, TRUE); + TIME_MSG("getting crypt key"); + } + #endif +*** ../vim-7.4.398/src/memline.c 2014-03-23 16:03:56.171311627 +0100 +--- src/memline.c 2014-08-09 15:39:22.629352806 +0200 +*************** +*** 63,68 **** +--- 63,77 ---- + #define BLOCK0_ID1 '0' /* block 0 id 1 */ + #define BLOCK0_ID1_C0 'c' /* block 0 id 1 'cm' 0 */ + #define BLOCK0_ID1_C1 'C' /* block 0 id 1 'cm' 1 */ ++ #define BLOCK0_ID1_C2 'd' /* block 0 id 1 'cm' 2 */ ++ ++ #if defined(FEAT_CRYPT) ++ static int id1_codes[] = { ++ BLOCK0_ID1_C0, /* CRYPT_M_ZIP */ ++ BLOCK0_ID1_C1, /* CRYPT_M_BF */ ++ BLOCK0_ID1_C2, /* CRYPT_M_BF2 */ ++ }; ++ #endif + + /* + * pointer to a block, used in a pointer block +*************** +*** 151,157 **** + struct block0 + { + char_u b0_id[2]; /* id for block 0: BLOCK0_ID0 and BLOCK0_ID1, +! * BLOCK0_ID1_C0, BLOCK0_ID1_C1 */ + char_u b0_version[10]; /* Vim version string */ + char_u b0_page_size[4];/* number of bytes per page */ + char_u b0_mtime[4]; /* last modification time of file */ +--- 160,166 ---- + struct block0 + { + char_u b0_id[2]; /* id for block 0: BLOCK0_ID0 and BLOCK0_ID1, +! * BLOCK0_ID1_C0, BLOCK0_ID1_C1, etc. */ + char_u b0_version[10]; /* Vim version string */ + char_u b0_page_size[4];/* number of bytes per page */ + char_u b0_mtime[4]; /* last modification time of file */ +*************** +*** 256,262 **** + static char_u *make_percent_swname __ARGS((char_u *dir, char_u *name)); + #endif + #ifdef FEAT_CRYPT +! static void ml_crypt_prepare __ARGS((memfile_T *mfp, off_t offset, int reading)); + #endif + #ifdef FEAT_BYTEOFF + static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype)); +--- 265,271 ---- + static char_u *make_percent_swname __ARGS((char_u *dir, char_u *name)); + #endif + #ifdef FEAT_CRYPT +! static cryptstate_T *ml_crypt_prepare __ARGS((memfile_T *mfp, off_t offset, int reading)); + #endif + #ifdef FEAT_BYTEOFF + static void ml_updatechunk __ARGS((buf_T *buf, long line, long len, int updtype)); +*************** +*** 359,366 **** + b0p->b0_hname[B0_HNAME_SIZE - 1] = NUL; + long_to_char(mch_get_pid(), b0p->b0_pid); + #ifdef FEAT_CRYPT +! if (*buf->b_p_key != NUL) +! ml_set_b0_crypt(buf, b0p); + #endif + } + +--- 368,374 ---- + b0p->b0_hname[B0_HNAME_SIZE - 1] = NUL; + long_to_char(mch_get_pid(), b0p->b0_pid); + #ifdef FEAT_CRYPT +! ml_set_b0_crypt(buf, b0p); + #endif + } + +*************** +*** 436,446 **** + b0p->b0_id[1] = BLOCK0_ID1; + else + { +! if (get_crypt_method(buf) == 0) +! b0p->b0_id[1] = BLOCK0_ID1_C0; +! else + { +- b0p->b0_id[1] = BLOCK0_ID1_C1; + /* Generate a seed and store it in block 0 and in the memfile. */ + sha2_seed(&b0p->b0_seed, MF_SEED_LEN, NULL, 0); + mch_memmove(buf->b_ml.ml_mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN); +--- 444,454 ---- + b0p->b0_id[1] = BLOCK0_ID1; + else + { +! int method_nr = crypt_get_method_nr(buf); +! +! b0p->b0_id[1] = id1_codes[method_nr]; +! if (method_nr > CRYPT_M_ZIP) + { + /* Generate a seed and store it in block 0 and in the memfile. */ + sha2_seed(&b0p->b0_seed, MF_SEED_LEN, NULL, 0); + mch_memmove(buf->b_ml.ml_mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN); +*************** +*** 887,893 **** + if (b0p->b0_id[0] != BLOCK0_ID0 + || (b0p->b0_id[1] != BLOCK0_ID1 + && b0p->b0_id[1] != BLOCK0_ID1_C0 +! && b0p->b0_id[1] != BLOCK0_ID1_C1) + ) + return FAIL; + return OK; +--- 895,902 ---- + if (b0p->b0_id[0] != BLOCK0_ID0 + || (b0p->b0_id[1] != BLOCK0_ID1 + && b0p->b0_id[1] != BLOCK0_ID1_C0 +! && b0p->b0_id[1] != BLOCK0_ID1_C1 +! && b0p->b0_id[1] != BLOCK0_ID1_C2) + ) + return FAIL; + return OK; +*************** +*** 1255,1268 **** + } + + #ifdef FEAT_CRYPT +! if (b0p->b0_id[1] == BLOCK0_ID1_C0) +! b0_cm = 0; +! else if (b0p->b0_id[1] == BLOCK0_ID1_C1) +! { +! b0_cm = 1; + mch_memmove(mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN); +! } +! set_crypt_method(buf, b0_cm); + #else + if (b0p->b0_id[1] != BLOCK0_ID1) + { +--- 1264,1275 ---- + } + + #ifdef FEAT_CRYPT +! for (i = 0; i < (int)(sizeof(id1_codes) / sizeof(int)); ++i) +! if (id1_codes[i] == b0p->b0_id[1]) +! b0_cm = i; +! if (b0_cm > 0) + mch_memmove(mfp->mf_seed, &b0p->b0_seed, MF_SEED_LEN); +! crypt_set_cm_option(buf, b0_cm < 0 ? 0 : b0_cm); + #else + if (b0p->b0_id[1] != BLOCK0_ID1) + { +*************** +*** 1389,1395 **** + } + else + smsg((char_u *)_(need_key_msg), fname_used); +! buf->b_p_key = get_crypt_key(FALSE, FALSE); + if (buf->b_p_key == NULL) + buf->b_p_key = curbuf->b_p_key; + else if (*buf->b_p_key == NUL) +--- 1396,1402 ---- + } + else + smsg((char_u *)_(need_key_msg), fname_used); +! buf->b_p_key = crypt_get_key(FALSE, FALSE); + if (buf->b_p_key == NULL) + buf->b_p_key = curbuf->b_p_key; + else if (*buf->b_p_key == NUL) +*************** +*** 4816,4821 **** +--- 4823,4829 ---- + char_u *text_start; + char_u *new_data; + int text_len; ++ cryptstate_T *state; + + if (dp->db_id != DATA_ID) + return data; +*************** +*** 4831,4840 **** + mch_memmove(new_data, dp, head_end - (char_u *)dp); + + /* Encrypt the text. */ +! crypt_push_state(); +! ml_crypt_prepare(mfp, offset, FALSE); +! crypt_encode(text_start, text_len, new_data + dp->db_txt_start); +! crypt_pop_state(); + + /* Clear the gap. */ + if (head_end < text_start) +--- 4839,4847 ---- + mch_memmove(new_data, dp, head_end - (char_u *)dp); + + /* Encrypt the text. */ +! state = ml_crypt_prepare(mfp, offset, FALSE); +! crypt_encode(state, text_start, text_len, new_data + dp->db_txt_start); +! crypt_free_state(state); + + /* Clear the gap. */ + if (head_end < text_start) +*************** +*** 4857,4862 **** +--- 4864,4870 ---- + char_u *head_end; + char_u *text_start; + int text_len; ++ cryptstate_T *state; + + if (dp->db_id == DATA_ID) + { +*************** +*** 4869,4885 **** + return; /* data was messed up */ + + /* Decrypt the text in place. */ +! crypt_push_state(); +! ml_crypt_prepare(mfp, offset, TRUE); +! crypt_decode(text_start, text_len); +! crypt_pop_state(); + } + } + + /* + * Prepare for encryption/decryption, using the key, seed and offset. + */ +! static void + ml_crypt_prepare(mfp, offset, reading) + memfile_T *mfp; + off_t offset; +--- 4877,4893 ---- + return; /* data was messed up */ + + /* Decrypt the text in place. */ +! state = ml_crypt_prepare(mfp, offset, TRUE); +! crypt_decode_inplace(state, text_start, text_len); +! crypt_free_state(state); + } + } + + /* + * Prepare for encryption/decryption, using the key, seed and offset. ++ * Return an allocated cryptstate_T *. + */ +! static cryptstate_T * + ml_crypt_prepare(mfp, offset, reading) + memfile_T *mfp; + off_t offset; +*************** +*** 4887,4924 **** + { + buf_T *buf = mfp->mf_buffer; + char_u salt[50]; +! int method; + char_u *key; + char_u *seed; + + if (reading && mfp->mf_old_key != NULL) + { + /* Reading back blocks with the previous key/method/seed. */ +! method = mfp->mf_old_cm; + key = mfp->mf_old_key; + seed = mfp->mf_old_seed; + } + else + { +! method = get_crypt_method(buf); + key = buf->b_p_key; + seed = mfp->mf_seed; + } + +! use_crypt_method = method; /* select pkzip or blowfish */ +! if (method == 0) + { + vim_snprintf((char *)salt, sizeof(salt), "%s%ld", key, (long)offset); +! crypt_init_keys(salt); +! } +! else +! { +! /* Using blowfish, add salt and seed. We use the byte offset of the +! * block for the salt. */ +! vim_snprintf((char *)salt, sizeof(salt), "%ld", (long)offset); +! bf_key_init(key, salt, (int)STRLEN(salt)); +! bf_cfb_init(seed, MF_SEED_LEN); + } + } + + #endif +--- 4895,4931 ---- + { + buf_T *buf = mfp->mf_buffer; + char_u salt[50]; +! int method_nr; + char_u *key; + char_u *seed; + + if (reading && mfp->mf_old_key != NULL) + { + /* Reading back blocks with the previous key/method/seed. */ +! method_nr = mfp->mf_old_cm; + key = mfp->mf_old_key; + seed = mfp->mf_old_seed; + } + else + { +! method_nr = crypt_get_method_nr(buf); + key = buf->b_p_key; + seed = mfp->mf_seed; + } + +! if (method_nr == CRYPT_M_ZIP) + { ++ /* For PKzip: Append the offset to the key, so that we use a different ++ * key for every block. */ + vim_snprintf((char *)salt, sizeof(salt), "%s%ld", key, (long)offset); +! return crypt_create(method_nr, salt, NULL, 0, NULL, 0); + } ++ ++ /* Using blowfish or better: add salt and seed. We use the byte offset ++ * of the block for the salt. */ ++ vim_snprintf((char *)salt, sizeof(salt), "%ld", (long)offset); ++ return crypt_create(method_nr, key, salt, (int)STRLEN(salt), ++ seed, MF_SEED_LEN); + } + + #endif +*** ../vim-7.4.398/src/misc2.c 2014-06-25 14:39:35.106348584 +0200 +--- src/misc2.c 2014-08-09 15:31:32.501356185 +0200 +*************** +*** 3803,4124 **** + #endif /* CURSOR_SHAPE */ + + +- #ifdef FEAT_CRYPT +- /* +- * Optional encryption support. +- * Mohsin Ahmed, mosh@sasi.com, 98-09-24 +- * Based on zip/crypt sources. +- * +- * NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to +- * most countries. There are a few exceptions, but that still should not be a +- * problem since this code was originally created in Europe and India. +- * +- * Blowfish addition originally made by Mohsin Ahmed, +- * http://www.cs.albany.edu/~mosh 2010-03-14 +- * Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html) +- * and sha256 by Christophe Devine. +- */ +- +- /* from zip.h */ +- +- typedef unsigned short ush; /* unsigned 16-bit value */ +- typedef unsigned long ulg; /* unsigned 32-bit value */ +- +- static void make_crc_tab __ARGS((void)); +- +- static ulg crc_32_tab[256]; +- +- /* +- * Fill the CRC table. +- */ +- static void +- make_crc_tab() +- { +- ulg s,t,v; +- static int done = FALSE; +- +- if (done) +- return; +- for (t = 0; t < 256; t++) +- { +- v = t; +- for (s = 0; s < 8; s++) +- v = (v >> 1) ^ ((v & 1) * (ulg)0xedb88320L); +- crc_32_tab[t] = v; +- } +- done = TRUE; +- } +- +- #define CRC32(c, b) (crc_32_tab[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8)) +- +- static ulg keys[3]; /* keys defining the pseudo-random sequence */ +- +- /* +- * Return the next byte in the pseudo-random sequence. +- */ +- #define DECRYPT_BYTE_ZIP(t) { \ +- ush temp; \ +- \ +- temp = (ush)keys[2] | 2; \ +- t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \ +- } +- +- /* +- * Update the encryption keys with the next byte of plain text. +- */ +- #define UPDATE_KEYS_ZIP(c) { \ +- keys[0] = CRC32(keys[0], (c)); \ +- keys[1] += keys[0] & 0xff; \ +- keys[1] = keys[1] * 134775813L + 1; \ +- keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \ +- } +- +- static int crypt_busy = 0; +- static ulg saved_keys[3]; +- static int saved_crypt_method; +- +- /* +- * Return int value for crypt method string: +- * 0 for "zip", the old method. Also for any non-valid value. +- * 1 for "blowfish". +- */ +- int +- crypt_method_from_string(s) +- char_u *s; +- { +- return *s == 'b' ? 1 : 0; +- } +- +- /* +- * Get the crypt method for buffer "buf" as a number. +- */ +- int +- get_crypt_method(buf) +- buf_T *buf; +- { +- return crypt_method_from_string(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm); +- } +- +- /* +- * Set the crypt method for buffer "buf" to "method" using the int value as +- * returned by crypt_method_from_string(). +- */ +- void +- set_crypt_method(buf, method) +- buf_T *buf; +- int method; +- { +- free_string_option(buf->b_p_cm); +- buf->b_p_cm = vim_strsave((char_u *)(method == 0 ? "zip" : "blowfish")); +- } +- +- /* +- * Prepare for initializing encryption. If already doing encryption then save +- * the state. +- * Must always be called symmetrically with crypt_pop_state(). +- */ +- void +- crypt_push_state() +- { +- if (crypt_busy == 1) +- { +- /* save the state */ +- if (use_crypt_method == 0) +- { +- saved_keys[0] = keys[0]; +- saved_keys[1] = keys[1]; +- saved_keys[2] = keys[2]; +- } +- else +- bf_crypt_save(); +- saved_crypt_method = use_crypt_method; +- } +- else if (crypt_busy > 1) +- EMSG2(_(e_intern2), "crypt_push_state()"); +- ++crypt_busy; +- } +- +- /* +- * End encryption. If doing encryption before crypt_push_state() then restore +- * the saved state. +- * Must always be called symmetrically with crypt_push_state(). +- */ +- void +- crypt_pop_state() +- { +- --crypt_busy; +- if (crypt_busy == 1) +- { +- use_crypt_method = saved_crypt_method; +- if (use_crypt_method == 0) +- { +- keys[0] = saved_keys[0]; +- keys[1] = saved_keys[1]; +- keys[2] = saved_keys[2]; +- } +- else +- bf_crypt_restore(); +- } +- } +- +- /* +- * Encrypt "from[len]" into "to[len]". +- * "from" and "to" can be equal to encrypt in place. +- */ +- void +- crypt_encode(from, len, to) +- char_u *from; +- size_t len; +- char_u *to; +- { +- size_t i; +- int ztemp, t; +- +- if (use_crypt_method == 0) +- for (i = 0; i < len; ++i) +- { +- ztemp = from[i]; +- DECRYPT_BYTE_ZIP(t); +- UPDATE_KEYS_ZIP(ztemp); +- to[i] = t ^ ztemp; +- } +- else +- bf_crypt_encode(from, len, to); +- } +- +- /* +- * Decrypt "ptr[len]" in place. +- */ +- void +- crypt_decode(ptr, len) +- char_u *ptr; +- long len; +- { +- char_u *p; +- +- if (use_crypt_method == 0) +- for (p = ptr; p < ptr + len; ++p) +- { +- ush temp; +- +- temp = (ush)keys[2] | 2; +- temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); +- UPDATE_KEYS_ZIP(*p ^= temp); +- } +- else +- bf_crypt_decode(ptr, len); +- } +- +- /* +- * Initialize the encryption keys and the random header according to +- * the given password. +- * If "passwd" is NULL or empty, don't do anything. +- */ +- void +- crypt_init_keys(passwd) +- char_u *passwd; /* password string with which to modify keys */ +- { +- if (passwd != NULL && *passwd != NUL) +- { +- if (use_crypt_method == 0) +- { +- char_u *p; +- +- make_crc_tab(); +- keys[0] = 305419896L; +- keys[1] = 591751049L; +- keys[2] = 878082192L; +- for (p = passwd; *p!= NUL; ++p) +- { +- UPDATE_KEYS_ZIP((int)*p); +- } +- } +- else +- bf_crypt_init_keys(passwd); +- } +- } +- +- /* +- * Free an allocated crypt key. Clear the text to make sure it doesn't stay +- * in memory anywhere. +- */ +- void +- free_crypt_key(key) +- char_u *key; +- { +- char_u *p; +- +- if (key != NULL) +- { +- for (p = key; *p != NUL; ++p) +- *p = 0; +- vim_free(key); +- } +- } +- +- /* +- * Ask the user for a crypt key. +- * When "store" is TRUE, the new key is stored in the 'key' option, and the +- * 'key' option value is returned: Don't free it. +- * When "store" is FALSE, the typed key is returned in allocated memory. +- * Returns NULL on failure. +- */ +- char_u * +- get_crypt_key(store, twice) +- int store; +- int twice; /* Ask for the key twice. */ +- { +- char_u *p1, *p2 = NULL; +- int round; +- +- for (round = 0; ; ++round) +- { +- cmdline_star = TRUE; +- cmdline_row = msg_row; +- p1 = getcmdline_prompt(NUL, round == 0 +- ? (char_u *)_("Enter encryption key: ") +- : (char_u *)_("Enter same key again: "), 0, EXPAND_NOTHING, +- NULL); +- cmdline_star = FALSE; +- +- if (p1 == NULL) +- break; +- +- if (round == twice) +- { +- if (p2 != NULL && STRCMP(p1, p2) != 0) +- { +- MSG(_("Keys don't match!")); +- free_crypt_key(p1); +- free_crypt_key(p2); +- p2 = NULL; +- round = -1; /* do it again */ +- continue; +- } +- +- if (store) +- { +- set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL); +- free_crypt_key(p1); +- p1 = curbuf->b_p_key; +- } +- break; +- } +- p2 = p1; +- } +- +- /* since the user typed this, no need to wait for return */ +- if (msg_didout) +- msg_putchar('\n'); +- need_wait_return = FALSE; +- msg_didout = FALSE; +- +- free_crypt_key(p2); +- return p1; +- } +- +- #endif /* FEAT_CRYPT */ +- + /* TODO: make some #ifdef for this */ + /*--------[ file searching ]-------------------------------------------------*/ + /* +--- 3803,3808 ---- +*************** +*** 6588,6595 **** +--- 6272,6294 ---- + FILE *fd; + time_t the_time; + { ++ char_u buf[8]; ++ ++ time_to_bytes(the_time, buf); ++ fwrite(buf, (size_t)8, (size_t)1, fd); ++ } ++ ++ /* ++ * Write time_t to "buf[8]". ++ */ ++ void ++ time_to_bytes(the_time, buf) ++ time_t the_time; ++ char_u *buf; ++ { + int c; + int i; ++ int bi = 0; + time_t wtime = the_time; + + /* time_t can be up to 8 bytes in size, more than long_u, thus we +*************** +*** 6603,6609 **** + { + if (i + 1 > (int)sizeof(time_t)) + /* ">>" doesn't work well when shifting more bits than avail */ +! putc(0, fd); + else + { + #if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4 +--- 6302,6308 ---- + { + if (i + 1 > (int)sizeof(time_t)) + /* ">>" doesn't work well when shifting more bits than avail */ +! buf[bi++] = 0; + else + { + #if defined(SIZEOF_TIME_T) && SIZEOF_TIME_T > 4 +*************** +*** 6611,6617 **** + #else + c = (int)((long_u)wtime >> (i * 8)); + #endif +! putc(c, fd); + } + } + } +--- 6310,6316 ---- + #else + c = (int)((long_u)wtime >> (i * 8)); + #endif +! buf[bi++] = c; + } + } + } +*** ../vim-7.4.398/src/option.c 2014-08-06 14:52:05.047236174 +0200 +--- src/option.c 2014-08-09 15:39:29.741352755 +0200 +*************** +*** 2989,2995 **** + static char *(p_nf_values[]) = {"octal", "hex", "alpha", NULL}; + static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL}; + #ifdef FEAT_CRYPT +! static char *(p_cm_values[]) = {"zip", "blowfish", NULL}; + #endif + #ifdef FEAT_CMDL_COMPL + static char *(p_wop_values[]) = {"tagfile", NULL}; +--- 2989,2995 ---- + static char *(p_nf_values[]) = {"octal", "hex", "alpha", NULL}; + static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL}; + #ifdef FEAT_CRYPT +! static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", NULL}; + #endif + #ifdef FEAT_CMDL_COMPL + static char *(p_wop_values[]) = {"tagfile", NULL}; +*************** +*** 6140,6146 **** + # endif + if (STRCMP(curbuf->b_p_key, oldval) != 0) + /* Need to update the swapfile. */ +! ml_set_crypt_key(curbuf, oldval, get_crypt_method(curbuf)); + } + + else if (gvarp == &p_cm) +--- 6140,6146 ---- + # endif + if (STRCMP(curbuf->b_p_key, oldval) != 0) + /* Need to update the swapfile. */ +! ml_set_crypt_key(curbuf, oldval, crypt_get_method_nr(curbuf)); + } + + else if (gvarp == &p_cm) +*************** +*** 6151,6157 **** + p = p_cm; + if (check_opt_strings(p, p_cm_values, TRUE) != OK) + errmsg = e_invarg; +! else if (get_crypt_method(curbuf) > 0 && blowfish_self_test() == FAIL) + errmsg = e_invarg; + else + { +--- 6151,6157 ---- + p = p_cm; + if (check_opt_strings(p, p_cm_values, TRUE) != OK) + errmsg = e_invarg; +! else if (crypt_self_test() == FAIL) + errmsg = e_invarg; + else + { +*************** +*** 6177,6183 **** + p = curbuf->b_p_cm; + if (STRCMP(s, p) != 0) + ml_set_crypt_key(curbuf, curbuf->b_p_key, +! crypt_method_from_string(s)); + + /* If the global value changes need to update the swapfile for all + * buffers using that value. */ +--- 6177,6183 ---- + p = curbuf->b_p_cm; + if (STRCMP(s, p) != 0) + ml_set_crypt_key(curbuf, curbuf->b_p_key, +! crypt_method_nr_from_name(s)); + + /* If the global value changes need to update the swapfile for all + * buffers using that value. */ +*************** +*** 6188,6194 **** + for (buf = firstbuf; buf != NULL; buf = buf->b_next) + if (buf != curbuf && *buf->b_p_cm == NUL) + ml_set_crypt_key(buf, buf->b_p_key, +! crypt_method_from_string(oldval)); + } + } + } +--- 6188,6194 ---- + for (buf = firstbuf; buf != NULL; buf = buf->b_next) + if (buf != curbuf && *buf->b_p_cm == NUL) + ml_set_crypt_key(buf, buf->b_p_key, +! crypt_method_nr_from_name(oldval)); + } + } + } +*** ../vim-7.4.398/src/proto.h 2013-02-26 14:18:19.000000000 +0100 +--- src/proto.h 2014-08-09 15:39:39.333352686 +0200 +*************** +*** 70,75 **** +--- 70,77 ---- + + # ifdef FEAT_CRYPT + # include "blowfish.pro" ++ # include "crypt.pro" ++ # include "crypt_zip.pro" + # endif + # include "buffer.pro" + # include "charset.pro" +*** ../vim-7.4.398/src/proto/blowfish.pro 2014-02-11 15:23:27.938123631 +0100 +--- src/proto/blowfish.pro 2014-08-09 15:31:32.501356185 +0200 +*************** +*** 1,10 **** + /* blowfish.c */ +! void bf_key_init __ARGS((char_u *password, char_u *salt, int salt_len)); +! void bf_cfb_init __ARGS((char_u *iv, int iv_len)); +! void bf_crypt_encode __ARGS((char_u *from, size_t len, char_u *to)); +! void bf_crypt_decode __ARGS((char_u *ptr, long len)); +! void bf_crypt_init_keys __ARGS((char_u *passwd)); +! void bf_crypt_save __ARGS((void)); +! void bf_crypt_restore __ARGS((void)); + int blowfish_self_test __ARGS((void)); + /* vim: set ft=c : */ +--- 1,6 ---- + /* blowfish.c */ +! void crypt_blowfish_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to)); +! void crypt_blowfish_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to)); +! void crypt_blowfish_init __ARGS((cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len)); + int blowfish_self_test __ARGS((void)); + /* vim: set ft=c : */ +*** ../vim-7.4.398/src/proto/crypt.pro 2014-08-10 13:30:43.880787293 +0200 +--- src/proto/crypt.pro 2014-08-09 15:31:32.501356185 +0200 +*************** +*** 0 **** +--- 1,24 ---- ++ /* crypt.c */ ++ int crypt_method_nr_from_name __ARGS((char_u *name)); ++ int crypt_method_nr_from_magic __ARGS((char *ptr, int len)); ++ int crypt_works_inplace __ARGS((cryptstate_T *state)); ++ int crypt_get_method_nr __ARGS((buf_T *buf)); ++ int crypt_whole_undofile __ARGS((int method_nr)); ++ int crypt_get_header_len __ARGS((int method_nr)); ++ void crypt_set_cm_option __ARGS((buf_T *buf, int method_nr)); ++ int crypt_self_test __ARGS((void)); ++ cryptstate_T *crypt_create __ARGS((int method_nr, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len)); ++ cryptstate_T *crypt_create_from_header __ARGS((int method_nr, char_u *key, char_u *header)); ++ cryptstate_T *crypt_create_from_file __ARGS((FILE *fp, char_u *key)); ++ cryptstate_T *crypt_create_for_writing __ARGS((int method_nr, char_u *key, char_u **header, int *header_len)); ++ void crypt_free_state __ARGS((cryptstate_T *state)); ++ long crypt_encode_alloc __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u **newptr)); ++ long crypt_decode_alloc __ARGS((cryptstate_T *state, char_u *ptr, long len, char_u **newptr)); ++ void crypt_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to)); ++ void crypt_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to)); ++ void crypt_encode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len)); ++ void crypt_decode_inplace __ARGS((cryptstate_T *state, char_u *buf, size_t len)); ++ void crypt_free_key __ARGS((char_u *key)); ++ char_u *crypt_get_key __ARGS((int store, int twice)); ++ void crypt_append_msg __ARGS((buf_T *buf)); ++ /* vim: set ft=c : */ +*** ../vim-7.4.398/src/proto/crypt_zip.pro 2014-08-10 13:30:43.884787293 +0200 +--- src/proto/crypt_zip.pro 2014-08-09 15:31:32.501356185 +0200 +*************** +*** 0 **** +--- 1,5 ---- ++ /* crypt_zip.c */ ++ void crypt_zip_init __ARGS((cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len)); ++ void crypt_zip_encode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to)); ++ void crypt_zip_decode __ARGS((cryptstate_T *state, char_u *from, size_t len, char_u *to)); ++ /* vim: set ft=c : */ +*** ../vim-7.4.398/src/proto/fileio.pro 2013-08-10 13:37:11.000000000 +0200 +--- src/proto/fileio.pro 2014-08-09 15:31:32.501356185 +0200 +*************** +*** 4,11 **** + int prep_exarg __ARGS((exarg_T *eap, buf_T *buf)); + void set_file_options __ARGS((int set_options, exarg_T *eap)); + void set_forced_fenc __ARGS((exarg_T *eap)); +- int prepare_crypt_read __ARGS((FILE *fp)); +- char_u *prepare_crypt_write __ARGS((buf_T *buf, int *lenp)); + int check_file_readonly __ARGS((char_u *fname, int perm)); + int buf_write __ARGS((buf_T *buf, char_u *fname, char_u *sfname, linenr_T start, linenr_T end, exarg_T *eap, int append, int forceit, int reset_changed, int filtering)); + void msg_add_fname __ARGS((buf_T *buf, char_u *fname)); +--- 4,9 ---- +*** ../vim-7.4.398/src/proto/misc2.pro 2014-05-07 18:35:25.669216052 +0200 +--- src/proto/misc2.pro 2014-08-09 15:31:32.501356185 +0200 +*************** +*** 84,99 **** + char_u *parse_shape_opt __ARGS((int what)); + int get_shape_idx __ARGS((int mouse)); + void update_mouseshape __ARGS((int shape_idx)); +- int crypt_method_from_string __ARGS((char_u *s)); +- int get_crypt_method __ARGS((buf_T *buf)); +- void set_crypt_method __ARGS((buf_T *buf, int method)); +- void crypt_push_state __ARGS((void)); +- void crypt_pop_state __ARGS((void)); +- void crypt_encode __ARGS((char_u *from, size_t len, char_u *to)); +- void crypt_decode __ARGS((char_u *ptr, long len)); +- void crypt_init_keys __ARGS((char_u *passwd)); +- void free_crypt_key __ARGS((char_u *key)); +- char_u *get_crypt_key __ARGS((int store, int twice)); + void *vim_findfile_init __ARGS((char_u *path, char_u *filename, char_u *stopdirs, int level, int free_visited, int find_what, void *search_ctx_arg, int tagfile, char_u *rel_fname)); + char_u *vim_findfile_stopdir __ARGS((char_u *buf)); + void vim_findfile_cleanup __ARGS((void *ctx)); +--- 84,89 ---- +*************** +*** 116,120 **** +--- 106,111 ---- + char_u *read_string __ARGS((FILE *fd, int cnt)); + 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)); + /* vim: set ft=c : */ +*** ../vim-7.4.398/src/structs.h 2014-06-25 14:39:35.110348584 +0200 +--- src/structs.h 2014-08-09 15:40:08.501352476 +0200 +*************** +*** 1251,1256 **** +--- 1251,1274 ---- + } syn_time_T; + #endif + ++ #ifdef FEAT_CRYPT ++ /* ++ * Structure to hold the type of encryption and the state of encryption or ++ * decryption. ++ */ ++ typedef struct { ++ int method_nr; ++ void *method_state; /* method-specific state information */ ++ } cryptstate_T; ++ ++ /* values for method_nr */ ++ # define CRYPT_M_ZIP 0 ++ # define CRYPT_M_BF 1 ++ # define CRYPT_M_BF2 2 ++ # define CRYPT_M_COUNT 3 /* number of crypt methods */ ++ #endif ++ ++ + /* + * These are items normally related to a buffer. But when using ":ownsyntax" + * a window may have its own instance. +*************** +*** 1778,1784 **** + int b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */ + #endif + +! }; + + + #ifdef FEAT_DIFF +--- 1796,1807 ---- + int b_was_netbeans_file;/* TRUE if b_netbeans_file was once set */ + #endif + +! #ifdef FEAT_CRYPT +! cryptstate_T *b_cryptstate; /* Encryption state while reading or writing +! * the file. NULL when not using encryption. */ +! #endif +! +! }; /* file_buffer */ + + + #ifdef FEAT_DIFF +*** ../vim-7.4.398/src/undo.c 2014-04-02 14:05:33.999887839 +0200 +--- src/undo.c 2014-08-09 16:55:40.541319903 +0200 +*************** +*** 81,88 **** +--- 81,105 ---- + #define UH_MAGIC 0x18dade /* value for uh_magic when in use */ + #define UE_MAGIC 0xabc123 /* value for ue_magic when in use */ + ++ /* Size of buffer used for encryption. */ ++ #define CRYPT_BUF_SIZE 8192 ++ + #include "vim.h" + ++ /* Structure passed around between functions. ++ * Avoids passing cryptstate_T when encryption not available. */ ++ typedef struct { ++ buf_T *bi_buf; ++ FILE *bi_fp; ++ #ifdef FEAT_CRYPT ++ cryptstate_T *bi_state; ++ char_u *bi_buffer; /* CRYPT_BUF_SIZE, NULL when not buffering */ ++ size_t bi_used; /* bytes written to/read from bi_buffer */ ++ size_t bi_avail; /* bytes available in bi_buffer */ ++ #endif ++ } bufinfo_T; ++ ++ + static long get_undolevel __ARGS((void)); + static void u_unch_branch __ARGS((u_header_T *uhp)); + static u_entry_T *u_get_headentry __ARGS((void)); +*************** +*** 98,115 **** + #ifdef FEAT_PERSISTENT_UNDO + static void corruption_error __ARGS((char *mesg, char_u *file_name)); + static void u_free_uhp __ARGS((u_header_T *uhp)); +! static size_t fwrite_crypt __ARGS((buf_T *buf UNUSED, char_u *ptr, size_t len, FILE *fp)); +! static char_u *read_string_decrypt __ARGS((buf_T *buf UNUSED, FILE *fd, int len)); +! static int serialize_header __ARGS((FILE *fp, buf_T *buf, char_u *hash)); +! static int serialize_uhp __ARGS((FILE *fp, buf_T *buf, u_header_T *uhp)); +! static u_header_T *unserialize_uhp __ARGS((FILE *fp, char_u *file_name)); +! static int serialize_uep __ARGS((FILE *fp, buf_T *buf, u_entry_T *uep)); +! static u_entry_T *unserialize_uep __ARGS((FILE *fp, int *error, char_u *file_name)); +! static void serialize_pos __ARGS((pos_T pos, FILE *fp)); +! static void unserialize_pos __ARGS((pos_T *pos, FILE *fp)); +! static void serialize_visualinfo __ARGS((visualinfo_T *info, FILE *fp)); +! static void unserialize_visualinfo __ARGS((visualinfo_T *info, FILE *fp)); +! static void put_header_ptr __ARGS((FILE *fp, u_header_T *uhp)); + #endif + + #define U_ALLOC_LINE(size) lalloc((long_u)(size), FALSE) +--- 115,140 ---- + #ifdef FEAT_PERSISTENT_UNDO + static void corruption_error __ARGS((char *mesg, char_u *file_name)); + static void u_free_uhp __ARGS((u_header_T *uhp)); +! static int undo_write __ARGS((bufinfo_T *bi, char_u *ptr, size_t len)); +! static int undo_flush __ARGS((bufinfo_T *bi)); +! static int fwrite_crypt __ARGS((bufinfo_T *bi, char_u *ptr, size_t len)); +! static int undo_write_bytes __ARGS((bufinfo_T *bi, long_u nr, int len)); +! static void put_header_ptr __ARGS((bufinfo_T *bi, u_header_T *uhp)); +! static int undo_read_4c __ARGS((bufinfo_T *bi)); +! static int undo_read_2c __ARGS((bufinfo_T *bi)); +! static int undo_read_byte __ARGS((bufinfo_T *bi)); +! static time_t undo_read_time __ARGS((bufinfo_T *bi)); +! static int undo_read __ARGS((bufinfo_T *bi, char_u *buffer, size_t size)); +! static char_u *read_string_decrypt __ARGS((bufinfo_T *bi, int len)); +! static int serialize_header __ARGS((bufinfo_T *bi, char_u *hash)); +! static int serialize_uhp __ARGS((bufinfo_T *bi, u_header_T *uhp)); +! static u_header_T *unserialize_uhp __ARGS((bufinfo_T *bi, char_u *file_name)); +! static int serialize_uep __ARGS((bufinfo_T *bi, u_entry_T *uep)); +! static u_entry_T *unserialize_uep __ARGS((bufinfo_T *bi, int *error, char_u *file_name)); +! static void serialize_pos __ARGS((bufinfo_T *bi, pos_T pos)); +! static void unserialize_pos __ARGS((bufinfo_T *bi, pos_T *pos)); +! static void serialize_visualinfo __ARGS((bufinfo_T *bi, visualinfo_T *info)); +! static void unserialize_visualinfo __ARGS((bufinfo_T *bi, visualinfo_T *info)); + #endif + + #define U_ALLOC_LINE(size) lalloc((long_u)(size), FALSE) +*************** +*** 859,926 **** + } + + /* +! * Like fwrite() but crypt the bytes when 'key' is set. +! * Returns 1 if successful. + */ +! static size_t +! fwrite_crypt(buf, ptr, len, fp) +! buf_T *buf UNUSED; + char_u *ptr; + size_t len; +- FILE *fp; + { + #ifdef FEAT_CRYPT + char_u *copy; + char_u small_buf[100]; + size_t i; + +! if (*buf->b_p_key == NUL) +! return fwrite(ptr, len, (size_t)1, fp); +! if (len < 100) +! copy = small_buf; /* no malloc()/free() for short strings */ +! else + { +! copy = lalloc(len, FALSE); +! if (copy == NULL) +! return 0; +! } +! crypt_encode(ptr, len, copy); +! i = fwrite(copy, len, (size_t)1, fp); +! if (copy != small_buf) +! vim_free(copy); +! return i; +! #else +! return fwrite(ptr, len, (size_t)1, fp); + #endif + } + + /* +! * Read a string of length "len" from "fd". +! * When 'key' is set decrypt the bytes. + */ +! static char_u * +! read_string_decrypt(buf, fd, len) +! buf_T *buf UNUSED; +! FILE *fd; + int len; + { +! char_u *ptr; + +! ptr = read_string(fd, len); + #ifdef FEAT_CRYPT +! if (ptr != NULL && *buf->b_p_key != NUL) +! crypt_decode(ptr, len); + #endif + return ptr; + } + + static int +! serialize_header(fp, buf, hash) +! FILE *fp; +! buf_T *buf; + char_u *hash; + { +! int len; + + /* Start writing, first the magic marker and undo info version. */ + if (fwrite(UF_START_MAGIC, (size_t)UF_START_MAGIC_LEN, (size_t)1, fp) != 1) +--- 884,1177 ---- + } + + /* +! * Write a sequence of bytes to the undo file. +! * Buffers and encrypts as needed. +! * Returns OK or FAIL. + */ +! static int +! undo_write(bi, ptr, len) +! bufinfo_T *bi; +! char_u *ptr; +! size_t len; +! { +! #ifdef FEAT_CRYPT +! if (bi->bi_buffer != NULL) +! { +! size_t len_todo = len; +! char_u *p = ptr; +! +! while (bi->bi_used + len_todo >= CRYPT_BUF_SIZE) +! { +! size_t n = CRYPT_BUF_SIZE - bi->bi_used; +! +! mch_memmove(bi->bi_buffer + bi->bi_used, p, n); +! len_todo -= n; +! p += n; +! bi->bi_used = CRYPT_BUF_SIZE; +! if (undo_flush(bi) == FAIL) +! return FAIL; +! } +! if (len_todo > 0) +! { +! mch_memmove(bi->bi_buffer + bi->bi_used, p, len_todo); +! bi->bi_used += len_todo; +! } +! return OK; +! } +! #endif +! if (fwrite(ptr, len, (size_t)1, bi->bi_fp) != 1) +! return FAIL; +! return OK; +! } +! +! #ifdef FEAT_CRYPT +! static int +! undo_flush(bi) +! bufinfo_T *bi; +! { +! if (bi->bi_used > 0) +! { +! crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used); +! if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1) +! return FAIL; +! bi->bi_used = 0; +! } +! return OK; +! } +! #endif +! +! /* +! * Write "ptr[len]" and crypt the bytes when needed. +! * Returns OK or FAIL. +! */ +! static int +! fwrite_crypt(bi, ptr, len) +! bufinfo_T *bi; + char_u *ptr; + size_t len; + { + #ifdef FEAT_CRYPT + char_u *copy; + char_u small_buf[100]; + size_t i; + +! if (bi->bi_state != NULL && bi->bi_buffer == NULL) + { +! /* crypting every piece of text separately */ +! if (len < 100) +! copy = small_buf; /* no malloc()/free() for short strings */ +! else +! { +! copy = lalloc(len, FALSE); +! if (copy == NULL) +! return 0; +! } +! crypt_encode(bi->bi_state, ptr, len, copy); +! i = fwrite(copy, len, (size_t)1, bi->bi_fp); +! if (copy != small_buf) +! vim_free(copy); +! return i == 1 ? OK : FAIL; +! } + #endif ++ return undo_write(bi, ptr, len); + } + + /* +! * Write a number, MSB first, in "len" bytes. +! * Must match with undo_read_?c() functions. +! * Returns OK or FAIL. + */ +! static int +! undo_write_bytes(bi, nr, len) +! bufinfo_T *bi; +! long_u nr; + int len; + { +! char_u buf[8]; +! int i; +! int bufi = 0; +! +! for (i = len - 1; i >= 0; --i) +! buf[bufi++] = nr >> (i * 8); +! return undo_write(bi, buf, (size_t)len); +! } +! +! /* +! * Write the pointer to an undo header. Instead of writing the pointer itself +! * we use the sequence number of the header. This is converted back to +! * pointers when reading. */ +! static void +! put_header_ptr(bi, uhp) +! bufinfo_T *bi; +! u_header_T *uhp; +! { +! undo_write_bytes(bi, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4); +! } +! +! static int +! undo_read_4c(bi) +! bufinfo_T *bi; +! { +! #ifdef FEAT_CRYPT +! if (bi->bi_buffer != NULL) +! { +! char_u buf[4]; +! int n; +! +! undo_read(bi, buf, (size_t)4); +! n = (buf[0] << 24) + (buf[1] << 16) + (buf[2] << 8) + buf[3]; +! return n; +! } +! #endif +! return get4c(bi->bi_fp); +! } +! +! static int +! undo_read_2c(bi) +! bufinfo_T *bi; +! { +! #ifdef FEAT_CRYPT +! if (bi->bi_buffer != NULL) +! { +! char_u buf[2]; +! int n; +! +! undo_read(bi, buf, (size_t)2); +! n = (buf[0] << 8) + buf[1]; +! return n; +! } +! #endif +! return get2c(bi->bi_fp); +! } +! +! static int +! undo_read_byte(bi) +! bufinfo_T *bi; +! { +! #ifdef FEAT_CRYPT +! if (bi->bi_buffer != NULL) +! { +! char_u buf[1]; +! +! undo_read(bi, buf, (size_t)1); +! return buf[0]; +! } +! #endif +! return getc(bi->bi_fp); +! } +! +! static time_t +! undo_read_time(bi) +! bufinfo_T *bi; +! { +! #ifdef FEAT_CRYPT +! if (bi->bi_buffer != NULL) +! { +! char_u buf[8]; +! time_t n = 0; +! int i; +! +! undo_read(bi, buf, (size_t)8); +! for (i = 0; i < 8; ++i) +! n = (n << 8) + buf[i]; +! return n; +! } +! #endif +! return get8ctime(bi->bi_fp); +! } +! +! /* +! * Read "buffer[size]" from the undo file. +! * Return OK or FAIL. +! */ +! static int +! undo_read(bi, buffer, size) +! bufinfo_T *bi; +! char_u *buffer; +! size_t size; +! { +! #ifdef FEAT_CRYPT +! if (bi->bi_buffer != NULL) +! { +! int size_todo = size; +! char_u *p = buffer; +! +! while (size_todo > 0) +! { +! size_t n; +! +! if (bi->bi_used >= bi->bi_avail) +! { +! n = fread(bi->bi_buffer, 1, (size_t)CRYPT_BUF_SIZE, bi->bi_fp); +! if (n <= 0) +! { +! /* Error may be checked for only later. Fill with zeros, +! * so that the reader won't use garbage. */ +! vim_memset(p, 0, size_todo); +! return FAIL; +! } +! bi->bi_avail = n; +! bi->bi_used = 0; +! crypt_decode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_avail); +! } +! n = size_todo; +! if (n > bi->bi_avail - bi->bi_used) +! n = bi->bi_avail - bi->bi_used; +! mch_memmove(p, bi->bi_buffer + bi->bi_used, n); +! bi->bi_used += n; +! size_todo -= n; +! p += n; +! } +! return OK; +! } +! #endif +! if (fread(buffer, (size_t)size, 1, bi->bi_fp) != 1) +! return FAIL; +! return OK; +! } +! +! /* +! * Read a string of length "len" from "bi->bi_fd". +! * "len" can be zero to allocate an empty line. +! * Decrypt the bytes if needed. +! * Append a NUL. +! * Returns a pointer to allocated memory or NULL for failure. +! */ +! static char_u * +! read_string_decrypt(bi, len) +! bufinfo_T *bi; +! int len; +! { +! char_u *ptr = alloc((unsigned)len + 1); + +! if (ptr != NULL) +! { +! if (len > 0 && undo_read(bi, ptr, len) == FAIL) +! { +! vim_free(ptr); +! return NULL; +! } +! ptr[len] = NUL; + #ifdef FEAT_CRYPT +! if (bi->bi_state != NULL && bi->bi_buffer == NULL) +! crypt_decode_inplace(bi->bi_state, ptr, len); + #endif ++ } + return ptr; + } + ++ /* ++ * Writes the (not encrypted) header and initializes encryption if needed. ++ */ + static int +! serialize_header(bi, hash) +! bufinfo_T *bi; + char_u *hash; + { +! int len; +! buf_T *buf = bi->bi_buf; +! FILE *fp = bi->bi_fp; +! char_u time_buf[8]; + + /* Start writing, first the magic marker and undo info version. */ + if (fwrite(UF_START_MAGIC, (size_t)UF_START_MAGIC_LEN, (size_t)1, fp) != 1) +*************** +*** 934,1041 **** + char_u *header; + int header_len; + +! put_bytes(fp, (long_u)UF_VERSION_CRYPT, 2); +! header = prepare_crypt_write(buf, &header_len); +! if (header == NULL) + return FAIL; + len = (int)fwrite(header, (size_t)header_len, (size_t)1, fp); + vim_free(header); + if (len != 1) + { +! crypt_pop_state(); + return FAIL; + } + } + else + #endif +! put_bytes(fp, (long_u)UF_VERSION, 2); + + + /* Write a hash of the buffer text, so that we can verify it is still the + * same when reading the buffer text. */ +! if (fwrite(hash, (size_t)UNDO_HASH_SIZE, (size_t)1, fp) != 1) + return FAIL; + + /* buffer-specific data */ +! put_bytes(fp, (long_u)buf->b_ml.ml_line_count, 4); + len = buf->b_u_line_ptr != NULL ? (int)STRLEN(buf->b_u_line_ptr) : 0; +! put_bytes(fp, (long_u)len, 4); +! if (len > 0 && fwrite_crypt(buf, buf->b_u_line_ptr, (size_t)len, fp) != 1) + return FAIL; +! put_bytes(fp, (long_u)buf->b_u_line_lnum, 4); +! put_bytes(fp, (long_u)buf->b_u_line_colnr, 4); + + /* Undo structures header data */ +! put_header_ptr(fp, buf->b_u_oldhead); +! put_header_ptr(fp, buf->b_u_newhead); +! put_header_ptr(fp, buf->b_u_curhead); +! +! put_bytes(fp, (long_u)buf->b_u_numhead, 4); +! put_bytes(fp, (long_u)buf->b_u_seq_last, 4); +! put_bytes(fp, (long_u)buf->b_u_seq_cur, 4); +! put_time(fp, buf->b_u_time_cur); + + /* Optional fields. */ +! putc(4, fp); +! putc(UF_LAST_SAVE_NR, fp); +! put_bytes(fp, (long_u)buf->b_u_save_nr_last, 4); + +! putc(0, fp); /* end marker */ + + return OK; + } + + static int +! serialize_uhp(fp, buf, uhp) +! FILE *fp; +! buf_T *buf; + u_header_T *uhp; + { + int i; + u_entry_T *uep; + +! if (put_bytes(fp, (long_u)UF_HEADER_MAGIC, 2) == FAIL) + return FAIL; + +! put_header_ptr(fp, uhp->uh_next.ptr); +! put_header_ptr(fp, uhp->uh_prev.ptr); +! put_header_ptr(fp, uhp->uh_alt_next.ptr); +! put_header_ptr(fp, uhp->uh_alt_prev.ptr); +! put_bytes(fp, uhp->uh_seq, 4); +! serialize_pos(uhp->uh_cursor, fp); + #ifdef FEAT_VIRTUALEDIT +! put_bytes(fp, (long_u)uhp->uh_cursor_vcol, 4); + #else +! put_bytes(fp, (long_u)0, 4); + #endif +! put_bytes(fp, (long_u)uhp->uh_flags, 2); + /* Assume NMARKS will stay the same. */ + for (i = 0; i < NMARKS; ++i) +! serialize_pos(uhp->uh_namedm[i], fp); +! serialize_visualinfo(&uhp->uh_visual, fp); +! put_time(fp, uhp->uh_time); + + /* Optional fields. */ +! putc(4, fp); +! putc(UHP_SAVE_NR, fp); +! put_bytes(fp, (long_u)uhp->uh_save_nr, 4); + +! putc(0, fp); /* end marker */ + + /* Write all the entries. */ + for (uep = uhp->uh_entry; uep != NULL; uep = uep->ue_next) + { +! put_bytes(fp, (long_u)UF_ENTRY_MAGIC, 2); +! if (serialize_uep(fp, buf, uep) == FAIL) + return FAIL; + } +! put_bytes(fp, (long_u)UF_ENTRY_END_MAGIC, 2); + return OK; + } + + static u_header_T * +! unserialize_uhp(fp, file_name) +! FILE *fp; + char_u *file_name; + { + u_header_T *uhp; +--- 1185,1308 ---- + char_u *header; + int header_len; + +! undo_write_bytes(bi, (long_u)UF_VERSION_CRYPT, 2); +! bi->bi_state = crypt_create_for_writing(crypt_get_method_nr(buf), +! buf->b_p_key, &header, &header_len); +! if (bi->bi_state == NULL) + return FAIL; + len = (int)fwrite(header, (size_t)header_len, (size_t)1, fp); + vim_free(header); + if (len != 1) + { +! crypt_free_state(bi->bi_state); +! bi->bi_state = NULL; + return FAIL; + } ++ ++ if (crypt_whole_undofile(crypt_get_method_nr(buf))) ++ { ++ bi->bi_buffer = alloc(CRYPT_BUF_SIZE); ++ if (bi->bi_buffer == NULL) ++ { ++ crypt_free_state(bi->bi_state); ++ bi->bi_state = NULL; ++ return FAIL; ++ } ++ bi->bi_used = 0; ++ } + } + else + #endif +! undo_write_bytes(bi, (long_u)UF_VERSION, 2); + + + /* Write a hash of the buffer text, so that we can verify it is still the + * same when reading the buffer text. */ +! if (undo_write(bi, hash, (size_t)UNDO_HASH_SIZE) == FAIL) + return FAIL; + + /* buffer-specific data */ +! undo_write_bytes(bi, (long_u)buf->b_ml.ml_line_count, 4); + len = buf->b_u_line_ptr != NULL ? (int)STRLEN(buf->b_u_line_ptr) : 0; +! undo_write_bytes(bi, (long_u)len, 4); +! if (len > 0 && fwrite_crypt(bi, buf->b_u_line_ptr, (size_t)len) == FAIL) + return FAIL; +! undo_write_bytes(bi, (long_u)buf->b_u_line_lnum, 4); +! undo_write_bytes(bi, (long_u)buf->b_u_line_colnr, 4); + + /* Undo structures header data */ +! put_header_ptr(bi, buf->b_u_oldhead); +! put_header_ptr(bi, buf->b_u_newhead); +! put_header_ptr(bi, buf->b_u_curhead); +! +! undo_write_bytes(bi, (long_u)buf->b_u_numhead, 4); +! undo_write_bytes(bi, (long_u)buf->b_u_seq_last, 4); +! undo_write_bytes(bi, (long_u)buf->b_u_seq_cur, 4); +! time_to_bytes(buf->b_u_time_cur, time_buf); +! undo_write(bi, time_buf, 8); + + /* Optional fields. */ +! undo_write_bytes(bi, 4, 1); +! undo_write_bytes(bi, UF_LAST_SAVE_NR, 1); +! undo_write_bytes(bi, (long_u)buf->b_u_save_nr_last, 4); + +! undo_write_bytes(bi, 0, 1); /* end marker */ + + return OK; + } + + static int +! serialize_uhp(bi, uhp) +! bufinfo_T *bi; + u_header_T *uhp; + { + int i; + u_entry_T *uep; ++ char_u time_buf[8]; + +! if (undo_write_bytes(bi, (long_u)UF_HEADER_MAGIC, 2) == FAIL) + return FAIL; + +! put_header_ptr(bi, uhp->uh_next.ptr); +! put_header_ptr(bi, uhp->uh_prev.ptr); +! put_header_ptr(bi, uhp->uh_alt_next.ptr); +! put_header_ptr(bi, uhp->uh_alt_prev.ptr); +! undo_write_bytes(bi, uhp->uh_seq, 4); +! serialize_pos(bi, uhp->uh_cursor); + #ifdef FEAT_VIRTUALEDIT +! undo_write_bytes(bi, (long_u)uhp->uh_cursor_vcol, 4); + #else +! undo_write_bytes(bi, (long_u)0, 4); + #endif +! undo_write_bytes(bi, (long_u)uhp->uh_flags, 2); + /* Assume NMARKS will stay the same. */ + for (i = 0; i < NMARKS; ++i) +! serialize_pos(bi, uhp->uh_namedm[i]); +! serialize_visualinfo(bi, &uhp->uh_visual); +! time_to_bytes(uhp->uh_time, time_buf); +! undo_write(bi, time_buf, 8); + + /* Optional fields. */ +! undo_write_bytes(bi, 4, 1); +! undo_write_bytes(bi, UHP_SAVE_NR, 1); +! undo_write_bytes(bi, (long_u)uhp->uh_save_nr, 4); + +! undo_write_bytes(bi, 0, 1); /* end marker */ + + /* Write all the entries. */ + for (uep = uhp->uh_entry; uep != NULL; uep = uep->ue_next) + { +! undo_write_bytes(bi, (long_u)UF_ENTRY_MAGIC, 2); +! if (serialize_uep(bi, uep) == FAIL) + return FAIL; + } +! undo_write_bytes(bi, (long_u)UF_ENTRY_END_MAGIC, 2); + return OK; + } + + static u_header_T * +! unserialize_uhp(bi, file_name) +! bufinfo_T *bi; + char_u *file_name; + { + u_header_T *uhp; +*************** +*** 1051,1106 **** + #ifdef U_DEBUG + uhp->uh_magic = UH_MAGIC; + #endif +! uhp->uh_next.seq = get4c(fp); +! uhp->uh_prev.seq = get4c(fp); +! uhp->uh_alt_next.seq = get4c(fp); +! uhp->uh_alt_prev.seq = get4c(fp); +! uhp->uh_seq = get4c(fp); + if (uhp->uh_seq <= 0) + { + corruption_error("uh_seq", file_name); + vim_free(uhp); + return NULL; + } +! unserialize_pos(&uhp->uh_cursor, fp); + #ifdef FEAT_VIRTUALEDIT +! uhp->uh_cursor_vcol = get4c(fp); + #else +! (void)get4c(fp); + #endif +! uhp->uh_flags = get2c(fp); + for (i = 0; i < NMARKS; ++i) +! unserialize_pos(&uhp->uh_namedm[i], fp); +! unserialize_visualinfo(&uhp->uh_visual, fp); +! uhp->uh_time = get8ctime(fp); + + /* Optional fields. */ + for (;;) + { +! int len = getc(fp); + int what; + + if (len == 0) + break; +! what = getc(fp); + switch (what) + { + case UHP_SAVE_NR: +! uhp->uh_save_nr = get4c(fp); + break; + default: + /* field not supported, skip */ + while (--len >= 0) +! (void)getc(fp); + } + } + + /* Unserialize the uep list. */ + last_uep = NULL; +! while ((c = get2c(fp)) == UF_ENTRY_MAGIC) + { + error = FALSE; +! uep = unserialize_uep(fp, &error, file_name); + if (last_uep == NULL) + uhp->uh_entry = uep; + else +--- 1318,1373 ---- + #ifdef U_DEBUG + uhp->uh_magic = UH_MAGIC; + #endif +! uhp->uh_next.seq = undo_read_4c(bi); +! uhp->uh_prev.seq = undo_read_4c(bi); +! uhp->uh_alt_next.seq = undo_read_4c(bi); +! uhp->uh_alt_prev.seq = undo_read_4c(bi); +! uhp->uh_seq = undo_read_4c(bi); + if (uhp->uh_seq <= 0) + { + corruption_error("uh_seq", file_name); + vim_free(uhp); + return NULL; + } +! unserialize_pos(bi, &uhp->uh_cursor); + #ifdef FEAT_VIRTUALEDIT +! uhp->uh_cursor_vcol = undo_read_4c(bi); + #else +! (void)undo_read_4c(bi); + #endif +! uhp->uh_flags = undo_read_2c(bi); + for (i = 0; i < NMARKS; ++i) +! unserialize_pos(bi, &uhp->uh_namedm[i]); +! unserialize_visualinfo(bi, &uhp->uh_visual); +! uhp->uh_time = undo_read_time(bi); + + /* Optional fields. */ + for (;;) + { +! int len = undo_read_byte(bi); + int what; + + if (len == 0) + break; +! what = undo_read_byte(bi); + switch (what) + { + case UHP_SAVE_NR: +! uhp->uh_save_nr = undo_read_4c(bi); + break; + default: + /* field not supported, skip */ + while (--len >= 0) +! (void)undo_read_byte(bi); + } + } + + /* Unserialize the uep list. */ + last_uep = NULL; +! while ((c = undo_read_2c(bi)) == UF_ENTRY_MAGIC) + { + error = FALSE; +! uep = unserialize_uep(bi, &error, file_name); + if (last_uep == NULL) + uhp->uh_entry = uep; + else +*************** +*** 1123,1157 **** + } + + /* +! * Serialize "uep" to "fp". + */ + static int +! serialize_uep(fp, buf, uep) +! FILE *fp; +! buf_T *buf; + u_entry_T *uep; + { + int i; + size_t len; + +! put_bytes(fp, (long_u)uep->ue_top, 4); +! put_bytes(fp, (long_u)uep->ue_bot, 4); +! put_bytes(fp, (long_u)uep->ue_lcount, 4); +! put_bytes(fp, (long_u)uep->ue_size, 4); + for (i = 0; i < uep->ue_size; ++i) + { + len = STRLEN(uep->ue_array[i]); +! if (put_bytes(fp, (long_u)len, 4) == FAIL) + return FAIL; +! if (len > 0 && fwrite_crypt(buf, uep->ue_array[i], len, fp) != 1) + return FAIL; + } + return OK; + } + + static u_entry_T * +! unserialize_uep(fp, error, file_name) +! FILE *fp; + int *error; + char_u *file_name; + { +--- 1390,1423 ---- + } + + /* +! * Serialize "uep". + */ + static int +! serialize_uep(bi, uep) +! bufinfo_T *bi; + u_entry_T *uep; + { + int i; + size_t len; + +! undo_write_bytes(bi, (long_u)uep->ue_top, 4); +! undo_write_bytes(bi, (long_u)uep->ue_bot, 4); +! undo_write_bytes(bi, (long_u)uep->ue_lcount, 4); +! undo_write_bytes(bi, (long_u)uep->ue_size, 4); + for (i = 0; i < uep->ue_size; ++i) + { + len = STRLEN(uep->ue_array[i]); +! if (undo_write_bytes(bi, (long_u)len, 4) == FAIL) + return FAIL; +! if (len > 0 && fwrite_crypt(bi, uep->ue_array[i], len) == FAIL) + return FAIL; + } + return OK; + } + + static u_entry_T * +! unserialize_uep(bi, error, file_name) +! bufinfo_T *bi; + int *error; + char_u *file_name; + { +*************** +*** 1168,1177 **** + #ifdef U_DEBUG + uep->ue_magic = UE_MAGIC; + #endif +! uep->ue_top = get4c(fp); +! uep->ue_bot = get4c(fp); +! uep->ue_lcount = get4c(fp); +! uep->ue_size = get4c(fp); + if (uep->ue_size > 0) + { + array = (char_u **)U_ALLOC_LINE(sizeof(char_u *) * uep->ue_size); +--- 1434,1443 ---- + #ifdef U_DEBUG + uep->ue_magic = UE_MAGIC; + #endif +! uep->ue_top = undo_read_4c(bi); +! uep->ue_bot = undo_read_4c(bi); +! uep->ue_lcount = undo_read_4c(bi); +! uep->ue_size = undo_read_4c(bi); + if (uep->ue_size > 0) + { + array = (char_u **)U_ALLOC_LINE(sizeof(char_u *) * uep->ue_size); +*************** +*** 1188,1196 **** + + for (i = 0; i < uep->ue_size; ++i) + { +! line_len = get4c(fp); + if (line_len >= 0) +! line = read_string_decrypt(curbuf, fp, line_len); + else + { + line = NULL; +--- 1454,1462 ---- + + for (i = 0; i < uep->ue_size; ++i) + { +! line_len = undo_read_4c(bi); + if (line_len >= 0) +! line = read_string_decrypt(bi, line_len); + else + { + line = NULL; +*************** +*** 1207,1289 **** + } + + /* +! * Serialize "pos" to "fp". + */ + static void +! serialize_pos(pos, fp) + pos_T pos; +- FILE *fp; + { +! put_bytes(fp, (long_u)pos.lnum, 4); +! put_bytes(fp, (long_u)pos.col, 4); + #ifdef FEAT_VIRTUALEDIT +! put_bytes(fp, (long_u)pos.coladd, 4); + #else +! put_bytes(fp, (long_u)0, 4); + #endif + } + + /* +! * Unserialize the pos_T at the current position in fp. + */ + static void +! unserialize_pos(pos, fp) + pos_T *pos; +- FILE *fp; + { +! pos->lnum = get4c(fp); + if (pos->lnum < 0) + pos->lnum = 0; +! pos->col = get4c(fp); + if (pos->col < 0) + pos->col = 0; + #ifdef FEAT_VIRTUALEDIT +! pos->coladd = get4c(fp); + if (pos->coladd < 0) + pos->coladd = 0; + #else +! (void)get4c(fp); + #endif + } + + /* +! * Serialize "info" to "fp". + */ + static void +! serialize_visualinfo(info, fp) + visualinfo_T *info; +- FILE *fp; + { +! serialize_pos(info->vi_start, fp); +! serialize_pos(info->vi_end, fp); +! put_bytes(fp, (long_u)info->vi_mode, 4); +! put_bytes(fp, (long_u)info->vi_curswant, 4); + } + + /* +! * Unserialize the visualinfo_T at the current position in fp. + */ + static void +! unserialize_visualinfo(info, fp) + visualinfo_T *info; +- FILE *fp; +- { +- unserialize_pos(&info->vi_start, fp); +- unserialize_pos(&info->vi_end, fp); +- info->vi_mode = get4c(fp); +- info->vi_curswant = get4c(fp); +- } +- +- /* +- * Write the pointer to an undo header. Instead of writing the pointer itself +- * we use the sequence number of the header. This is converted back to +- * pointers when reading. */ +- static void +- put_header_ptr(fp, uhp) +- FILE *fp; +- u_header_T *uhp; + { +! put_bytes(fp, (long_u)(uhp != NULL ? uhp->uh_seq : 0), 4); + } + + /* +--- 1473,1543 ---- + } + + /* +! * Serialize "pos". + */ + static void +! serialize_pos(bi, pos) +! bufinfo_T *bi; + pos_T pos; + { +! undo_write_bytes(bi, (long_u)pos.lnum, 4); +! undo_write_bytes(bi, (long_u)pos.col, 4); + #ifdef FEAT_VIRTUALEDIT +! undo_write_bytes(bi, (long_u)pos.coladd, 4); + #else +! undo_write_bytes(bi, (long_u)0, 4); + #endif + } + + /* +! * Unserialize the pos_T at the current position. + */ + static void +! unserialize_pos(bi, pos) +! bufinfo_T *bi; + pos_T *pos; + { +! pos->lnum = undo_read_4c(bi); + if (pos->lnum < 0) + pos->lnum = 0; +! pos->col = undo_read_4c(bi); + if (pos->col < 0) + pos->col = 0; + #ifdef FEAT_VIRTUALEDIT +! pos->coladd = undo_read_4c(bi); + if (pos->coladd < 0) + pos->coladd = 0; + #else +! (void)undo_read_4c(bi); + #endif + } + + /* +! * Serialize "info". + */ + static void +! serialize_visualinfo(bi, info) +! bufinfo_T *bi; + visualinfo_T *info; + { +! serialize_pos(bi, info->vi_start); +! serialize_pos(bi, info->vi_end); +! undo_write_bytes(bi, (long_u)info->vi_mode, 4); +! undo_write_bytes(bi, (long_u)info->vi_curswant, 4); + } + + /* +! * Unserialize the visualinfo_T at the current position. + */ + static void +! unserialize_visualinfo(bi, info) +! bufinfo_T *bi; + visualinfo_T *info; + { +! unserialize_pos(bi, &info->vi_start); +! unserialize_pos(bi, &info->vi_end); +! info->vi_mode = undo_read_4c(bi); +! info->vi_curswant = undo_read_4c(bi); + } + + /* +*************** +*** 1317,1324 **** + struct stat st_old; + struct stat st_new; + #endif + #ifdef FEAT_CRYPT +! int do_crypt = FALSE; + #endif + + if (name == NULL) +--- 1571,1581 ---- + struct stat st_old; + struct stat st_new; + #endif ++ bufinfo_T bi; ++ + #ifdef FEAT_CRYPT +! bi.bi_state = NULL; +! bi.bi_buffer = NULL; + #endif + + if (name == NULL) +*************** +*** 1474,1487 **** + u_sync(TRUE); + + /* +! * Write the header. + */ +! if (serialize_header(fp, buf, hash) == FAIL) + goto write_error; +- #ifdef FEAT_CRYPT +- if (*buf->b_p_key != NUL) +- do_crypt = TRUE; +- #endif + + /* + * Iteratively serialize UHPs and their UEPs from the top down. +--- 1731,1742 ---- + u_sync(TRUE); + + /* +! * Write the header. Initializes encryption, if enabled. + */ +! bi.bi_buf = buf; +! bi.bi_fp = fp; +! if (serialize_header(&bi, hash) == FAIL) + goto write_error; + + /* + * Iteratively serialize UHPs and their UEPs from the top down. +*************** +*** 1497,1503 **** + #ifdef U_DEBUG + ++headers_written; + #endif +! if (serialize_uhp(fp, buf, uhp) == FAIL) + goto write_error; + } + +--- 1752,1758 ---- + #ifdef U_DEBUG + ++headers_written; + #endif +! if (serialize_uhp(&bi, uhp) == FAIL) + goto write_error; + } + +*************** +*** 1516,1522 **** + uhp = uhp->uh_next.ptr; + } + +! if (put_bytes(fp, (long_u)UF_HEADER_END_MAGIC, 2) == OK) + write_ok = TRUE; + #ifdef U_DEBUG + if (headers_written != buf->b_u_numhead) +--- 1771,1777 ---- + uhp = uhp->uh_next.ptr; + } + +! if (undo_write_bytes(&bi, (long_u)UF_HEADER_END_MAGIC, 2) == OK) + write_ok = TRUE; + #ifdef U_DEBUG + if (headers_written != buf->b_u_numhead) +*************** +*** 1526,1531 **** +--- 1781,1791 ---- + } + #endif + ++ #ifdef FEAT_CRYPT ++ if (bi.bi_state != NULL && undo_flush(&bi) == FAIL) ++ write_ok = FALSE; ++ #endif ++ + write_error: + fclose(fp); + if (!write_ok) +*************** +*** 1551,1558 **** + + theend: + #ifdef FEAT_CRYPT +! if (do_crypt) +! crypt_pop_state(); + #endif + if (file_name != name) + vim_free(file_name); +--- 1811,1819 ---- + + theend: + #ifdef FEAT_CRYPT +! if (bi.bi_state != NULL) +! crypt_free_state(bi.bi_state); +! vim_free(bi.bi_buffer); + #endif + if (file_name != name) + vim_free(file_name); +*************** +*** 1598,1606 **** + struct stat st_orig; + struct stat st_undo; + #endif +! #ifdef FEAT_CRYPT +! int do_decrypt = FALSE; +! #endif + + if (name == NULL) + { +--- 1859,1865 ---- + struct stat st_orig; + struct stat st_undo; + #endif +! bufinfo_T bi; + + if (name == NULL) + { +*************** +*** 1644,1649 **** +--- 1903,1914 ---- + EMSG2(_("E822: Cannot open undo file for reading: %s"), file_name); + goto error; + } ++ bi.bi_buf = curbuf; ++ bi.bi_fp = fp; ++ #ifdef FEAT_CRYPT ++ bi.bi_state = NULL; ++ bi.bi_buffer = NULL; ++ #endif + + /* + * Read the undo file header. +*************** +*** 1664,1675 **** + file_name); + goto error; + } +! if (prepare_crypt_read(fp) == FAIL) + { + EMSG2(_("E826: Undo file decryption failed: %s"), file_name); + goto error; + } +! do_decrypt = TRUE; + #else + EMSG2(_("E827: Undo file is encrypted: %s"), file_name); + goto error; +--- 1929,1952 ---- + file_name); + goto error; + } +! bi.bi_state = crypt_create_from_file(fp, curbuf->b_p_key); +! if (bi.bi_state == NULL) + { + EMSG2(_("E826: Undo file decryption failed: %s"), file_name); + goto error; + } +! if (crypt_whole_undofile(bi.bi_state->method_nr)) +! { +! bi.bi_buffer = alloc(CRYPT_BUF_SIZE); +! if (bi.bi_buffer == NULL) +! { +! crypt_free_state(bi.bi_state); +! bi.bi_state = NULL; +! goto error; +! } +! bi.bi_avail = 0; +! bi.bi_used = 0; +! } + #else + EMSG2(_("E827: Undo file is encrypted: %s"), file_name); + goto error; +*************** +*** 1681,1692 **** + goto error; + } + +! if (fread(read_hash, UNDO_HASH_SIZE, 1, fp) != 1) + { + corruption_error("hash", file_name); + goto error; + } +! line_count = (linenr_T)get4c(fp); + if (memcmp(hash, read_hash, UNDO_HASH_SIZE) != 0 + || line_count != curbuf->b_ml.ml_line_count) + { +--- 1958,1969 ---- + goto error; + } + +! if (undo_read(&bi, read_hash, (size_t)UNDO_HASH_SIZE) == FAIL) + { + corruption_error("hash", file_name); + goto error; + } +! line_count = (linenr_T)undo_read_4c(&bi); + if (memcmp(hash, read_hash, UNDO_HASH_SIZE) != 0 + || line_count != curbuf->b_ml.ml_line_count) + { +*************** +*** 1703,1715 **** + } + + /* Read undo data for "U" command. */ +! str_len = get4c(fp); + if (str_len < 0) + goto error; + if (str_len > 0) +! line_ptr = read_string_decrypt(curbuf, fp, str_len); +! line_lnum = (linenr_T)get4c(fp); +! line_colnr = (colnr_T)get4c(fp); + if (line_lnum < 0 || line_colnr < 0) + { + corruption_error("line lnum/col", file_name); +--- 1980,1992 ---- + } + + /* Read undo data for "U" command. */ +! str_len = undo_read_4c(&bi); + if (str_len < 0) + goto error; + if (str_len > 0) +! line_ptr = read_string_decrypt(&bi, str_len); +! line_lnum = (linenr_T)undo_read_4c(&bi); +! line_colnr = (colnr_T)undo_read_4c(&bi); + if (line_lnum < 0 || line_colnr < 0) + { + corruption_error("line lnum/col", file_name); +*************** +*** 1717,1748 **** + } + + /* Begin general undo data */ +! old_header_seq = get4c(fp); +! new_header_seq = get4c(fp); +! cur_header_seq = get4c(fp); +! num_head = get4c(fp); +! seq_last = get4c(fp); +! seq_cur = get4c(fp); +! seq_time = get8ctime(fp); + + /* Optional header fields. */ + for (;;) + { +! int len = getc(fp); + int what; + + if (len == 0 || len == EOF) + break; +! what = getc(fp); + switch (what) + { + case UF_LAST_SAVE_NR: +! last_save_nr = get4c(fp); + break; + default: + /* field not supported, skip */ + while (--len >= 0) +! (void)getc(fp); + } + } + +--- 1994,2025 ---- + } + + /* Begin general undo data */ +! old_header_seq = undo_read_4c(&bi); +! new_header_seq = undo_read_4c(&bi); +! cur_header_seq = undo_read_4c(&bi); +! num_head = undo_read_4c(&bi); +! seq_last = undo_read_4c(&bi); +! seq_cur = undo_read_4c(&bi); +! seq_time = undo_read_time(&bi); + + /* Optional header fields. */ + for (;;) + { +! int len = undo_read_byte(&bi); + int what; + + if (len == 0 || len == EOF) + break; +! what = undo_read_byte(&bi); + switch (what) + { + case UF_LAST_SAVE_NR: +! last_save_nr = undo_read_4c(&bi); + break; + default: + /* field not supported, skip */ + while (--len >= 0) +! (void)undo_read_byte(&bi); + } + } + +*************** +*** 1758,1764 **** + goto error; + } + +! while ((c = get2c(fp)) == UF_HEADER_MAGIC) + { + if (num_read_uhps >= num_head) + { +--- 2035,2041 ---- + goto error; + } + +! while ((c = undo_read_2c(&bi)) == UF_HEADER_MAGIC) + { + if (num_read_uhps >= num_head) + { +*************** +*** 1766,1772 **** + goto error; + } + +! uhp = unserialize_uhp(fp, file_name); + if (uhp == NULL) + goto error; + uhp_table[num_read_uhps++] = uhp; +--- 2043,2049 ---- + goto error; + } + +! uhp = unserialize_uhp(&bi, file_name); + if (uhp == NULL) + goto error; + uhp_table[num_read_uhps++] = uhp; +*************** +*** 1898,1905 **** + + theend: + #ifdef FEAT_CRYPT +! if (do_decrypt) +! crypt_pop_state(); + #endif + if (fp != NULL) + fclose(fp); +--- 2175,2183 ---- + + theend: + #ifdef FEAT_CRYPT +! if (bi.bi_state != NULL) +! crypt_free_state(bi.bi_state); +! vim_free(bi.bi_buffer); + #endif + if (fp != NULL) + fclose(fp); +*** ../vim-7.4.398/src/testdir/test71.in 2013-07-01 20:47:58.000000000 +0200 +--- src/testdir/test71.in 2014-08-09 15:12:57.997364196 +0200 +*************** +*** 13,18 **** +--- 13,20 ---- + :let cm0_bytes = getline('.', '.') + :/^start of cm=blowfish bytes/+1 + :let cm1_bytes = getline('.', '.') ++ :/^start of cm=blowfish2 bytes/+1 ++ :let cm2_bytes = getline('.', '.') + :bwipe! + :call append(0, text_lines) + :$d +*************** +*** 36,41 **** +--- 38,55 ---- + :e Xtestfile + barfoo + :let cm1_read_back = getline('.', '$') ++ :set key= ++ :set cryptmethod=blowfish2 ++ :" If the blowfish test fails 'cryptmethod' will be 'zip' now. ++ :%s/^/\=&cryptmethod == 'blowfish2' ? "OK " : "blowfish test failed "/ ++ :X ++ bar2foo ++ bar2foo ++ :w! Xtestfile ++ :bwipe! ++ :e Xtestfile ++ bar2foo ++ :let cm2_read_back = getline('.', '$') + :bwipe! + :set bin noeol key= + :call append(0, cm0_bytes) +*************** +*** 57,63 **** +--- 71,90 ---- + :set nobin + :e Xtestfile + barbar ++ :let cm1_read_bin = getline('.', '$') ++ :bwipe! ++ :set bin noeol key= ++ :call append(0, cm2_bytes) ++ :$d ++ :set fenc=latin1 ++ :w! Xtestfile ++ :bwipe! ++ :set nobin ++ :e Xtestfile ++ barburp ++ :call append(0, cm1_read_bin) + :call append(0, cm0_read_bin) ++ :call append(0, cm2_read_back) + :call append(0, cm1_read_back) + :call append(0, cm0_read_back) + :set key= fenc=latin1 +*** ../vim-7.4.398/src/testdir/test72.in 2014-03-12 16:51:35.060792541 +0100 +--- src/testdir/test72.in 2014-08-09 15:12:58.001364196 +0200 +*************** +*** 81,86 **** +--- 81,87 ---- + :" + :" With encryption, cryptmethod=blowfish + :e! Xtestfile ++ rubbish + :set undofile cm=blowfish + ggdGijan + feb +*************** +*** 100,105 **** +--- 101,132 ---- + :set key= + /bar + :.w >>test.out ++ u:.w >>test.out ++ u:.w >>test.out ++ u:.w >>test.out ++ :" ++ :" With encryption, cryptmethod=blowfish2 ++ :e! Xtestfile ++ rubbish ++ :set undofile cm=blowfish2 ++ ggdGijan ++ feb ++ mar ++ apr ++ jun:set ul=100 ++ kk0ifoo :set ul=100 ++ dd:set ul=100 ++ ibar :set ul=100 ++ :X ++ foo2bar ++ foo2bar ++ :w! ++ :bwipe! ++ :e Xtestfile ++ foo2bar ++ :set key= ++ /bar ++ :.w >>test.out + u:.w >>test.out + u:.w >>test.out + u:.w >>test.out +*** ../vim-7.4.398/src/testdir/test72.ok 2012-01-04 19:04:17.000000000 +0100 +--- src/testdir/test72.ok 2014-08-09 15:12:58.001364196 +0200 +*************** +*** 25,27 **** +--- 25,31 ---- + apr + foo mar + mar ++ bar apr ++ apr ++ foo mar ++ mar +diff -up src/testdir/test71.ok.kh src/testdir/test71.ok +--- src/testdir/test71.ok.kh 2014-08-12 14:21:33.301002125 +0200 ++++ src/testdir/test71.ok 2014-08-12 14:21:06.140002788 +0200 +@@ -4,7 +4,12 @@ line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + OK 01234567890123456789012345678901234567 + OK line 2 foo bar blah + OK line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ++OK OK 01234567890123456789012345678901234567 ++OK OK line 2 foo bar blah ++OK OK line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + 1234567890 + a�bbccdde�ff + asdfasdfasdf + 0001112223333 ++abcdefghijklmnopqrstuvwxyz ++!@#$%^&*()_+=-`~ +diff -up src/testdir/test71a.in.kh src/testdir/test71a.in +--- src/testdir/test71a.in.kh 2014-08-12 14:27:34.429993316 +0200 ++++ src/testdir/test71a.in 2014-08-12 14:26:40.114994641 +0200 +@@ -12,3 +12,7 @@ end of cm=zip bytes + start of cm=blowfish bytes + VimCrypt~02!k)��#�S��=���#�M��J�AͥM��!�������� � + end of cm=blowfish bytes ++ ++start of cm=blowfish2 bytes ++VimCrypt~03!ÑNã;ÓÀ ^C)÷.¶«FSà‹6Ò[T˧…ؾ9 2 Q³Ì@—ߚ­Ivª.ØÉîž`½$¯%Ð ++end of cm=blowfish2 bytes +*** ../vim-7.4.398/src/version.c 2014-08-07 13:55:05.898639758 +0200 +--- src/version.c 2014-08-09 15:11:28.665364838 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 399, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +16. You step out of your room and realize that your parents have moved and + you don't have a clue when it happened. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.400 b/7.4.400 new file mode 100644 index 0000000..9c922a3 --- /dev/null +++ b/7.4.400 @@ -0,0 +1,69 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.400 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.400 +Problem: List of distributed files is incomplete. +Solution: Add recently added files. +Files: Filelist + + +*** ../vim-7.4.399/Filelist 2014-05-13 13:52:34.817605451 +0200 +--- Filelist 2014-08-10 13:43:31.612781775 +0200 +*************** +*** 11,16 **** +--- 11,18 ---- + src/blowfish.c \ + src/buffer.c \ + src/charset.c \ ++ src/crypt.c \ ++ src/crypt_zip.c \ + src/diff.c \ + src/digraph.c \ + src/edit.c \ +*************** +*** 103,108 **** +--- 105,112 ---- + src/proto/blowfish.pro \ + src/proto/buffer.pro \ + src/proto/charset.pro \ ++ src/proto/crypt.pro \ ++ src/proto/crypt_zip.pro \ + src/proto/diff.pro \ + src/proto/digraph.pro \ + src/proto/edit.pro \ +*************** +*** 289,294 **** +--- 293,300 ---- + src/dosinst.h \ + src/glbl_ime.cpp \ + src/glbl_ime.h \ ++ src/gui_dwrite.cpp \ ++ src/gui_dwrite.h \ + src/gui_w16.c \ + src/gui_w32.c \ + src/gui_w48.c \ +*** ../vim-7.4.399/src/version.c 2014-08-10 13:34:59.064785459 +0200 +--- src/version.c 2014-08-10 13:45:45.800780810 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 400, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +17. You turn on your intercom when leaving the room so you can hear if new + e-mail arrives. + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.401 b/7.4.401 new file mode 100644 index 0000000..408f33a --- /dev/null +++ b/7.4.401 @@ -0,0 +1,357 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.401 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.401 (after 7.4.399) +Problem: Can't build on MS-Windows. +Solution: Include the new files in all the Makefiles. +Files: src/Make_bc3.mak, src/Make_bc5.mak, src/Make_cyg.mak, + src/Make_dice.mak, src/Make_djg.mak, src/Make_ivc.mak, + src/Make_manx.mak, src/Make_ming.mak, src/Make_morph.mak, + src/Make_mvc.mak, src/Make_os2.mak, src/Make_sas.mak, + Make_vms.mms + + +*** ../vim-7.4.400/src/Make_bc3.mak 2010-05-18 20:27:58.000000000 +0200 +--- src/Make_bc3.mak 2014-08-10 16:20:20.068714153 +0200 +*************** +*** 54,59 **** +--- 54,61 ---- + blowfish.obj \ + buffer.obj \ + charset.obj \ ++ crypt.obj \ ++ crypt_zip.obj \ + diff.obj \ + digraph.obj \ + edit.obj \ +*** ../vim-7.4.400/src/Make_bc5.mak 2014-01-10 18:16:00.000000000 +0100 +--- src/Make_bc5.mak 2014-08-10 16:20:39.684714012 +0200 +*************** +*** 580,585 **** +--- 580,587 ---- + $(OBJDIR)\blowfish.obj \ + $(OBJDIR)\buffer.obj \ + $(OBJDIR)\charset.obj \ ++ $(OBJDIR)\crypt.obj \ ++ $(OBJDIR)\crypt_zip.obj \ + $(OBJDIR)\diff.obj \ + $(OBJDIR)\digraph.obj \ + $(OBJDIR)\edit.obj \ +*** ../vim-7.4.400/src/Make_cyg.mak 2014-08-06 14:52:05.039236174 +0200 +--- src/Make_cyg.mak 2014-08-10 16:30:48.656709635 +0200 +*************** +*** 1,6 **** + # + # Makefile for VIM on Win32, using Cygnus gcc +! # Last updated by Dan Sharp. Last Change: 2013 Dec 11 + # + # Also read INSTALLpc.txt! + # +--- 1,7 ---- + # + # Makefile for VIM on Win32, using Cygnus gcc +! # Updated by Dan Sharp. +! # Last Change: 2014 Aug 10 + # + # Also read INSTALLpc.txt! + # +*************** +*** 546,551 **** +--- 547,554 ---- + $(OUTDIR)/blowfish.o \ + $(OUTDIR)/buffer.o \ + $(OUTDIR)/charset.o \ ++ $(OUTDIR)/crypt.o \ ++ $(OUTDIR)/crypt_zip.o \ + $(OUTDIR)/diff.o \ + $(OUTDIR)/digraph.o \ + $(OUTDIR)/edit.o \ +*** ../vim-7.4.400/src/Make_dice.mak 2010-05-18 20:29:00.000000000 +0200 +--- src/Make_dice.mak 2014-08-10 16:21:53.740713479 +0200 +*************** +*** 29,34 **** +--- 29,36 ---- + blowfish.c \ + buffer.c \ + charset.c \ ++ crypt.c \ ++ crypt_zip.c \ + diff.c \ + digraph.c \ + edit.c \ +*************** +*** 75,80 **** +--- 77,84 ---- + OBJ = o/blowfish.o \ + o/buffer.o \ + o/charset.o \ ++ o/crypt.o \ ++ o/crypt_zip.o \ + o/diff.o \ + o/digraph.o \ + o/edit.o \ +*************** +*** 143,148 **** +--- 147,156 ---- + + o/charset.o: charset.c $(SYMS) + ++ o/crypt.o: crypt.c $(SYMS) ++ ++ o/crypt_zip.o: crypt_zip.c $(SYMS) ++ + o/diff.o: diff.c $(SYMS) + + o/digraph.o: digraph.c $(SYMS) +*** ../vim-7.4.400/src/Make_djg.mak 2010-05-18 20:29:18.000000000 +0200 +--- src/Make_djg.mak 2014-08-10 16:22:13.084713340 +0200 +*************** +*** 22,27 **** +--- 22,29 ---- + obj/blowfish.o \ + obj/buffer.o \ + obj/charset.o \ ++ obj/crypt.o \ ++ obj/crypt_zip.o \ + obj/diff.o \ + obj/digraph.o \ + obj/edit.o \ +*** ../vim-7.4.400/src/Make_ivc.mak 2013-02-26 14:18:19.000000000 +0100 +--- src/Make_ivc.mak 2014-08-10 16:22:46.268713102 +0200 +*************** +*** 213,218 **** +--- 213,220 ---- + "$(INTDIR)/blowfish.obj" \ + "$(INTDIR)/buffer.obj" \ + "$(INTDIR)/charset.obj" \ ++ "$(INTDIR)/crypt.obj" \ ++ "$(INTDIR)/crypt_zip.obj" \ + "$(INTDIR)/diff.obj" \ + "$(INTDIR)/digraph.obj" \ + "$(INTDIR)/edit.obj" \ +*************** +*** 339,344 **** +--- 341,354 ---- + # End Source File + # Begin Source File + ++ SOURCE=.\crypt.c ++ # End Source File ++ # Begin Source File ++ ++ SOURCE=.\crypt_zip.c ++ # End Source File ++ # Begin Source File ++ + SOURCE=.\diff.c + # End Source File + # Begin Source File +*** ../vim-7.4.400/src/Make_manx.mak 2010-05-18 20:30:54.000000000 +0200 +--- src/Make_manx.mak 2014-08-10 16:23:43.648712689 +0200 +*************** +*** 37,42 **** +--- 37,44 ---- + SRC = blowfish.c \ + buffer.c \ + charset.c \ ++ crypt.c \ ++ crypt_zip.c \ + diff.c \ + digraph.c \ + edit.c \ +*************** +*** 85,90 **** +--- 87,94 ---- + OBJ = obj/blowfish.o \ + obj/buffer.o \ + obj/charset.o \ ++ obj/crypt.o \ ++ obj/crypt_zip.o \ + obj/diff.o \ + obj/digraph.o \ + obj/edit.o \ +*************** +*** 131,136 **** +--- 135,142 ---- + PRO = proto/blowfish.pro \ + proto/buffer.pro \ + proto/charset.pro \ ++ proto/crypt.pro \ ++ proto/crypt_zip.pro \ + proto/diff.pro \ + proto/digraph.pro \ + proto/edit.pro \ +*************** +*** 227,232 **** +--- 233,244 ---- + obj/charset.o: charset.c + $(CCSYM) $@ charset.c + ++ obj/crypt.o: crypt.c ++ $(CCSYM) $@ crypt.c ++ ++ obj/crypt_zip.o: crypt_zip.c ++ $(CCSYM) $@ crypt_zip.c ++ + obj/diff.o: diff.c + $(CCSYM) $@ diff.c + +*** ../vim-7.4.400/src/Make_ming.mak 2014-08-06 14:52:05.039236174 +0200 +--- src/Make_ming.mak 2014-08-10 16:24:07.064712521 +0200 +*************** +*** 517,522 **** +--- 517,524 ---- + $(OUTDIR)/blowfish.o \ + $(OUTDIR)/buffer.o \ + $(OUTDIR)/charset.o \ ++ $(OUTDIR)/crypt.o \ ++ $(OUTDIR)/crypt_zip.o \ + $(OUTDIR)/diff.o \ + $(OUTDIR)/digraph.o \ + $(OUTDIR)/edit.o \ +*** ../vim-7.4.400/src/Make_morph.mak 2010-05-18 20:31:26.000000000 +0200 +--- src/Make_morph.mak 2014-08-10 16:24:39.900712285 +0200 +*************** +*** 27,32 **** +--- 27,34 ---- + SRC = blowfish.c \ + buffer.c \ + charset.c \ ++ crypt.c \ ++ crypt_zip.c \ + diff.c \ + digraph.c \ + edit.c \ +*** ../vim-7.4.400/src/Make_mvc.mak 2014-08-06 14:52:05.039236174 +0200 +--- src/Make_mvc.mak 2014-08-10 16:25:19.752711999 +0200 +*************** +*** 547,552 **** +--- 547,554 ---- + $(OUTDIR)\blowfish.obj \ + $(OUTDIR)\buffer.obj \ + $(OUTDIR)\charset.obj \ ++ $(OUTDIR)\crypt.obj \ ++ $(OUTDIR)\crypt_zip.obj \ + $(OUTDIR)\diff.obj \ + $(OUTDIR)\digraph.obj \ + $(OUTDIR)\edit.obj \ +*************** +*** 1092,1097 **** +--- 1094,1103 ---- + + $(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL) + ++ $(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL) ++ ++ $(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL) ++ + $(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL) + + $(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL) +*************** +*** 1278,1283 **** +--- 1284,1291 ---- + proto/blowfish.pro \ + proto/buffer.pro \ + proto/charset.pro \ ++ proto/crypt.pro \ ++ proto/crypt_zip.pro \ + proto/diff.pro \ + proto/digraph.pro \ + proto/edit.pro \ +*** ../vim-7.4.400/src/Make_os2.mak 2010-05-18 20:32:32.000000000 +0200 +--- src/Make_os2.mak 2014-08-10 16:25:47.928711796 +0200 +*************** +*** 42,47 **** +--- 42,49 ---- + blowfish.o \ + buffer.o \ + charset.o \ ++ crypt.o \ ++ crypt_zip.o \ + diff.o \ + digraph.o \ + edit.o \ +*************** +*** 117,122 **** +--- 119,126 ---- + blowfish.o: blowfish.c $(INCL) + buffer.o: buffer.c $(INCL) + charset.o: charset.c $(INCL) ++ crypt.o: crypt.c $(INCL) ++ crypt_zip.o: crypt_zip.c $(INCL) + diff.o: diff.c $(INCL) + digraph.o: digraph.c $(INCL) + edit.o: edit.c $(INCL) +*** ../vim-7.4.400/src/Make_sas.mak 2013-05-06 04:06:04.000000000 +0200 +--- src/Make_sas.mak 2014-08-10 16:26:41.536711411 +0200 +*************** +*** 92,97 **** +--- 92,99 ---- + blowfish.c \ + buffer.c \ + charset.c \ ++ crypt.c \ ++ crypt_zip.c \ + diff.c \ + digraph.c \ + edit.c \ +*************** +*** 139,144 **** +--- 141,148 ---- + blowfish.o \ + buffer.o \ + charset.o \ ++ crypt.o \ ++ crypt_zip.o \ + diff.o \ + digraph.o \ + edit.o \ +*************** +*** 186,191 **** +--- 190,197 ---- + proto/blowfish.pro \ + proto/buffer.pro \ + proto/charset.pro \ ++ proto/crypt.pro \ ++ proto/crypt_zip.pro \ + proto/diff.pro \ + proto/digraph.pro \ + proto/edit.pro \ +*************** +*** 290,295 **** +--- 296,305 ---- + proto/buffer.pro: buffer.c + charset.o: charset.c + proto/charset.pro: charset.c ++ crypt.o: crypt.c ++ proto/crypt.pro: crypt.c ++ crypt_zip.o: crypt_zip.c ++ proto/crypt_zip.pro: crypt_zip.c + diff.o: diff.c + proto/diff.pro: diff.c + digraph.o: digraph.c +*** ../vim-7.4.400/src/version.c 2014-08-10 13:46:30.424780490 +0200 +--- src/version.c 2014-08-10 16:27:26.380711088 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 401, + /**/ + +-- +When a fly lands on the ceiling, does it do a half roll or +a half loop? + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/7.4.402 b/7.4.402 new file mode 100644 index 0000000..6fa18af --- /dev/null +++ b/7.4.402 @@ -0,0 +1,103 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.4.402 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.4.402 +Problem: Test 72 crashes under certain conditions. (Kazunobu Kuriyama) +Solution: Clear the whole bufinfo_T early. +Files: src/undo.c + + +*** ../vim-7.4.401/src/undo.c 2014-08-10 13:34:59.064785459 +0200 +--- src/undo.c 2014-08-12 20:08:23.915373819 +0200 +*************** +*** 929,935 **** + undo_flush(bi) + bufinfo_T *bi; + { +! if (bi->bi_used > 0) + { + crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used); + if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1) +--- 929,935 ---- + undo_flush(bi) + bufinfo_T *bi; + { +! if (bi->bi_buffer != NULL && bi->bi_used > 0) + { + crypt_encode_inplace(bi->bi_state, bi->bi_buffer, bi->bi_used); + if (fwrite(bi->bi_buffer, bi->bi_used, (size_t)1, bi->bi_fp) != 1) +*************** +*** 1573,1582 **** + #endif + bufinfo_T bi; + +! #ifdef FEAT_CRYPT +! bi.bi_state = NULL; +! bi.bi_buffer = NULL; +! #endif + + if (name == NULL) + { +--- 1573,1579 ---- + #endif + bufinfo_T bi; + +! vim_memset(&bi, 0, sizeof(bi)); + + if (name == NULL) + { +*************** +*** 1861,1866 **** +--- 1858,1864 ---- + #endif + bufinfo_T bi; + ++ vim_memset(&bi, 0, sizeof(bi)); + if (name == NULL) + { + file_name = u_get_undo_file_name(curbuf->b_ffname, TRUE); +*************** +*** 1905,1914 **** + } + bi.bi_buf = curbuf; + bi.bi_fp = fp; +- #ifdef FEAT_CRYPT +- bi.bi_state = NULL; +- bi.bi_buffer = NULL; +- #endif + + /* + * Read the undo file header. +--- 1903,1908 ---- +*** ../vim-7.4.401/src/version.c 2014-08-10 16:31:47.376709213 +0200 +--- src/version.c 2014-08-12 20:11:13.879372598 +0200 +*************** +*** 743,744 **** +--- 743,746 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 402, + /**/ + +-- +Far back in the mists of ancient time, in the great and glorious days of the +former Galactic Empire, life was wild, rich and largely tax free. +Mighty starships plied their way between exotic suns, seeking adventure and +reward among the furthest reaches of Galactic space. In those days, spirits +were brave, the stakes were high, men were real men, women were real women +and small furry creatures from Alpha Centauri were real small furry creatures +from Alpha Centauri. And all dared to brave unknown terrors, to do mighty +deeds, to boldly split infinitives that no man had split before -- and thus +was the Empire forged. + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" + + /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ +/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ +\\\ an exciting new programming language -- http://www.Zimbu.org /// + \\\ help me help AIDS victims -- http://ICCF-Holland.org /// diff --git a/README.patches b/README.patches index c500615..9147ebb 100644 --- a/README.patches +++ b/README.patches @@ -331,3 +331,97 @@ Individual patches for Vim 7.4: 7820 7.4.305 making 'ttymouse' empty causes problems 2660 7.4.306 getchar(0) does not return Esc 4150 7.4.307 can't build without the +termresponse feature + 1420 7.4.308 ":diffsplit" on empty file cursor is displayed on command line + 2095 7.4.309 increasing size of lower window, upper window jumps to the top + 11194 7.4.310 getpos()/setpos() don't include curswant + 4740 7.4.311 can't use winrestview to only restore part of the view + 6272 7.4.312 cannot know what argument list is being used for a window + 10912 7.4.313 (after 7.4.310) changing return value of getpos() causes error + 5875 7.4.314 completion messages can get in the way of a plugin + 8020 7.4.315 (after 7.4.309) fixes for computation of topline not tested + 1537 7.4.316 warning from 64-bit compiler + 1434 7.4.317 crash when starting gvim, issue 230 + 1748 7.4.318 fg/bg color settings ignored when checking syntax attributes + 1764 7.4.319 crash when putting zero bytes on the clipboard + 4439 7.4.320 possible crash when an BufLeave autocommand deletes the buffer + 2515 7.4.321 can't build with strawberry perl 5.20 + mingw-w64-4.9.0 + 3274 7.4.322 using "msgfmt" is hard coded, cannot use "gmsgfmt" + 2898 7.4.323 substitute() with zero width pattern breaks multi-byte char + 4631 7.4.324 in Ex mode, cyrillic characters are not handled + 2070 7.4.325 incorrect display when starting GUI and setting 'laststatus' + 1384 7.4.326 can't build Tiny version + 4330 7.4.327 when 'verbose' is set may get E724 repeatedly + 2580 7.4.328 selection of inner block is inconsistent + 1945 7.4.329 window not scrolled if moving cursor and go to another window + 32746 7.4.330 using regexp pattern to show a position match can be slow + 1506 7.4.331 relative numbering not updated after a linewise yank + 4079 7.4.332 GTK: ugly gaps when a sign icon doesn't fit exactly + 2036 7.4.333 compiler warning for unused function + 3295 7.4.334 (after 7.4.330) unitialized variables, causing some problems + 3313 7.4.335 no digraph for the new rouble sign + 3536 7.4.336 setting 'history' to a big value causes out-of-memory errors + 1589 7.4.337 can't execute command line if there was an error before + 52480 7.4.338 cannot wrap lines taking indent into account + 2655 7.4.339 local function is available globally + 3140 7.4.340 error from sed about illegal bytes when installing Vim + 6001 7.4.341 sort() doesn't handle numbers well + 1988 7.4.342 clang gives warnings + 1850 7.4.343 matchdelete() does not always update the right lines + 5304 7.4.344 small issues related to matchaddpos() + 2618 7.4.345 (after 7.4.338) indent is not updated when deleting indent + 1963 7.4.346 (after 7.4.338) indent is not updated when changing 'briopt' + 3209 7.4.347 test55 fails on some systems + 1738 7.4.348 Using "J1" in 'cinoptions' may cause too much indent + 2967 7.4.349 avoid redrawing the whole window with highlighted matches + 3909 7.4.350 C-indenting for Javascript fails for a {} block inside parens + 6034 7.4.351 sort() is not stable + 2637 7.4.352 with 'linebreak' a Tab causes a missing line break + 14437 7.4.353 'linebreak' doesn't work with the 'list' option + 1891 7.4.354 compiler warning + 21483 7.4.355 several problems with Javascript indenting + 1247 7.4.356 mercurial does not ignore memfile_test + 1654 7.4.357 after completion some characters are not redrawn + 8040 7.4.358 (after 7.4.351) sort is not always stable + 2942 7.4.359 if 'ttymouse' set to 'uxterm' xterm version is not requested + 2461 7.4.360 pattern with "$" followed by \[vV] is not used as end-of-line + 1487 7.4.361 flickering when filling the preview window for 'omnifunc' + 1608 7.4.362 short length in matchaddpos() highlights until end of the line + 4445 7.4.363 in Windows console typing 0xCE does not work + 2425 7.4.364 no error message when the viminfo file can't be renamed + 3973 7.4.365 crash when using ":botright split" when there isn't much space + 1602 7.4.366 can't run the linebreak test on MS-Windows + 2165 7.4.367 (after 7.4.357) other solution for redrawing after completion + 2581 7.4.368 window sizes not restored properly when closing cmdline window + 2331 7.4.369 using freed memory when exiting while compiled with EXITFREE + 9476 7.4.370 linebreak test fails when encoding is not utf-8 + 1880 7.4.371 with 'linebreak' set control characters displayed wrong + 5628 7.4.372 with 'winminheight' zero current window might be zero height + 2668 7.4.373 compiler warning for unused argument and unused variable + 2461 7.4.374 character after "fb" command sometimes not mapped + 1967 7.4.375 test 63 fails when run with GUI-only Vim + 1877 7.4.376 (after 7.4.367) popup menu flickers too much + 4200 7.4.377 with 'equalalways' set a split may report "no room" + 9720 7.4.378 title of quickfist list is not kept for setqflist(list, 'r') + 1382 7.4.379 accessing freed memory after using setqflist(list, 'r') + 3324 7.4.380 loading python may cause Vim to exit + 1359 7.4.381 u_undo error when backspacing in Insert mode deletes 2 lines + 1876 7.4.382 mapping chars may not work after typing Esc in Insert mode + 1744 7.4.383 bad interaction between preview window and omnifunc + 1522 7.4.384 test 102 fails when compiled with small features + 2559 7.4.385 when building with tiny/small features .mo files build fails + 5536 7.4.386 when splitting a window the changelist position is wrong + 6083 7.4.387 "4gro" replaces one character then executes "ooo" + 2972 7.4.388 with 'linebreak' set and 'list' unset Tab not counted properly + 13930 7.4.389 still sometimes Vim enters Replace mode when starting up + 1411 7.4.390 advancing pointer over end of a string + 3316 7.4.391 no 'cul' highlight with cursor on a line with diff highlight + 2701 7.4.392 not easy to detect type of command line window + 53004 7.4.393 text drawing on newer MS-Windows systems is suboptimal + 1890 7.4.394 (after 7.4.393) with DirectX last italic char is incomplete + 2600 7.4.395 C indent wrong below an if with wrapped () followed by {} + 8881 7.4.396 when 'clipboard' is "unnamed", :g/pat/d is very slow + 5060 7.4.397 matchparen only uses the topmost syntax item + 1533 7.4.398 (after 7.4.393) gcc error for argument of InterlockedIncrement +136105 7.4.399 crypt implementation is messy; blowfish crypt has a weakness + 1848 7.4.400 list of distributed files is incomplete + 8581 7.4.401 (after 7.4.399) new files missing in Makefiles diff --git a/vim.spec b/vim.spec index b393041..116429c 100644 --- a/vim.spec +++ b/vim.spec @@ -1,4 +1,4 @@ -%define patchlevel 307 +%define patchlevel 402 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 %endif @@ -21,7 +21,7 @@ Summary: The VIM editor URL: http://www.vim.org/ Name: vim Version: %{baseversion}.%{patchlevel} -Release: 3%{?dist} +Release: 1%{?dist} License: Vim Group: Applications/Editors Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}.tar.bz2 @@ -355,6 +355,101 @@ Patch304: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.304 Patch305: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.305 Patch306: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.306 Patch307: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.307 +Patch308: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.308 +Patch309: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.309 +Patch310: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.310 +Patch311: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.311 +Patch312: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.312 +Patch313: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.313 +Patch314: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.314 +Patch315: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.315 +Patch316: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.316 +Patch317: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.317 +Patch318: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.318 +Patch319: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.319 +Patch320: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.320 +Patch321: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.321 +Patch322: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.322 +Patch323: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.323 +Patch324: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.324 +Patch325: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.325 +Patch326: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.326 +Patch327: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.327 +Patch328: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.328 +Patch329: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.329 +Patch330: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.330 +Patch331: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.331 +Patch332: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.332 +Patch333: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.333 +Patch334: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.334 +Patch335: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.335 +Patch336: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.336 +Patch337: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.337 +Patch338: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.338 +Patch339: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.339 +Patch340: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.340 +Patch341: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.341 +Patch342: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.342 +Patch343: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.343 +Patch344: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.344 +Patch345: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.345 +Patch346: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.346 +Patch347: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.347 +Patch348: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.348 +Patch349: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.349 +Patch350: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.350 +Patch351: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.351 +Patch352: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.352 +Patch353: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.353 +Patch354: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.354 +Patch355: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.355 +Patch356: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.356 +Patch357: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.357 +Patch358: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.358 +Patch359: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.359 +Patch360: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.360 +Patch361: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.361 +Patch362: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.362 +Patch363: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.363 +Patch364: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.364 +Patch365: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.365 +Patch366: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.366 +Patch367: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.367 +Patch368: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.368 +Patch369: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.369 +Patch370: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.370 +Patch371: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.371 +Patch372: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.372 +Patch373: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.373 +Patch374: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.374 +Patch375: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.375 +Patch376: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.376 +Patch377: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.377 +Patch378: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.378 +Patch379: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.379 +Patch380: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.380 +Patch381: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.381 +Patch382: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.382 +Patch383: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.383 +Patch384: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.384 +Patch385: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.385 +Patch386: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.386 +Patch387: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.387 +Patch388: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.388 +Patch389: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.389 +Patch390: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.390 +Patch391: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.391 +Patch392: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.392 +Patch393: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.393 +Patch394: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.394 +Patch395: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.395 +Patch396: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.396 +Patch397: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.397 +Patch398: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.398 +Patch399: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.399 +Patch400: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.400 +Patch401: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.401 +Patch402: ftp://ftp.vim.org/pub/vim/patches/7.4/7.4.402 Patch3000: vim-7.4-syntax.patch Patch3002: vim-7.1-nowarnings.patch @@ -810,6 +905,101 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch305 -p0 %patch306 -p0 %patch307 -p0 +%patch308 -p0 +%patch309 -p0 +%patch310 -p0 +%patch311 -p0 +%patch312 -p0 +%patch313 -p0 +%patch314 -p0 +%patch315 -p0 +%patch316 -p0 +%patch317 -p0 +%patch318 -p0 +%patch319 -p0 +%patch320 -p0 +%patch321 -p0 +%patch322 -p0 +%patch323 -p0 +%patch324 -p0 +%patch325 -p0 +%patch326 -p0 +%patch327 -p0 +%patch328 -p0 +%patch329 -p0 +%patch330 -p0 +%patch331 -p0 +%patch332 -p0 +%patch333 -p0 +%patch334 -p0 +%patch335 -p0 +%patch336 -p0 +%patch337 -p0 +%patch338 -p0 +%patch339 -p0 +%patch340 -p0 +%patch341 -p0 +%patch342 -p0 +%patch343 -p0 +%patch344 -p0 +%patch345 -p0 +%patch346 -p0 +%patch347 -p0 +%patch348 -p0 +%patch349 -p0 +%patch350 -p0 +%patch351 -p0 +%patch352 -p0 +%patch353 -p0 +%patch354 -p0 +%patch355 -p0 +%patch356 -p0 +%patch357 -p0 +%patch358 -p0 +%patch359 -p0 +%patch360 -p0 +%patch361 -p0 +%patch362 -p0 +%patch363 -p0 +%patch364 -p0 +%patch365 -p0 +%patch366 -p0 +%patch367 -p0 +%patch368 -p0 +%patch369 -p0 +%patch370 -p0 +%patch371 -p0 +%patch372 -p0 +%patch373 -p0 +%patch374 -p0 +%patch375 -p0 +%patch376 -p0 +%patch377 -p0 +%patch378 -p0 +%patch379 -p0 +%patch380 -p0 +%patch381 -p0 +%patch382 -p0 +%patch383 -p0 +%patch384 -p0 +%patch385 -p0 +%patch386 -p0 +%patch387 -p0 +%patch388 -p0 +%patch389 -p0 +%patch390 -p0 +%patch391 -p0 +%patch392 -p0 +%patch393 -p0 +%patch394 -p0 +%patch395 -p0 +%patch396 -p0 +%patch397 -p0 +%patch398 -p0 +%patch399 -p0 +%patch400 -p0 +%patch401 -p0 +%patch402 -p0 # install spell files %if %{withvimspell} @@ -843,6 +1033,26 @@ mv -f Makefile.tmp Makefile export CFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" export CXXFLAGS="%{optflags} -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2" + +perl -pi -e "s/help.txt/vi_help.txt/" os_unix.h ex_cmds.c +perl -pi -e "s/\/etc\/vimrc/\/etc\/virc/" os_unix.h +%configure --prefix=%{_prefix} --with-features=small --with-x=no \ + --enable-multibyte \ + --disable-netbeans \ +%if %{WITH_SELINUX} + --enable-selinux \ +%else + --disable-selinux \ +%endif + --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ + --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ + --with-compiledby="" \ + --with-modified-by="" + +make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} +cp vim minimal-vim +make clean + %configure --with-features=huge \ --enable-pythoninterp=dynamic \ --enable-perlinterp \ @@ -909,24 +1119,6 @@ make clean make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} cp vim enhanced-vim -make clean - -perl -pi -e "s/help.txt/vi_help.txt/" os_unix.h ex_cmds.c -perl -pi -e "s/\/etc\/vimrc/\/etc\/virc/" os_unix.h -%configure --prefix=%{_prefix} --with-features=small --with-x=no \ - --enable-multibyte \ - --disable-netbeans \ -%if %{WITH_SELINUX} - --enable-selinux \ -%else - --disable-selinux \ -%endif - --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ - --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ - --with-compiledby="" \ - --with-modified-by="" - -make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} %install rm -rf %{buildroot} @@ -948,7 +1140,7 @@ cd src make install DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} make installgtutorbin DESTDIR=%{buildroot} BINDIR=%{_bindir} VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} mkdir -p %{buildroot}%{_datadir}/icons/hicolor/{16x16,32x32,48x48,64x64}/apps -install -m755 vim %{buildroot}%{_bindir}/vi +install -m755 minimal-vim %{buildroot}%{_bindir}/vi install -m755 enhanced-vim %{buildroot}%{_bindir}/vim install -m755 gvim %{buildroot}%{_bindir}/gvim install -p -m644 %{SOURCE7} \ @@ -1322,9 +1514,18 @@ rm -rf %{buildroot} %{_datadir}/icons/hicolor/*/apps/* %changelog -* Wed Aug 6 2014 Tom Callaway 2:7.4.307-3 +* Wed Aug 13 2014 Karsten Hopp 7.4.402-1 +- patchlevel 402 + +* Tue Aug 12 2014 Karsten Hopp 7.4.401-1 +- patchlevel 401 + +* Wed Aug 6 2014 Tom Callaway 2:7.4.373-2 - fix license handling +* Tue Jul 22 2014 Karsten Hopp 7.4.373-1 +- patchlevel 373 + * Sun Jun 08 2014 Fedora Release Engineering - 2:7.4.307-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild