Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't autoclose in certain syntax regions #70

Open
causal-agent opened this issue Nov 11, 2013 · 13 comments
Open

Don't autoclose in certain syntax regions #70

causal-agent opened this issue Nov 11, 2013 · 13 comments

Comments

@causal-agent
Copy link

Townk/vim-autoclose disables autoclosing in certain syntax regions, such as strings and comments. It would be nice if this plugin could be configured to do the same.

@jiangmiao
Copy link
Owner

I'm sorry, I cannot find any situation which need disable it in strings or comments.

@solson
Copy link

solson commented Nov 11, 2013

It'd be nice if it was configurable whether it was enabled inside strings and comments, for personal preference. (Personally, I'd like if it was disabled in strings and comments.)

@causal-agent
Copy link
Author

It would be nice in a situation like this:

var s = '(' + foo + ')';

You don't always want balanced parentheses in your strings.

@jiangmiao
Copy link
Owner

That's rare case to insert single (. In general, we will input '('+ foo + to insert that.

@solson
Copy link

solson commented Nov 11, 2013

It's not that rare in my experience. I think everyone would be happy if this was a configuration option, though. The default could still be the current behaviour.

@jiangmiao
Copy link
Owner

What's the plugin should do if user want to insert 'foo(bar)'?

@solson
Copy link

solson commented Nov 11, 2013

If the enabled_in_strings option was enabled, they would type 'foo(bar and get 'foo(bar)'. If it was disabled they would just type 'foo(bar)'.

@jiangmiao
Copy link
Owner

use <M-p> to disable auto-pairs temporarily.

@causal-agent
Copy link
Author

The Autoclose plugin has a configuration option with a list of syntax regions to disable inside of, such as String or Comment.

@jiangmiao
Copy link
Owner

I'm sorry I still cannot find it any useful. Which I found is for some languages uses " as comment that should not be paired. or other insert single quote or bracket is rare case.

@causal-agent
Copy link
Author

Why are you so opposed to a feature that would benefit some people and not affect other people in any way?

@jiangmiao
Copy link
Owner

Here is some reason:

  1. Script should keep easy and clean.
  2. That feature is not 1 minute work, it will take some time.
  3. I cannot find it is useful so I think it is not worth to import it yet.
  4. The script is under MIT license, any people could fork and add that feature if think it is really nessecary.

@jiangmiao
Copy link
Owner

If you find some situation such as "I often insert single pair in somewhere, and in that place, insert matched pair is rare case". then I would happy to implement it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants