ehuss / Sublime-Wrap-Plus

Enhanced "wrap lines" command for Sublime Text 2 or 3.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

eepp opened this issue · comments

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?

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.

Thanks, this should be fixed now.

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.

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

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

CImprovedWrapping.zip