Word Wrap in Editor

I use Drafts to keep some codes.
I like that I can choose “Javascript” in the Aa menu so it keep certain formatting .
How can I disable Word Wrapping?

Note the Max Line Width slider. It can be set to a number of characters, or on its right most setting, to use the margin. That is the only option I have seen to affect when wrapping occurs in the editor (preview works differently).

I don’t recall seeing an editor or syntax option that would specify to never wrap. Maybe there is one but I’ve just missed it, but I would have expected to be right there with max line length.

You note that you are storing code in Drafts and that this is driving the desire to adjust the wrapping. Why is such a setting beneficial to you for that?

If you are just storing code snippets for reuse, then it would make no difference as you would just copy them out. If you are storing them as reference examples for learning, then I would suggest storing them in Markdown within code blocks and reviewing in Preview. If you are using them in some other way, then perhaps in describing it someone may be able to suggest an option that may work better for you.

It’s a mixture of storing for reuse (e.g. some Keyboard Maestro Apple Script, some Popclip javascript, etc) and for learning (I am new in programming). And, to a certain a degree, it was caused by my OCD where I see the code being wrapped and it’s difficult for my mind to digest.

I just googled code blocks for Markdown - you are referring to using ``` such as:

xxx
yyy
zzz

Hey that works for me! Thank you.

It would be nice if Drafts can have code blocks too, as I do have a Workspace for KM and for Popclip Extensions.

Code blocks are supported in the GitHub and MultiMarkdown syntaxes. They are not a feature of the original Markdown spec, and, as such, are not supported in the plain “Markdown” syntax.

Drafts does not have a way to disable word wrap at this time. The app is optimized around notes, not code, so it hasn’t really been a feature I’ve been asked for, but is something I consider adding now and then. Will add your +1 to the feature request.

2 Likes