Raimondi / delimitMate

Vim plugin, provides insert mode auto-completion for quotes, parens, brackets, etc.
http://www.vim.org/scripts/script.php?script_id=2754
1.98k stars 117 forks source link

"don't" shouldn't become "don't'" #92

Closed docwhat closed 12 years ago

docwhat commented 12 years ago

What happens:

When typing "don't do it" I get "don't do it'" when in a language with strings that use double quotes; e.g. Python or Ruby

I tried adding this to autoclose_quotes.txt and I think this reproduces the problem for ' but it also tests other quote-alikes (e.g. |):

let g:delimitMate_expand_cr=1
let g:delimitMate_expand_space = 1
let g:delimitMate_smart_quotes = 0
let g:delimitMate_balance_matchpairs = 1
"don't do it" "don't do it"

The output I get:

not ok 163 - don"t do it => don"t do it" != don"t do it
not ok 164 - don't do it => don't do it' != don't do it
not ok 165 - don`t do it => don`t do it` != don`t do it
ok 166 # TODO don”t do it => don”t do it == don”t do it
not ok 167 - don«t do it => don«t do it« != don«t do it
not ok 168 - don|t do it => don|t do it| != don|t do it

The only one I'm concerned with is 164. I'm unsure about the others.

Ciao!

Raimondi commented 12 years ago

That case is handled by the 'smart quotes' feature that you disabled. Do you mind sharing your reasons to disable it?

There used to be a 'apostrophe' option, just for situations like this. Maybe it's wasn't a good idea to remove it.

docwhat commented 12 years ago

@Raimondi I'll turn it back on and see if it fixes the problem.

I will admit to thrashing around regarding the settings for delimitMate and getting frustrated. It's possible that the version I had was broken (I'm using the git version from branch master) at the time. I didn't record in what way it was broken or why I turned it off.