Closed SegFaultAX closed 11 years ago
I've noticed this before, but I didn't look into it because I thought it may have been a side effect of my very custom setup.
Now that you can confirm that this isn't just local to me, I will find a solution. Thanks for the report!
Do you happen to have
let g:delimitMate_balance_matchpairs = 1
in your vim configuration? This option is what was causing problems for me: this option tries to balance brackets on the same line, which is not what you'd want with S-expressions.
I can't seem to reproduce otherwise; more details would be helpful.
Thanks
I don't have that line in my vimrc, and when I manually set g:delimitMate_balance_matchpairs = 0
it doesn't seem to make a difference. You can check out my vim config here if you want to see my specific setup. Thanks again for looking into this.
Hi Michael,
I cloned your vim setup then deployed it to a test account (btw, the vim-clojure-static and rainbow_parentheses.vim upstream URLs are incorrectly set to the ssh git@github versions instead of git:// or https://).
From what I can see, delimitMate works exactly the way I expect in Clojure and in other filetypes. The only time a closing bracket fails to be inserted is when starting directly at a word character:
cursor here -> |word
open bracket only -> (word
However, this is true in all filetypes. Could you please provide an exact example of the issue so that I can attempt to recreate it?
Thanks, I updated those URLs. Anyway, if I just open a clojure file eg vim foo.clj
and type an open paren, it does not insert a closing paren. If I do the same thing with any other filetype eg vim foo.py
and type an open paren, delimitMate seems to work as expected.
Okay, I finally see what you're seeing. Could you confirm that if you
enter vim, then switch filetypes with :setf clojure
, delimitMate works
as normal? This is how I was testing when I wrote the last message.
Yea, that works for me. So is vim-clojure-static clobbering the ft hooks that delimitMate is relying on? What are your thoughts on a fix or workaround?
No, the problem is paredit.vim. Try vim foo.scm
for instance; same
problem. I haven't used paredit in a while so I don't know the problem
just now, but you probably just need to disable delimitMate for lisp
buffers.
If you keep an eye out though, I am almost ready to release a paredit competitor soon that emphasizes text objects and more native vim editing concepts! /plug
You're right, removing paredit fixed it. I'm going to remove paredit.vim for now since I don't really use it anyway (but I'm very much looking forward to your replacement). Out of curiosity, how did you track that down?
Thank you again for your help!
First I tried comparing the startup sequence when loading a clojure vs python buffer:
$ vim --startuptime py foo.py
$ vim --startuptime clj foo.clj
The vimdiff showed no differences, so I capture the output of :let after loading a fresh python and fresh clojure buffer (you can do this using the :redir command if you're not familiar¹).
The diff of those buffers revealed that paredit variables were the only differences present, so I tried loading a scheme buffer, and then also removing paredit. Voilà!
Thank you for your attention regardless. More eyes means less bugs.
¹ I have simple command that captures command line output and opens it in a buffer if you'd like a reference:
https://github.com/guns/meinhaus/blob/guns/etc/vim/local/commands.vim#L518
I use delimitMate to automatically insert matched pairs for (, {, [, and " characters. That plugin doesn't seem to operate correctly (eg doesn't insert characters into the buffer automatically) when used in conjunction with vim-clojure-static and I'm having a hard time pinning down why. Any direction on getting them to play nice would be greatly appreciated.
Thanks for all your hard work!