Sublime Forum

Wrap paragraph splits hyphenated words

#1

If you wrap the following line:

[quote]This is long line to be wrapped with a hyphenated word to illustrate the word-hyphenation bug.
[/quote]

the following two lines will be produced:

[quote]This is long line to be wrapped with a hyphenated word to illustrate the word-
hyphenation bug.
[/quote]

If you delete something in the first line and wrap again, this results in a space after the hyphen. E.g.:

[quote]This is long line with a hyphenated word to illustrate the word- hyphenation
bug.
[/quote]

I think this behavior is unexpected and incorrect in most situations. Is there a way to fix this? Thanks.

0 Likes

#2

I found this problem annoying when editing latex files. Use the following patch to fix it. Patch is for Sublime Text 2 Build 2181 OSX, but the same change should work for other builds and architectures.

— Sublime Text 2/Packages/Default/paragraph.py 2012-07-05 14:36:35.000000000 +0100
+++ paragraph.py 2012-07-05 14:42:58.000000000 +0100
@@ -184,6 +184,7 @@ class WrapLinesCommand(sublime_plugin.Te
for s in self.view.sel():
wrapper = textwrap.TextWrapper()
wrapper.expand_tabs = False

  •            wrapper.break_on_hyphens = False
               wrapper.width = width
               prefix = self.extract_prefix(s)
               if prefix:
0 Likes

Customizing Wrap Paragraph
#3

This works great! Thanks a lot.

0 Likes