From 4d91437bcfd33170e4c1afc87d1cc41f890079f6 Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Thu, 3 Oct 2019 12:00:53 -0400 Subject: [PATCH 1/2] Add basic Kotlin support --- resources/kotlin.ascii | 21 +++++++++++++++++++++ src/main.rs | 6 ++++++ 2 files changed, 27 insertions(+) create mode 100644 resources/kotlin.ascii diff --git a/resources/kotlin.ascii b/resources/kotlin.ascii new file mode 100644 index 000000000..ded98d2cb --- /dev/null +++ b/resources/kotlin.ascii @@ -0,0 +1,21 @@ + +KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKOTL +KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKO +KOTLINKOTLINKOTLINKOTLINKOTLINKOTLIN +KOTLINKOTLINKOTLINKOTLINKOTLINKOTL +KOTLINKOTLINKOTLINKOTLINKOTLINKO +KOTLINKOTLINKOTLINKOTLINKOTLIN +KOTLINKOTLINKOTLINKOTLINKOTL +KOTLINKOTLINKOTLINKOTLINKO +KOTLINKOTLINKOTLINKOTLIN +KOTLINKOTLINKOTLINKOTL +KOTLINKOTLINKOTLINKOTL +KOTLINKOTLINKOTLINKOTLIN +KOTLINKOTLINKOTLINKOTLINKO +KOTLINKOTLINKOTLINKOTLINKOTL +KOTLINKOTLINKOTLINKOTLINKOTLIN +KOTLINKOTLINKOTLINKOTLINKOTLINKO +KOTLINKOTLINKOTLINKOTLINKOTLINKOTL +KOTLINKOTLINKOTLINKOTLINKOTLINKOTLIN +KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKO +KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKOTL diff --git a/src/main.rs b/src/main.rs index d481a1855..ab649b027 100644 --- a/src/main.rs +++ b/src/main.rs @@ -271,6 +271,7 @@ enum Language { Go, Haskell, Java, + Kotlin, Lisp, Lua, Nim, @@ -300,6 +301,7 @@ impl fmt::Display for Language { Language::Go => write!(f, "Go"), Language::Haskell => write!(f, "Haskell"), Language::Java => write!(f, "Java"), + Language::Kotlin => write!(f, "Kotlin"), Language::Lisp => write!(f, "Lisp"), Language::Lua => write!(f, "Lua"), Language::Nim => write!(f, "Nim"), @@ -637,6 +639,7 @@ impl From for Language { tokei::LanguageType::Go => Language::Go, tokei::LanguageType::Haskell => Language::Haskell, tokei::LanguageType::Java => Language::Java, + tokei::LanguageType::Kotlin => Language::Kotlin, tokei::LanguageType::Lisp => Language::Lisp, tokei::LanguageType::Lua => Language::Lua, tokei::LanguageType::Nim => Language::Nim, @@ -668,6 +671,7 @@ fn get_all_language_types() -> Vec { tokei::LanguageType::Go, tokei::LanguageType::Haskell, tokei::LanguageType::Java, + tokei::LanguageType::Kotlin, tokei::LanguageType::Lisp, tokei::LanguageType::Lua, tokei::LanguageType::Nim, @@ -698,6 +702,7 @@ impl Info { Language::Go => include_str!("../resources/go.ascii"), Language::Haskell => include_str!("../resources/haskell.ascii"), Language::Java => include_str!("../resources/java.ascii"), + Language::Kotlin => include_str!("../resources/kotlin.ascii"), Language::Lisp => include_str!("../resources/lisp.ascii"), Language::Lua => include_str!("../resources/lua.ascii"), Language::Nim => include_str!("../resources/nim.ascii"), @@ -728,6 +733,7 @@ impl Info { Language::Go => vec![Color::White], Language::Haskell => vec![Color::BrightBlue, Color::BrightMagenta, Color::Blue], Language::Java => vec![Color::BrightBlue, Color::Red], + Language::Kotlin => vec![Color::Blue], Language::Lisp => vec![Color::Yellow], Language::Lua => vec![Color::Blue], Language::Nim => vec![Color::Yellow, Color::BrightWhite], From aea155e8dcd61df5b95c5d54d2add9c5e60e714b Mon Sep 17 00:00:00 2001 From: Spenser Black Date: Thu, 3 Oct 2019 12:25:55 -0400 Subject: [PATCH 2/2] Add colors for Kotlin --- resources/kotlin.ascii | 40 ++++++++++++++++++++-------------------- src/main.rs | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/resources/kotlin.ascii b/resources/kotlin.ascii index ded98d2cb..abf6dcdae 100644 --- a/resources/kotlin.ascii +++ b/resources/kotlin.ascii @@ -1,21 +1,21 @@ -KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKOTL -KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKO -KOTLINKOTLINKOTLINKOTLINKOTLINKOTLIN -KOTLINKOTLINKOTLINKOTLINKOTLINKOTL -KOTLINKOTLINKOTLINKOTLINKOTLINKO -KOTLINKOTLINKOTLINKOTLINKOTLIN -KOTLINKOTLINKOTLINKOTLINKOTL -KOTLINKOTLINKOTLINKOTLINKO -KOTLINKOTLINKOTLINKOTLIN -KOTLINKOTLINKOTLINKOTL -KOTLINKOTLINKOTLINKOTL -KOTLINKOTLINKOTLINKOTLIN -KOTLINKOTLINKOTLINKOTLINKO -KOTLINKOTLINKOTLINKOTLINKOTL -KOTLINKOTLINKOTLINKOTLINKOTLIN -KOTLINKOTLINKOTLINKOTLINKOTLINKO -KOTLINKOTLINKOTLINKOTLINKOTLINKOTL -KOTLINKOTLINKOTLINKOTLINKOTLINKOTLIN -KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKO -KOTLINKOTLINKOTLINKOTLINKOTLINKOTLINKOTL +{0}KOTLIN{2}KOTLINKOTLINKO{1}TLINKOTLINKOTLINKOTL +{0}KOTLINKO{2}TLINKOTLIN{1}KOTLINKOTLINKOTLINKO +{0}KOTLINKOTL{2}INKOTL{1}INKOTLINKOTLINKOTLIN +{0}KOTLINKOTLIN{2}KO{1}TLINKOTLINKOTLINKOTL +{0}KOTLINKOTLIN{1}KOTLINKOTLINKOTLINKO +{0}KOTLINKOTL{1}INKOTLINKOTLINKOTLIN +{0}KOTLINKO{1}TLINKOTLINKOTLINKOTL +{0}KOTLIN{1}KOTLINKOTLINKOTLINKO +{0}KOTL{1}INKOTLINKOTLINKOTLIN +{0}KO{1}TLINKOTLINKOTLINKOTL +{1}KOTLINKOTLINKOTLINKO{2}TL +{2}KO{1}TLINKOTLINKOTLIN{2}KOTLIN +{2}KOTL{1}INKOTLINKOTL{2}INKOTLINKO +{2}KOTLIN{1}KOTLINKO{2}TLINKOTLINKOTL +{2}KOTLINKO{1}TLIN{0}K{2}OTLINKOTLINKOTLIN +{2}KOTLINKOTL{0}INKOT{2}LINKOTLINKOTLINKO +{2}KOTLINKO{0}TLINKOTLI{2}NKOTLINKOTLINKOTL +{2}KOTLIN{0}KOTLINKOTLINK{2}OTLINKOTLINKOTLIN +{2}KOTL{0}INKOTLINKOTLINKOT{2}LINKOTLINKOTLINKO +{2}KO{0}TLINKOTLINKOTLINKOTLI{2}NKOTLINKOTLINKOTL diff --git a/src/main.rs b/src/main.rs index ab649b027..fa4e24261 100644 --- a/src/main.rs +++ b/src/main.rs @@ -733,7 +733,7 @@ impl Info { Language::Go => vec![Color::White], Language::Haskell => vec![Color::BrightBlue, Color::BrightMagenta, Color::Blue], Language::Java => vec![Color::BrightBlue, Color::Red], - Language::Kotlin => vec![Color::Blue], + Language::Kotlin => vec![Color::Blue, Color::Yellow, Color::Magenta], Language::Lisp => vec![Color::Yellow], Language::Lua => vec![Color::Blue], Language::Nim => vec![Color::Yellow, Color::BrightWhite],