ehuss / Sublime-Wrap-Plus

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lines often have overflows of one character (in respect to wrap width)

FelixAkk opened this issue · comments

I love this plugin! I use it just about every few seconds in my workspace. However, although it almost works, once every few lines text isn't wrapped properly, and is too long by 1 character, causing the native autowrap to create a messy result.

This screenshot illustrates it best: screenshot

It seems to be an off by one error in the length calculations in certain conditions. This by the way seems to only happen in Distraction Free mode, and always with an overflow of 1 character.

So it would be of amazing help to my daily workflow if someone is willing to look into this! If I can help in any other way, I'd gladly do. And I saw a pull request which is sort of related: #28

This feature would already solve all my problems, because I would be able to set a limit lower than my configured wrap width. To bad this pull request has been sitting there for over half a year. Perhaps I'll see if I can get his fork working :)

I suspect you have word wrapping set to "auto" (View -> Word Wrap is checked). If that is so, this is a duplicate of #24. Sublime's automatic mode includes newlines in the line count, but manual wrapping does not. For now you can use the hidden WrapPlus.wrap_col_diff configuration option.

The reason it is not documented is because I do not think it is the right solution. I think for this specific case, it should probably automatically adjust when "automatic" word wrapping mode is on to avoid this kind of confusion. However, some people want more control, so it's not that simple. I don't use automatic word wrapping, so I just haven't looked at it much. I will try to take a look at it soon.

I have added WrapPlus.include_line_endings and WrapPlus.wrap_width to deal with this.