mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
updated for version 7.3.550
Problem: With "j" in 'formatoptions' a list leader is not removed. (Gary Johnson) Solution: Don't ignore the start of a three part comment. (Lech Lorens)
This commit is contained in:
@@ -4250,15 +4250,13 @@ skip_comment(line, process, include_space, is_comment)
|
|||||||
return line;
|
return line;
|
||||||
|
|
||||||
/* Find:
|
/* Find:
|
||||||
* - COM_START,
|
|
||||||
* - COM_END,
|
* - COM_END,
|
||||||
* - colon,
|
* - colon,
|
||||||
* whichever comes first.
|
* whichever comes first.
|
||||||
*/
|
*/
|
||||||
while (*comment_flags)
|
while (*comment_flags)
|
||||||
{
|
{
|
||||||
if (*comment_flags == COM_START
|
if (*comment_flags == COM_END
|
||||||
|| *comment_flags == COM_END
|
|
||||||
|| *comment_flags == ':')
|
|| *comment_flags == ':')
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
@@ -4267,9 +4265,8 @@ skip_comment(line, process, include_space, is_comment)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If we found a colon, it means that we are not processing a line
|
/* If we found a colon, it means that we are not processing a line
|
||||||
* starting with an opening or a closing part of a three-part
|
* starting with a closing part of a three-part comment. That's good,
|
||||||
* comment. That's good, because we don't want to remove those as
|
* because we don't want to remove those as this would be annoying.
|
||||||
* this would be annoying.
|
|
||||||
*/
|
*/
|
||||||
if (*comment_flags == ':' || *comment_flags == NUL)
|
if (*comment_flags == ':' || *comment_flags == NUL)
|
||||||
line += lead_len;
|
line += lead_len;
|
||||||
|
@@ -103,12 +103,15 @@ if (condition) // Remove the next comment leader!
|
|||||||
|
|
||||||
STARTTEST
|
STARTTEST
|
||||||
/^{/+1
|
/^{/+1
|
||||||
:set comments=s1:/*,mb:*,ex:*/,://
|
:set comments=sO:*\ -,mO:*\ \ ,exO:*/
|
||||||
|
:set comments+=s1:/*,mb:*,ex:*/,://
|
||||||
:set comments+=s1:>#,mb:#,ex:#<,:<
|
:set comments+=s1:>#,mb:#,ex:#<,:<
|
||||||
:set cpoptions-=j joinspaces fo=j
|
:set cpoptions-=j joinspaces fo=j
|
||||||
:set backspace=eol,start
|
:set backspace=eol,start
|
||||||
:.,+3join
|
:.,+3join
|
||||||
j4J
|
j4J
|
||||||
|
:.,+8join
|
||||||
|
j9J
|
||||||
:.,+2join
|
:.,+2join
|
||||||
j3J
|
j3J
|
||||||
:.,+2join
|
:.,+2join
|
||||||
@@ -132,6 +135,24 @@ ENDTEST
|
|||||||
/*
|
/*
|
||||||
* Make sure the previous comment leader is not removed.
|
* Make sure the previous comment leader is not removed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* List:
|
||||||
|
* - item1
|
||||||
|
* foo bar baz
|
||||||
|
* foo bar baz
|
||||||
|
* - item2
|
||||||
|
* foo bar baz
|
||||||
|
* foo bar baz
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* List:
|
||||||
|
* - item1
|
||||||
|
* foo bar baz
|
||||||
|
* foo bar baz
|
||||||
|
* - item2
|
||||||
|
* foo bar baz
|
||||||
|
* foo bar baz
|
||||||
|
*/
|
||||||
|
|
||||||
// Should the next comment leader be left alone?
|
// Should the next comment leader be left alone?
|
||||||
// Yes.
|
// Yes.
|
||||||
|
@@ -66,6 +66,8 @@ if (condition) // Remove the next comment leader! OK, I will.
|
|||||||
{
|
{
|
||||||
/* Make sure the previous comment leader is not removed. */
|
/* Make sure the previous comment leader is not removed. */
|
||||||
/* Make sure the previous comment leader is not removed. */
|
/* Make sure the previous comment leader is not removed. */
|
||||||
|
/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
|
||||||
|
/* List: item1 foo bar baz foo bar baz item2 foo bar baz foo bar baz */
|
||||||
// Should the next comment leader be left alone? Yes.
|
// Should the next comment leader be left alone? Yes.
|
||||||
// Should the next comment leader be left alone? Yes.
|
// Should the next comment leader be left alone? Yes.
|
||||||
/* Here the comment leader should be left intact. */ // And so should this one.
|
/* Here the comment leader should be left intact. */ // And so should this one.
|
||||||
|
@@ -714,6 +714,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
550,
|
||||||
/**/
|
/**/
|
||||||
549,
|
549,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user