Fragmentation Needed
Fragmentation Needed

Reputation: 224

Wrapping lines with leading speechmark in Sublime

When using the „Wrap paragraph at XX characters“ AND the praragraph starts with leading speech marks, these will be set in front of every line in this paragraph.

How to reproduce:

You'll get something like

"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras
"scelerisque sagittis est, ac consectetur lorem mattis tincidunt.
"Vestibulum sit amet lobortis odio, vel sollicitudin enim. Vivamus
"imperdiet tortor eu est malesuada condimentum. Suspendisse et posuere
"urna. Vivamus consequat sapien id vestibulum auctor. Vivamus suscipit
...

Can I somehow change this behaviour in the user settings or do I have to treat this as a bug?

Upvotes: 0

Views: 20

Answers (1)

MattDMo
MattDMo

Reputation: 102862

To fix this, you'll have make a small edit to paragraph.py in the Packages/Default folder. How you do this depends on the version of Sublime you're using. If you're using ST2, simply select Preferences -> Browse Packages... to open the Packages folder in your operating system's file explorer. Go to the Default folder, and open paragraph.py in Sublime.

If you're using ST3, the process is slightly more complicated, as most packages are stored in zipped .sublime-package files. Install Package Control if you haven't already, then install the PackageResourceViewer plugin. In the Command Palette, select PackageResourceViewer: Open Resource, select Default, then select paragraph.py.

Once you have paragraph.py open, scroll down to line 188:

prefix = self.extract_prefix(s)

Change it to:

prefix = None # self.extract_prefix(s)

and save the file. Now, this text (with a single quote at the beginning):

unwrapped

becomes:

wrapped

Upvotes: 1

Related Questions