Merge branch 'wd/userdiff-css'

Update the funcname definition to support css files.

* wd/userdiff-css:
  userdiff: add built-in pattern for CSS
This commit is contained in:
Junio C Hamano 2016-06-20 11:01:02 -07:00
commit 8699b74ae1
15 changed files with 90 additions and 0 deletions

View File

@ -525,6 +525,8 @@ patterns are available:
- `csharp` suitable for source code in the C# language.
- `css` suitable for cascading style sheets.
- `fortran` suitable for source code in the Fortran language.
- `fountain` suitable for Fountain documents.

View File

@ -30,6 +30,7 @@ diffpatterns="
bibtex
cpp
csharp
css
fortran
fountain
html

View File

@ -0,0 +1,5 @@
RIGHT label.control-label
{
margin-top: 10px!important;
border : 10px ChangeMe #C6C6C6;
}

4
t/t4018/css-colon-eol Normal file
View File

@ -0,0 +1,4 @@
RIGHT h1 {
color:
ChangeMe;
}

View File

@ -0,0 +1,5 @@
RIGHT a:hover {
margin-top:
10px!important;
border : 10px ChangeMe #C6C6C6;
}

4
t/t4018/css-common Normal file
View File

@ -0,0 +1,4 @@
RIGHT label.control-label {
margin-top: 10px!important;
border : 10px ChangeMe #C6C6C6;
}

View File

@ -0,0 +1,6 @@
p.header,
label.control-label,
div ul#RIGHT {
margin-top: 10px!important;
border : 10px ChangeMe #C6C6C6;
}

View File

@ -0,0 +1,5 @@
RIGHT, label.control-label {
margin-top: 10px!important;
padding: 0;
border : 10px ChangeMe #C6C6C6;
}

View File

@ -0,0 +1,4 @@
label.control, div ul#RIGHT {
margin-top: 10px!important;
border : 10px ChangeMe #C6C6C6;
}

View File

@ -0,0 +1,5 @@
RIGHT label.control-label {
margin:10px;
padding:10px;
border : 10px ChangeMe #C6C6C6;
}

View File

@ -302,6 +302,7 @@ test_language_driver ada
test_language_driver bibtex
test_language_driver cpp
test_language_driver csharp
test_language_driver css
test_language_driver fortran
test_language_driver html
test_language_driver java

16
t/t4034/css/expect Normal file
View File

@ -0,0 +1,16 @@
<BOLD>diff --git a/pre b/post<RESET>
<BOLD>index b8ae0bb..fe500b7 100644<RESET>
<BOLD>--- a/pre<RESET>
<BOLD>+++ b/post<RESET>
<CYAN>@@ -1,10 +1,10 @@<RESET>
.<RED>class-form<RESET><GREEN>other-form<RESET> label.control-label {
margin-top: <RED>10<RESET><GREEN>15<RESET>px!important;
border : 10px <RED>dashed<RESET><GREEN>dotted<RESET> #C6C6C6;
}<RESET>
<RED>#CCCCCC<RESET><GREEN>#CCCCCB<RESET>
10em<RESET>
<RED>padding-bottom<RESET><GREEN>margin-left<RESET>
150<RED>px<RESET><GREEN>em<RESET>
10px
<RED>!important<RESET>
<RED>div<RESET><GREEN>li<RESET>.class#id

10
t/t4034/css/post Normal file
View File

@ -0,0 +1,10 @@
.other-form label.control-label {
margin-top: 15px!important;
border : 10px dotted #C6C6C6;
}
#CCCCCB
10em
margin-left
150em
10px
li.class#id

10
t/t4034/css/pre Normal file
View File

@ -0,0 +1,10 @@
.class-form label.control-label {
margin-top: 10px!important;
border : 10px dashed #C6C6C6;
}
#CCCCCC
10em
padding-bottom
150px
10px!important
div.class#id

View File

@ -148,6 +148,18 @@ PATTERNS("csharp",
"[a-zA-Z_][a-zA-Z0-9_]*"
"|[-+0-9.e]+[fFlL]?|0[xXbB]?[0-9a-fA-F]+[lL]?"
"|[-+*/<>%&^|=!]=|--|\\+\\+|<<=?|>>=?|&&|\\|\\||::|->"),
IPATTERN("css",
"![:;][[:space:]]*$\n"
"^[_a-z0-9].*$",
/* -- */
/*
* This regex comes from W3C CSS specs. Should theoretically also
* allow ISO 10646 characters U+00A0 and higher,
* but they are not handled in this regex.
*/
"-?[_a-zA-Z][-_a-zA-Z0-9]*" /* identifiers */
"|-?[0-9]+|\\#[0-9a-fA-F]+" /* numbers */
),
{ "default", NULL, -1, { NULL, 0 } },
};
#undef PATTERNS