vkostyukov / kotlin-sublime-package

Sublime Text 2 Package for Kotlin Programming Language
Apache License 2.0
137 stars 41 forks source link

A lot of keywords not checked for word boundaries #18

Closed belyaev-mikhail closed 6 years ago

belyaev-mikhail commented 6 years ago

Anything starting with a "class" or "object" or maybe other keywords now triggers highlighting the line as a class header. If the same line somehow contains a '{' symbol, the rest of the file is not highlighted.

val x = className + "{"
val b = foo()
val a = bar()
val x = objectValue; val z = "{"
val b = foo()
val a = bar()
belyaev-mikhail commented 6 years ago

6 is a specific case of the same issue, it seems

fun foo() {
    val x  = Bar::class
    val y = hello
}
belyaev-mikhail commented 6 years ago

As is #4

val x = valueOfMe + "=4asdasdasdas"
val z = 5
belyaev-mikhail commented 6 years ago

As is #8

(see "value" and "=" on the same line there)

    for ((key, value) in BlockOre.inventoryVariants) {
        val parts = value.split("=")
        val name = parts[0] + parts[1].toLowerCase().capitalize()
        if (key == 2) {
            OreDictionary.registerOre("${name}_Mgc", ItemStack(BlockOre, 1, key))
        } else {
            OreDictionary.registerOre(name, ItemStack(BlockOre, 1, key))
        }
    }
belyaev-mikhail commented 6 years ago

Same goes for fun.

val x = funToPlayWith + "(){"
val b = "Hello"
val x = "}"
val z = foo()
belyaev-mikhail commented 6 years ago

Also #9

vkostyukov commented 6 years ago

Should be fixed by #20 (I hope). Feel free to re-open if not.