Skip to content

Commit 7b7fe0a

Browse files
committed
Merge branch 'lo/userdiff-gitconfig'
* lo/userdiff-gitconfig: userdiff: add builtin driver for INI files
2 parents d5baf63 + 4338005 commit 7b7fe0a

File tree

6 files changed

+42
-0
lines changed

6 files changed

+42
-0
lines changed

t/t4018/ini-section

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[RIGHT]
2+
# comment
3+
; comment
4+
name = value
5+
ChangeMe

t/t4018/ini-section-noindent

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[RIGHT]
2+
# comment
3+
; comment
4+
name = value
5+
ChangeMe

t/t4018/ini-section-same-line

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[RIGHT] name = value
2+
# comment
3+
; comment
4+
ChangeMe

t/t4018/ini-subsection

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[LEFT]
2+
3+
[LEFT "CENTER"]
4+
# comment
5+
; comment
6+
name = value
7+
8+
[LEFT "RIGHT"]
9+
# comment
10+
; comment
11+
name = value
12+
ChangeMe

t/t4018/ini-subsection-noindent

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[LEFT]
2+
3+
[LEFT "CENTER"]
4+
# comment
5+
; comment
6+
name = value
7+
8+
[LEFT "RIGHT"]
9+
# comment
10+
; comment
11+
name = value
12+
ChangeMe

userdiff.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ PATTERNS("html",
211211
"^[ \t]*(<[Hh][1-6]([ \t].*)?>.*)$",
212212
/* -- */
213213
"[^<>= \t]+"),
214+
PATTERNS("ini",
215+
"^[ \t]*\\[[^]]+\\]",
216+
/* -- */
217+
"[^ \t]+"),
214218
PATTERNS("java",
215219
"!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
216220
/* Class, enum, interface, and record declarations */

0 commit comments

Comments
 (0)