aboutsummaryrefslogtreecommitdiffstats
path: root/userdiff.c
diff options
context:
space:
mode:
authorRodrigo Carvalho <rodrigorsdc@gmail.com>2025-05-29 19:16:41 -0300
committerJunio C Hamano <gitster@pobox.com>2025-05-29 15:29:37 -0700
commit1d9526df8d6ebe69efc54ade9d4ed2317342fdba (patch)
tree85d83e081ef82348cc7eb1db2cb307153dd8c223 /userdiff.c
parentMerge branch 'master' of https://github.com/j6t/git-gui (diff)
downloadgit-1d9526df8d6ebe69efc54ade9d4ed2317342fdba.tar.gz
git-1d9526df8d6ebe69efc54ade9d4ed2317342fdba.zip
userdiff: add support for R programming language
Add userdiff patterns to support R programming language. Also, add three userdiff tests for R programming language files. These files define simple function and nested function, with and without indentation. Signed-off-by: Rodrigo Carvalho <rodrigorsdc@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'userdiff.c')
-rw-r--r--userdiff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/userdiff.c b/userdiff.c
index 05776ccd10..fe710a68bf 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -327,6 +327,10 @@ PATTERNS("python",
"|[-+0-9.e]+[jJlL]?|0[xX]?[0-9a-fA-F]+[lL]?"
"|[-+*/<>%&^|=!]=|//=?|<<=?|>>=?|\\*\\*=?"),
/* -- */
+PATTERNS("r",
+ "^[ \t]*([a-zA-z][a-zA-Z0-9_.]*[ \t]*(<-|=)[ \t]*function.*)$",
+ /* -- */
+ "[^ \t]+"),
PATTERNS("ruby",
"^[ \t]*((class|module|def)[ \t].*)$",
/* -- */