dgrnbrg / vim-redl

A better Vim integration story for Clojure
106 stars 8 forks source link

Use in-ns when creating the repl #21

Closed guns closed 11 years ago

guns commented 11 years ago

This avoids blowing away any :exclude lists in :refer-clojure or :use statements resulting in clojure.lang.Namespace.warnOrFailOnReplace errors.

e.g.

    ;; foo.clj
    (ns foo
      (:refer-clojure :exclude [defn]))

    (defmacro defn [& args] nil)

    ;; bar.clj
    (ns bar
      (:require [foo :refer [defn]])
      (:refer-clojure :exclude [defn]))

    (defn example [])

Running :Repl from bar.clj results in:

IllegalStateException defn already refers to: #'foo/defn in namespace: bar clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)

dgrnbrg commented 11 years ago

Thank you for this! Sorry for taking so long to merge.