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

delimitMate problem with double quotes #129

Closed jbelmont closed 11 years ago

jbelmont commented 11 years ago

Hello for some strange reason when I type double quotes in c++, php, etc delimitMate doesn't like when I put space in between quotes, if I put space it will insert an extra space and when I try to close the quote it will insert two more double quotes.

Raimondi commented 11 years ago

Could you give a more precise description of the issue? a step by step recipe would help me reproduce the problem in my end.

cvwillegen commented 11 years ago

This is depending on the let delimitMate_expand_space=1 in your .vimrc.

What jbelmont does is this:

(in a .cpp or .php file):

i"<space>

The display now shows

" | "

(| is the cursor position)

Entering a " now will display

" "|" "

(again | is the cursor position)

Perhaps the plugin should check that, when expand_space is turned on, that the character following the cursor is a space followed by the closing character just typed, and in that case, skip the space and the closing char to get the 'expected' behaviour.

Raimondi commented 11 years ago

What's the expected behaviour? jump over the space and quote? like this " | " => "  "| ?

cvwillegen commented 11 years ago

Perhaps not expected, but probably wished for.

Raimondi commented 11 years ago

OK, good. I wasn't sure I got what he meant.