 (defun danylo/julia-imenu-hooks ()
   (setq imenu-generic-expression
         '(("f(x)   " "^[[:blank:]]*function \\(.*\\).*(.*$" 1)
-          ("f(x)   " "^\\([a-zA-Z0-9_!]*?\\)\s*(.*?).*=.*$" 1)
+          ("f(x)   " "^\\([a-zA-Z0-9_\\.!]*?\\)\s*(.*?).*=.*$" 1)
           ("@      " "^[[:blank:]]*macro \\(.*\\).*(.*$" 1)
           ("struct " "^[^#]*\s+struct\s+\\(.*?\\)$" 1)
           ("struct " "^struct\s+\\(.*?\\)$" 1)

                  "magit.*:" "\\*Backtrace\\*" "\\*Process List\\*"
                  "\\*Async-" "\\*Native-" "\\*.*output\\*" "\\*helm"
                  "\\*eww\\*" "\\*timer-list\\*" "\\*Disabled Command\\*"
                  "\\*Man .*\\*"
                  ))))

(defun danylo/set-helm-window-height (orig-fun &rest args)

    "Update Imenu list to reflect the current window's content."
    (when (and (get-buffer-window imenu-list-buffer-name t)
               (not (string= (format "%s" (current-buffer)) imenu-list-buffer-name)))
      (with-current-buffer (current-buffer)
        (imenu-list-update t))))

  ;; Update Imenu automatically when window layout state changes
  (add-hook 'window-state-change-hook 'danylo/imenu-update))

;; Patches to imenu so as to navigate using the **window** that owns the
;; current Imenu, not the buffer. This way handles multiple windows showing the
