liquidz / vim-iced

Clojure Interactive Development Environment for Vim8/Neovim
https://liquidz.github.io/vim-iced/
MIT License
516 stars 35 forks source link

Code evaluation doesn't work on strings with ansi escape color codes #471

Closed tastyminerals closed 7 months ago

tastyminerals commented 7 months ago

Trying to evaluate the following code block results in an error.

(def ansi-styles
  {:red "\033[0;31m"
   :green "\033[0;32m"
   :blue "\033[0;34m"
   :reset "\033[0m"})

Hitting <Leader>et returns "Failed to find code" and inserts a 0 into next line below.

Screenshot 2024-01-21 at 13 20 53

Hitting <Leader>ei returns "Unable to resolve symbol: ansi-styles in this context.

Same behaviour for

(def ansi-styles
  {:red   "[31m"
   :green "[32m"
   :blue  "[34m"
   :reset "[0m"})
liquidz commented 7 months ago

@tastyminerals Thank you for your reporting! Hmm, could you try to enable matchit plugin? https://vim-jp.org/vimdoc-en/usr_05.html#matchit-install

tastyminerals commented 7 months ago

Ok, I am using neovim hence I installed matchup. It didn't resolve the issue. I removed matchup and installed matchit as well. The behavior didn't change but what changed is that any function which contains unclosed parenthesis in a string stopped working. For example:

(defn happy [] (println "this is a happy string :)"))

throws EOF while reading, starting at line 209

(defn sad [] (println "this is a sad string :("))

throws failed to find code and inserts a 0 on the line below.

So, it is an unclosed parenthesis issue. It fails to parse any type of parenthesis single [ doesnt' work as well.

liquidz commented 7 months ago

@tastyminerals Thanks!

I am using neovim

In my environment, neovim with minimal configuration works well. It could be due to other plugins you are using 🤔

I'm using neovim v0.9.5.

tastyminerals commented 7 months ago

All right, thanks, I shall take a look which plugin messes up.