ehuss/Sublime-Wrap-Plus

Sublime Wrap Plus does not seem to work with the C Improved package

eepp opened this issue · 5 comments

eepp commented

It looks like Sublime Wrap Plus does not work with the C Improved package, at least not within a block comment with this form:

/*
 * Something
 * something else.
 */

It's wrapped like this:

/*
 * Something
 * something else. */

Is there something hardcoded for the C language regarding this form?

ehuss commented

Hm, for some reason the C Improved syntax captures the newline following the comment block which confuses Wrap Plus. It shouldn't be too difficult to strip out leading/trailing whitespace.

ehuss commented

Thanks, this should be fixed now.

eepp commented

Let's say ¦ represents the caret. The following situations do not wrap (at all or correctly) with the C Improved syntax:

/*
 * Something¦
 * something else.
 */
/*
 * Something
 * something else.¦
 */

However those ones work fine:

/*
 * Somet¦hing
 * something else.
 */
/*
 * Something
 * som¦ething else.
 */

There seems to be a problem with the caret at the end of a line within a block comment.

ehuss commented

That is the same problem as #39, the API provided by Sublime does not make it easy to extract the range for a block comment. In this case, C Improved has a special "punctuation.whitespace.newline.c" scope at the end of lines. I'll think about adding a way to try to expand the region to encompass the entire comment block, but it may be tricky

detly commented

Just FYI, this is still an issue. I'm just using whatever version is in Package Control.

CImprovedWrapping.zip