From dff23f2f3f5b2fe5ad96d3ff2895f1161f9ab993 Mon Sep 17 00:00:00 2001 From: Yerlan Date: Mon, 17 May 2021 18:44:10 +0200 Subject: [PATCH 1/4] Kotlin: Add highlight for character literals --- rc/filetype/kotlin.kak | 1 + 1 file changed, 1 insertion(+) diff --git a/rc/filetype/kotlin.kak b/rc/filetype/kotlin.kak index b51ef06a..c531dfe8 100644 --- a/rc/filetype/kotlin.kak +++ b/rc/filetype/kotlin.kak @@ -56,6 +56,7 @@ provide-module kotlin %§ add-highlighter shared/kotlin regions add-highlighter shared/kotlin/code default-region group add-highlighter shared/kotlin/string region %{(? Date: Mon, 17 May 2021 20:45:48 +0200 Subject: [PATCH 2/4] Kotlin: string interpolation and character literal Adding highlighting for string interpolation inside double-quoted strings and character literals inside single-quotes. Avoiding string interpolation in the form of $var as this is considered bad practice. --- rc/filetype/kotlin.kak | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rc/filetype/kotlin.kak b/rc/filetype/kotlin.kak index c531dfe8..a57fd1ef 100644 --- a/rc/filetype/kotlin.kak +++ b/rc/filetype/kotlin.kak @@ -55,8 +55,8 @@ provide-module kotlin %§ add-highlighter shared/kotlin regions add-highlighter shared/kotlin/code default-region group -add-highlighter shared/kotlin/string region %{(?](?=[^\(\{]) 1:function 2:function 3:function From c483d655948620e92f29da6e88ca6bb2aad3206d Mon Sep 17 00:00:00 2001 From: Yerlan Date: Mon, 17 May 2021 20:54:29 +0200 Subject: [PATCH 3/4] Simplifying regex As suggested by @krobelus. However, I figured that highlighting characters as strings is not correct as they are more like values. --- rc/filetype/kotlin.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/kotlin.kak b/rc/filetype/kotlin.kak index a57fd1ef..76d3b7dd 100644 --- a/rc/filetype/kotlin.kak +++ b/rc/filetype/kotlin.kak @@ -56,7 +56,7 @@ provide-module kotlin %§ add-highlighter shared/kotlin regions add-highlighter shared/kotlin/code default-region group add-highlighter shared/kotlin/string region %{(? Date: Mon, 17 May 2021 21:15:30 +0200 Subject: [PATCH 4/4] Java: add highlighting for char literal --- rc/filetype/java.kak | 1 + 1 file changed, 1 insertion(+) diff --git a/rc/filetype/java.kak b/rc/filetype/java.kak index 7fe91bbc..1c187fc5 100644 --- a/rc/filetype/java.kak +++ b/rc/filetype/java.kak @@ -28,6 +28,7 @@ provide-module java %§ add-highlighter shared/java regions add-highlighter shared/java/code default-region group add-highlighter shared/java/string region %{(?