Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make soft-wrap break words before a slash or space and after a dash #17949
Description of the Change
Wrapping now includes wrap on dash and slash. Remake of #17141, which was in response to issue #16904, in which the user wanted more "aggressive" wrapping. To implement this change, the isWrapBoundary variable was given character checks for spaces, slashes, and dashes as wrap boundaries.
Compared to the previous iteration of this PR, it checks if the previousCharacter (not the current character) is a dash, to cut words after it, so that it is consistent with how word-wrapping works in most software.
Any help to fix tests is appreciated since I do not have experience with those.
The proposed version was selected because it produced the simplest fix to this problem.
Why Should This Be In Core?
This should be in the core because it has to do with editor functionality.
A much more intuitive soft-wrap functionality that doesn't breakup words in the middle if it doesn't have to.
This is not a new behavior, but it will be more visible:
The cursor can’t be after the last character, because it’s the same position than the beginning of the following line, and so “Move to end of line” puts the cursor before the last character of the line visually.