Emacs-Kotlin-Mode-Maintainers/kotlin-mode

`beginning-of-defun` and `end-of-defun` does not move point to start/end of function

Opened this issue · 0 comments

In other programming modes, beginning-of-defun and end-of-defun will move the point to the start of the nearest function, sexp, method, subroutine or other analogous constructs.

However, in kotlin-mode, beginning-of-defun moves the point to the beginning of the buffer.

Small example:

package com.example.myApp

class MyClass() {
    fun myFun1() {
        return "myFun1"
    }
    fun myFun2() {
        // when calling `beginning-of-defun` with the point anywhere in this function,
        // the point should move to the `fun` two lines above,
        // but it moves to the `package` at the beginning of the buffer instead.
        return "myFun2"
    }
}

Versions:

  • kotlin-mode version: 20230123.1859
  • emacs version: 29.0.60
  • OS: macOS Ventura 13.3 on M1 Pro

(in any case, thanks for the amazing work on this, or otherwise I would not have been able to use Emacs for my Kotlin-related work 👍 )