Skip to content

Commit

Permalink
Highlight the function name, not the module name, in declarations.
Browse files Browse the repository at this point in the history
For example, the code:

function Base.getindex{T,S}(x::ArraySplit{T,S,Nothing}, i::Int)
    (i >= 1 && i <= x.k) || throw(BoundsError())
    copy!(x.buf, 1, x.s, (i-1)*(x.n-x.noverlap) + 1, x.n)
end
  • Loading branch information
Wilfred committed Aug 18, 2014
1 parent f2dedf6 commit 0678357
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contrib/julia-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,12 @@
].* \\(in\\)\\(\\s-\\|$\\)+")

(defconst julia-function-regex
(rx symbol-start "function" (1+ space) (group (1+ (or word ?_ ?!)))))
(rx symbol-start "function"
(1+ space)
;; Don't highlight module names in function declarations:
(* (seq (1+ (or word ?_)) "."))
;; The function name itself
(group (1+ (or word ?_ ?!)))))

(defconst julia-type-regex
(rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ (or word ?_)))))
Expand Down

0 comments on commit 0678357

Please sign in to comment.