derekwyatt / vim-scala

My work on integration of Scala into Vim - not a ton here, but useful for me.
http://derekwyatt.org
Apache License 2.0
1.09k stars 144 forks source link

Fix indentation for defs and vals with modifiers #152

Closed crater2150 closed 5 years ago

crater2150 commented 6 years ago

Fixes indentation for defs, vals and vars with annotation on same line, final defs and vals/vars, and several other keywords for vals/vars (like private/lazy/...).

Example (added to testfile.scala):

  @annotation.tailrec def someFunction =
    some stuff here

  final def foo2 =
    some stuff here

  final val someValue =
    some stuff here

  private val someValue =
    some stuff here

  lazy val someValue =
    some stuff here

  @annotation.foo val someValue =
    some stuff here

  private[this] def followingFunction = oneliner

Before fix, this was indented to:

  @annotation.tailrec def someFunction =
    some stuff here

    final def foo2 =
      some stuff here

      final val someValue =
        some stuff here

        private val someValue =
          some stuff here

          lazy val someValue =
            some stuff here

            @annotation.foo val someValue =
              some stuff here

              private[this] def followingFunction = oneliner
derekwyatt commented 5 years ago

thx