Patch 7.3.873
Problem: Cannot easily use :s to make title case.
Solution: Have "\L\u" result in title case. (James McCoy)
Files: src/regexp.c, src/testdir/test79.in, src/testdir/test79.ok,
src/testdir/test80.in, src/testdir/test80.ok
*** ../vim-7.3.872/src/regexp.c 2013-02-26 18:45:49.000000000 +0100
--- src/regexp.c 2013-03-19 17:35:39.000000000 +0100
***************
*** 7185,7191 ****
int c;
int cc;
int no = -1;
! fptr_T func = (fptr_T)NULL;
linenr_T clnum = 0; /* init for GCC */
int len = 0; /* init for GCC */
#ifdef FEAT_EVAL
--- 7185,7192 ----
int c;
int cc;
int no = -1;
! fptr_T func_all = (fptr_T)NULL;
! fptr_T func_one = (fptr_T)NULL;
linenr_T clnum = 0; /* init for GCC */
int len = 0; /* init for GCC */
#ifdef FEAT_EVAL
***************
*** 7318,7333 ****
{
switch (*src++)
{
! case 'u': func = (fptr_T)do_upper;
continue;
! case 'U': func = (fptr_T)do_Upper;
continue;
! case 'l': func = (fptr_T)do_lower;
continue;
! case 'L': func = (fptr_T)do_Lower;
continue;
case 'e':
! case 'E': func = (fptr_T)NULL;
continue;
}
}
--- 7319,7334 ----
{
switch (*src++)
{
! case 'u': func_one = (fptr_T)do_upper;
continue;
! case 'U': func_all = (fptr_T)do_Upper;
continue;
! case 'l': func_one = (fptr_T)do_lower;
continue;
! case 'L': func_all = (fptr_T)do_Lower;
continue;
case 'e':
! case 'E': func_one = func_all = (fptr_T)NULL;
continue;
}
}
***************
*** 7380,7390 ****
#endif
/* Write to buffer, if copy is set. */
! if (func == (fptr_T)NULL) /* just copy */
! cc = c;
! else
/* Turbo C complains without the typecast */
! func = (fptr_T)(func(&cc, c));
#ifdef FEAT_MBYTE
if (has_mbyte)
--- 7381,7394 ----
#endif
/* Write to buffer, if copy is set. */
! if (func_one != (fptr_T)NULL)
/* Turbo C complains without the typecast */
! func_one = (fptr_T)(func_one(&cc, c));
! else if (func_all != (fptr_T)NULL)
! /* Turbo C complains without the typecast */
! func_all = (fptr_T)(func_all(&cc, c));
! else /* just copy */
! cc = c;
#ifdef FEAT_MBYTE
if (has_mbyte)
***************
*** 7495,7505 ****
#endif
c = *s;
! if (func == (fptr_T)NULL) /* just copy */
! cc = c;
! else
/* Turbo C complains without the typecast */
! func = (fptr_T)(func(&cc, c));
#ifdef FEAT_MBYTE
if (has_mbyte)
--- 7499,7512 ----
#endif
c = *s;
! if (func_one != (fptr_T)NULL)
/* Turbo C complains without the typecast */
! func_one = (fptr_T)(func_one(&cc, c));
! else if (func_all != (fptr_T)NULL)
! /* Turbo C complains without the typecast */
! func_all = (fptr_T)(func_all(&cc, c));
! else /* just copy */
! cc = c;
#ifdef FEAT_MBYTE
if (has_mbyte)
*** ../vim-7.3.872/src/testdir/test79.in 2013-01-30 18:21:48.000000000
+0100
--- src/testdir/test79.in 2013-03-19 17:30:51.000000000 +0100
***************
*** 32,37 ****
--- 32,39 ----
j:s/R/\\/
j:s/S/\c/
j:s/T/ scs
t
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.