[Plugin Request] Text Highlight Button for Code Mirror

I don’t quite have the time or experience to work on this myself right now (though if this post does not get any interest I might take a shot at it)

It would be great if someone could make a code mirror plugin that adds single button press text highlighting similar to how the bold button works. I mean Word-style text highlighting where you select a color from a pallet, highlight some text, and click the button and the text background goes that color.

Highlighting is really useful in journaling and the fact tiddlywiki doesn’t have a good way to do it is a shame. Both the default editor and code mirror seem to be missing a lot.

Well, you can do this without using Code Mirror.

to make a button to highlight, you just need to wrap the selected text with @@ which by default applies the highlight coloring to the text.

If you’d like to make it yourself you can search for all the tiddlers related to “bold” (excluding any with .js in them, since those are javascript tiddlers), and simply clone them.

from there you just change the prefix and suffix to “@@” and your done!

I’ll save you a lil trouble and attach a button for highlighting and if you wanna use it for making new buttons, it’ll be there for you,

Hope this works for ya, highlight is bound to alt+h :grinning_face_with_smiling_eyes:

tw-highlight-editor-btn.json (1.3 KB)

Edit: Ah, for different colors, you might have to go a different route, something more advanced would be a font button that on text selection applies something like @@.red-text (selectedText)@@, picked from a dropdown list of pre defined colors, I’ll probably tinker with this idea for a bit.

1 Like

I suspect @Justin_H solution will be enough but search a little and you may find someone has published an editor tool bar button you want. As he said codemirror is not relavant. I recall one with selected colors.

1 Like