Skip to content

Commit ada5576

Browse files
authored
Merge pull request #144 from nhojb/which_function_mode_fix
Fixes which-function-mode hang
2 parents 7739e49 + c67b950 commit ada5576

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

swift-mode.el

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ Signal `scan-error' if it hits opening parentheses."
215215

216216
(delete-overlay swift-mode:anchor-overlay)
217217

218-
(add-hook 'which-func-functions #'swift-mode:current-defun-name)
218+
(add-hook 'which-func-functions (lambda ()
219+
(when (equal (with-current-buffer (current-buffer) major-mode) 'swift-mode)
220+
(swift-mode:current-defun-name))))
219221
(setq-local add-log-current-defun-function #'swift-mode:current-defun-name))
220222

221223
;;;###autoload (add-to-list 'auto-mode-alist '("\\.swift\\'" . swift-mode))

0 commit comments

Comments
 (0)