   (push (list 'search-kernel-functions 1 ojs-kernel-functions-face) font-locks)
 
   ;; Variables in the function 
-  (push (cons 'search-vars-from-context font-lock-variable-name-face) font-locks)
+  (push (cons 'search-function-local-vars font-lock-variable-name-face) font-locks)
   ;; Global vars
   (push (cons 'search-global-vars font-lock-variable-name-face) font-locks)
   ;; Variable definitions

;; highlight locally defined vars
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; vars from the current function
(defun search-vars-from-context (end)
  (re-search-forward (js--regexp-opt-symbol (get-local-vars-for-function nil)) end t))

;; script-level and global vars.
(defun search-global-vars (end)


;; function starts
(defconst *ojs-function-start-regexp*
  "\\<\\(function\\|method\\|on new\\|on modifyafter\\|on modifybefore\\|on delete\\)\\>")

;; kernel functions are in italic
(defface ojs-kernel-functions-face
