Syntax Highlighting for Whitespace?

Is it possible to use syntax highlighting to show whitespace in a draft, in the style of Visual Studio, Sublime etc.

It is not. “Showing invisible characters” is a feature we have on the list, but it is not implemented at this time.

there is this action to show all invisibles in a draft though, which I use sometimes.

Thanks both.

I’ll keep an even more careful eye on the release notes, in the meantime that action looks like it’ll keep me from the worst of my spacing problems.

thanks for the awesome information.

What are your spacing problems? They might be solved or reduced by an action with regular exoressions…

I’ve used Drafts to edit longer writing and find that, especially when moving sentences around in a paragraph I’ll introduce extra spaces at the beginning or end of sentences when I drop things back in, or simply when editing words out.
I have triaged with the find function to hunt down the double spaces, but hadn’t considered building an action to do so.

That’s what I thought.

A replace regex would do the trick.

You look for any multiple spaces (maybe even after a dot/full stop ad replace it with only one space.

I made this on the foundation of another example Replace Multiple Spaces after Dot Example | Drafts Directory

I guess @sylumer has a good function for that in the TadPole library. :wink:

There are lots of actions for dealing with the removal and compression of whitespace in the ThoughtAsylum - Writing action group.

Just search for “space” to find some relevant actions.

I think most of the functions I used for these would be found in the string class. Check out the TA-remove* functions as a starting point. In the main they are convenience functions for some regular expression replacements.

1 Like

Actions really should have been my first port of call with the this, after I’d run a find and replace more than once; TAD especially, as I do have it installed.

Calling up one of the above mentioned actions in my manuscript preview or exporting action is probably the best solution for me, certainly to make sure it happens to any given draft where it might be needful without me having to remember it.

Seeing the regex singled out is very useful, thank you @Andreas_Haberle

This feels like it parallels with using a spell checker. I began this post looking for the equivalent of the red underline, and now I’m running a checker automatically whenever a draft might end up being seen by a second party.

1 Like