udalov / kotlin-vim

Kotlin plugin for Vim. Featuring: syntax highlighting, basic indentation, Syntastic support
Apache License 2.0
632 stars 51 forks source link

Autoindentations: Ignoring comments option's leading spaces. #7

Closed CrystalSplitter closed 7 years ago

CrystalSplitter commented 7 years ago

I've come across a bug in the indent/kotlin.vim file. The way it currently handles indentations does not account for C style/Javadoc comments like so:

/**
 * Comment
 * Stuff
 */
fun doSomething(): Int {

}

The problem:

When using the formatoptions r flag, Vim allows auto placement of comment blocks with a return line. For example, in normal Java, this will look like:

/**

Then pressing enter will give:

/**
 *

With the default configuration of the comments option in Vim. Kotlin's current indentation vim script ignores these settings, and places:

/**
*

This cannot be fixed unless the indentation script is modified. My current work around has been to remove the indentation script.

udalov commented 7 years ago

Thanks for the report, I think I've fixed it, please check!

CrystalSplitter commented 7 years ago

Fixed! Thank you!