slysherz / vscode-comment-box

Extension that transforms lines of text into a pretty comment box.
MIT License
19 stars 2 forks source link

Feature request: Dynamic box width using text indentation #11

Closed dgraber95 closed 2 years ago

dgraber95 commented 2 years ago

First, thanks for this extension. It makes commenting lines in a specific format so much easier, and I already love it.

The only improvement I can think of is an option like "boxEndingColumn" or something similar. I like to have all my comments end on the same column, regardless of the indentation of the text being commented. I think it could either override boxWidth, or work in addition to it - either would work for me.

For example, if I have three lines starting at column 0, column 4, and column 8, with a boxEndingColumn setting of 60, the commented lines would look like this:

image

Like I said, very happy with the extension as is, this one little thing would make it perfect for me though. Thanks again!

slysherz commented 2 years ago

Hey @dgraber95 , I'm glad you're enjoying it : )

Your suggestion seems pretty useful, I wonder how I've never thought about it. It's also quite simple to implement, I should be able to sneak it in for the next update (it's almost ready).

I'm thinking about a new maxEndColumn setting, so if you set a high boxWidth value (60 too) it should do exactly what you want. It has the added benefit that people who prefer fixed size boxes can use it too. What do you think?

dgraber95 commented 2 years ago

That's actually exactly what I was picturing. If you have both, set the width to whichever is less between maxEndColumn and boxWidth.

slysherz commented 2 years ago

I released this last weekend, did you have a chance to try it @dgraber95 ?

dgraber95 commented 2 years ago

Just got a chance to test it out - works beautifully, thanks! And thanks for the changelog credit 😀

slysherz commented 2 years ago

Great! Closing.