fix broken upstream patch

This commit is contained in:
Karsten Hopp 2013-01-28 14:02:43 +01:00
parent a373b6ca89
commit be6f54b13e

304
7.3.780
View File

@ -1,193 +1,111 @@
To: vim_dev@googlegroups.com diff -up vim73/runtime/doc/eval.txt.780 vim73/runtime/doc/eval.txt
Subject: Patch 7.3.780 --- vim73/runtime/doc/eval.txt.780 2013-01-28 13:41:04.000000000 +0100
Fcc: outbox +++ runtime/doc/eval.txt 2013-01-28 13:44:58.000000000 +0100
From: Bram Moolenaar <Bram@moolenaar.net> @@ -1705,7 +1705,7 @@ call( {func}, {arglist} [, {dict}])
Mime-Version: 1.0 any call {func} with arguments {arglist}
Content-Type: text/plain; charset=UTF-8 ceil( {expr}) Float round {expr} up
Content-Transfer-Encoding: 8bit changenr() Number current change number
------------ -char2nr( {expr}) Number ASCII value of first char in {expr}
+char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
Patch 7.3.780 cindent( {lnum}) Number C indent for line {lnum}
Problem: char2nr() and nr2char() always use 'encoding'. clearmatches() none clear all matches
Solution: Add argument to use utf-8 characters. (Yasuhiro Matsumoto) col( {expr}) Number column nr of cursor or mark
Files: runtime/doc/eval.txt, src/eval.c @@ -1862,7 +1862,7 @@ mkdir( {name} [, {path} [, {prot}]])
mode( [expr]) String current editing mode
mzeval( {expr}) any evaluate |MzScheme| expression
*** ../vim-7.3.779/runtime/doc/eval.txt 2012-12-05 16:10:21.000000000 +0100 nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
--- runtime/doc/eval.txt 2013-01-23 17:00:52.000000000 +0100 -nr2char( {expr}) String single char with ASCII value {expr}
*************** +nr2char( {expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
*** 1705,1711 **** or( {expr}, {expr}) Number bitwise OR
any call {func} with arguments {arglist} pathshorten( {expr}) String shorten directory names in a path
ceil( {expr}) Float round {expr} up pow( {x}, {y}) Float {x} to the power of {y}
changenr() Number current change number @@ -2282,13 +2282,17 @@ changenr() *changenr()*
! char2nr( {expr}) Number ASCII value of first char in {expr} redo it is the number of the redone change. After undo it is
cindent( {lnum}) Number C indent for line {lnum} one less than the number of the undone change.
clearmatches() none clear all matches
col( {expr}) Number column nr of cursor or mark -char2nr({expr}) *char2nr()*
--- 1716,1722 ---- +char2nr({expr}[, {utf8}]) **char2nr()*
any call {func} with arguments {arglist} Return number value of the first char in {expr}. Examples: >
ceil( {expr}) Float round {expr} up char2nr(" ") returns 32
changenr() Number current change number char2nr("ABC") returns 65
! char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr} -< The current 'encoding' is used. Example for "utf-8": >
cindent( {lnum}) Number C indent for line {lnum} +< When {utf8} is omitted or zero, the current 'encoding' is
clearmatches() none clear all matches +used.
col( {expr}) Number column nr of cursor or mark + Example for "utf-8": >
*************** char2nr("á") returns 225
*** 1862,1868 **** char2nr("á"[0]) returns 195
mode( [expr]) String current editing mode + With {utf8} set to 1, always treat as utf-8 characters.
mzeval( {expr}) any evaluate |MzScheme| expression + A combining character is a separate character.
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} < |nr2char()| does the opposite.
! nr2char( {expr}) String single char with ASCII value {expr}
or( {expr}, {expr}) Number bitwise OR cindent({lnum}) *cindent()*
pathshorten( {expr}) String shorten directory names in a path diff -up vim73/src/eval.c.780 vim73/src/eval.c
pow( {x}, {y}) Float {x} to the power of {y} --- vim73/src/eval.c.780 2013-01-28 13:41:04.000000000 +0100
--- 1873,1879 ---- +++ src/eval.c 2013-01-28 13:41:04.000000000 +0100
mode( [expr]) String current editing mode @@ -7854,7 +7854,7 @@ static struct fst
mzeval( {expr}) any evaluate |MzScheme| expression {"ceil", 1, 1, f_ceil},
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum} #endif
! nr2char( {expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr} {"changenr", 0, 0, f_changenr},
or( {expr}, {expr}) Number bitwise OR - {"char2nr", 1, 1, f_char2nr},
pathshorten( {expr}) String shorten directory names in a path + {"char2nr", 1, 2, f_char2nr},
pow( {x}, {y}) Float {x} to the power of {y} {"cindent", 1, 1, f_cindent},
*************** {"clearmatches", 0, 0, f_clearmatches},
*** 2282,2295 **** {"col", 1, 1, f_col},
redo it is the number of the redone change. After undo it is @@ -8003,7 +8003,7 @@ static struct fst
one less than the number of the undone change. {"mzeval", 1, 1, f_mzeval},
#endif
! char2nr({expr}) *char2nr()* {"nextnonblank", 1, 1, f_nextnonblank},
Return number value of the first char in {expr}. Examples: > - {"nr2char", 1, 1, f_nr2char},
char2nr(" ") returns 32 + {"nr2char", 1, 2, f_nr2char},
char2nr("ABC") returns 65 {"or", 2, 2, f_or},
! < The current 'encoding' is used. Example for "utf-8": > {"pathshorten", 1, 1, f_pathshorten},
char2nr("á") returns 225 #ifdef FEAT_FLOAT
char2nr("á"[0]) returns 195 @@ -9303,7 +9303,17 @@ f_char2nr(argvars, rettv)
! < |nr2char()| does the opposite. {
#ifdef FEAT_MBYTE
cindent({lnum}) *cindent()* if (has_mbyte)
Get the amount of indent for line {lnum} according the C - rettv->vval.v_number = (*mb_ptr2char)(get_tv_string(&argvars[0]));
--- 2294,2310 ---- + {
redo it is the number of the redone change. After undo it is + int utf8 = 0;
one less than the number of the undone change. +
+ if (argvars[1].v_type != VAR_UNKNOWN)
! char2nr({expr}[, {utf8}]) *char2nr()* + utf8 = get_tv_number_chk(&argvars[1], NULL);
Return number value of the first char in {expr}. Examples: > +
char2nr(" ") returns 32 + if (utf8)
char2nr("ABC") returns 65 + rettv->vval.v_number = (*utf_ptr2char)(get_tv_string(&argvars[0]));
! < When {utf8} is omitted or zero, the current 'encoding' is used. + else
! Example for "utf-8": > + rettv->vval.v_number = (*mb_ptr2char)(get_tv_string(&argvars[0]));
char2nr("á") returns 225 + }
char2nr("á"[0]) returns 195 else
! < With {utf8} set to 1, always treat as utf-8 characters. #endif
! A combining character is a separate character. rettv->vval.v_number = get_tv_string(&argvars[0])[0];
! |nr2char()| does the opposite. @@ -14360,7 +14370,16 @@ f_nr2char(argvars, rettv)
cindent({lnum}) *cindent()* #ifdef FEAT_MBYTE
Get the amount of indent for line {lnum} according the C if (has_mbyte)
*** ../vim-7.3.779/src/eval.c 2013-01-23 15:53:08.000000000 +0100 - buf[(*mb_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL;
--- src/eval.c 2013-01-23 16:57:48.000000000 +0100 + {
*************** + int utf8 = 0;
*** 7854,7860 **** +
{"ceil", 1, 1, f_ceil}, + if (argvars[1].v_type != VAR_UNKNOWN)
#endif + utf8 = get_tv_number_chk(&argvars[1], NULL);
{"changenr", 0, 0, f_changenr}, + if (utf8)
! {"char2nr", 1, 1, f_char2nr}, + buf[(*utf_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL;
{"cindent", 1, 1, f_cindent}, + else
{"clearmatches", 0, 0, f_clearmatches}, + buf[(*mb_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL;
{"col", 1, 1, f_col}, + }
--- 7854,7860 ---- else
{"ceil", 1, 1, f_ceil}, #endif
#endif {
{"changenr", 0, 0, f_changenr}, diff -up vim73/src/version.c.780 vim73/src/version.c
! {"char2nr", 1, 2, f_char2nr}, --- vim73/src/version.c.780 2013-01-28 13:41:04.000000000 +0100
{"cindent", 1, 1, f_cindent}, +++ src/version.c 2013-01-28 13:41:04.000000000 +0100
{"clearmatches", 0, 0, f_clearmatches}, @@ -726,6 +726,8 @@ static char *(features[]) =
{"col", 1, 1, f_col}, static int included_patches[] =
*************** { /* Add new patch number below this line */
*** 8003,8009 **** /**/
{"mzeval", 1, 1, f_mzeval}, + 780,
#endif +/**/
{"nextnonblank", 1, 1, f_nextnonblank}, 779,
! {"nr2char", 1, 1, f_nr2char}, /**/
{"or", 2, 2, f_or}, 778,
{"pathshorten", 1, 1, f_pathshorten},
#ifdef FEAT_FLOAT
--- 8003,8009 ----
{"mzeval", 1, 1, f_mzeval},
#endif
{"nextnonblank", 1, 1, f_nextnonblank},
! {"nr2char", 1, 2, f_nr2char},
{"or", 2, 2, f_or},
{"pathshorten", 1, 1, f_pathshorten},
#ifdef FEAT_FLOAT
***************
*** 9303,9309 ****
{
#ifdef FEAT_MBYTE
if (has_mbyte)
! rettv->vval.v_number = (*mb_ptr2char)(get_tv_string(&argvars[0]));
else
#endif
rettv->vval.v_number = get_tv_string(&argvars[0])[0];
--- 9303,9319 ----
{
#ifdef FEAT_MBYTE
if (has_mbyte)
! {
! int utf8 = 0;
!
! if (argvars[1].v_type != VAR_UNKNOWN)
! utf8 = get_tv_number_chk(&argvars[1], NULL);
!
! if (utf8)
! rettv->vval.v_number = (*utf_ptr2char)(get_tv_string(&argvars[0]));
! else
! rettv->vval.v_number = (*mb_ptr2char)(get_tv_string(&argvars[0]));
! }
else
#endif
rettv->vval.v_number = get_tv_string(&argvars[0])[0];
***************
*** 14360,14366 ****
#ifdef FEAT_MBYTE
if (has_mbyte)
! buf[(*mb_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL;
else
#endif
{
--- 14370,14385 ----
#ifdef FEAT_MBYTE
if (has_mbyte)
! {
! int utf8 = 0;
!
! if (argvars[1].v_type != VAR_UNKNOWN)
! utf8 = get_tv_number_chk(&argvars[1], NULL);
! if (utf8)
! buf[(*utf_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL;
! else
! buf[(*mb_char2bytes)((int)get_tv_number(&argvars[0]), buf)] = NUL;
! }
else
#endif
{
*** ../vim-7.3.779/src/version.c 2013-01-23 16:43:07.000000000 +0100
--- src/version.c 2013-01-23 17:06:36.000000000 +0100
***************
*** 727,728 ****
--- 727,730 ----
{ /* Add new patch number below this line */
+ /**/
+ 780,
/**/
--
A real patriot is the fellow who gets a parking ticket and rejoices
that the system works.
/// 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 ///