~theo/fsharp-mode

a1ced6cc2bff1c106d8035ece13227cadaf97e1a — Theodor Thornhill 3 years ago 2ededf6
Add stupid beg/end-of-defun
1 files changed, 14 insertions(+), 3 deletions(-)

M fsharp-mode.el
M fsharp-mode.el => fsharp-mode.el +14 -3
@@ 105,6 105,17 @@ ambiguous, multiple invocations will indent tabstops forward."
   (indent-next-tab-stop
    (save-excursion (back-to-indentation) (current-column)) t)))

(defun fsharp-mode-beginning-of-defun (&optional arg)
  (re-search-backward "\\<let " nil t (or arg 1))
  (goto-char (point))
  (back-to-indentation))

(defun fsharp-mode-end-of-defun (&optional arg)
  (when (looking-at "\\<let") (forward-line))
  (re-search-forward "\\<let " nil t (or arg 1))
  (goto-char (point))
  (back-to-indentation))

;;; Font locking

(defconst fsharp--regexp-type


@@ 303,9 314,9 @@ ambiguous, multiple invocations will indent tabstops forward."

\\{fsharp-mode-map}"

  ;; ;; Movement
  ;; (setq-local beginning-of-defun-function #'elmo-beginning-of-defun)
  ;; (setq-local end-of-defun-function #'elmo-end-of-defun)
  ;; Movement
  (setq-local beginning-of-defun-function #'fsharp-mode-beginning-of-defun)
  (setq-local end-of-defun-function #'fsharp-mode-end-of-defun)
  
  ;; ;; Indentation
  (when (boundp 'electric-indent-inhibit) (setq electric-indent-inhibit t))