UltCombo / atom-sublime-block-comment

An Atom Editor plugin to toggle block comments, inspired by Sublime Text.
MIT License
10 stars 2 forks source link

Feature: Setting that allows user to pad selection with whitespaces when commenting #3

Closed scowalt closed 8 years ago

scowalt commented 8 years ago

Hey, thanks for making this package. I use it every day!

Change:

This pull request adds the "Delimit" setting to the package. This changes the behavior of the package in the following way:

Delimit == false: selection => /*selection*/

Delimit == true: selection => /* selection */

Current limitations:

  1. Isn't "backwards-compatible" with non-delimited comments. Example:

    Delimit == true: /*selection*/ => /*selection*/

  2. Calling the padding character a "delimiter" is probably a misnomer, but I'm unsure of what else to call the character besides "padding"

    Possible future work:

  3. Allow user to provide a custom delimiter string

Looking forward to your feedback on this change. Thanks!

UltCombo commented 8 years ago

Nice work! I'll review it shortly.

UltCombo commented 8 years ago

Thanks!

I've renamed the delimit setting to pad, and added "backwards-compatibility" with non-padded comments. I'd appreciate if you can review/test it: 803ce71eb1eaf1e39dc38ff0716094bc7d261ada

UltCombo commented 8 years ago

Also, all these array index accesses I've added are bothering me, got to replace the arrays with Range/Point instances ASAP.

scowalt commented 8 years ago

Just tried it out a bit, works really well. Thanks for merging this in!

UltCombo commented 8 years ago

No problem.

By the way, I pushed the Point/Range refactoring here: 872733c2dea17eeb3bbb9f51bb6b8adb535eb9ed

And just published v0.4.0! Thanks. :smile: