cohama / lexima.vim

Auto close parentheses and repeat by dot dot dot...
996 stars 46 forks source link

Quotes added again after entering the quoted text #41

Closed suy closed 8 years ago

suy commented 8 years ago

Hi.

If I type "hello" I get the expected "hello"| (with the | being the cursor as usual). However, if I enter back the cursor inside the quote, and I type the "at "hello|", I expect the cursor to advance, and instead it adds a quote sign.

In other words: "hello"<left>" gives "hello"|" instead of "hello"|. Is this expected? If I do "hello<right><left>" I get the correct result.

I have no configuration added to lexima (no variables nor rules), and I think I have no conflicting mappings with those characters.

Thanks for the plugin!

cohama commented 8 years ago

Yes. It is expected behavior. lexima.vim has a stack holding some characters which was input automatically. When leaving rule is work, this character is pop from the stack. This means you can leave closing character only once. This is the trade off between dot-repeatability and moving the cursor.

Hence, you can define always-leaving rule

call lexima#add_rule({'at': '\%#"', 'char': '"', 'input': '<Right>'})

and you will lost dot-repeatability.

suy commented 8 years ago

Oh, I see. I did not look at the documentation very closely. I will take it into account.

I'm closing the issue. Thank you again!