cohama / lexima.vim

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

[discussion] New Line Rules getting on the way #33

Closed perrin4869 closed 8 years ago

perrin4869 commented 8 years ago

I've been using this plugin for a while now, and I am really happy with how it works, except when it comes to one of the New Line Rules:

Before        Input         After~
------------------------------------
{|            <CR>          {
                                |
                            }
------------------------------------

Now, the problem here is that there is no way to disable this rule without disabling the other new line rule. This rule can get really annoying when pressing <CR> after a bracket which already had a closing bracket, and since the default rules take care of that case, this rule seems rather redundant. Is there a way you could add a way to disable this rule? Or maybe even remove it completely, because I cannot really see the point of having it provided the default rule:

Before        Input         After~
------------------------------------
|             {             {|}
cohama commented 8 years ago

Now, there is no way to disable individual rules. but you can override the default rule.

call lexima#add_rule({'at': '{\%#$', 'char': '<CR>', 'input_after': '', 'priority': 1})

this rule seems rather redundant.

Because some people want to use newline rules without basic rules.

perrin4869 commented 8 years ago

Actually, I was thinking that that specific rule would make more sense as an endwise rule than a newline rule, don't you think? Since you are ending a command there

perrin4869 commented 8 years ago

Then maybe if the default rules are on, then the newline rule can be off by default? I don't think that they both should be used at the same time unless explicitly turned on by the user, since no one would use both rules at the same time. I could try to put together a fast pull request if you want

cohama commented 8 years ago

No. It is difficult to understand how default rules work.

You can

perrin4869 commented 8 years ago

If there is no better solution then I guess that'll do

cohama commented 8 years ago

Some people also complain about default rules.

I'm sorry I do not have any ideas to solve problems arround default rules for now.

perrin4869 commented 8 years ago

Yeah it's ok, I just went with the solution in your first comment, works just fine, thanks :)