ProKeys icon indicating copy to clipboard operation
ProKeys copied to clipboard

Enable special highlight for placeholders and macros in snip body view

Open GaurangTandon opened this issue 8 years ago • 4 comments

image

In this snip preview box, placeholders and date time macros are not distinctly differentiated from normal text. This has two defects:

  1. Having to scan very hard to locate them, not good for visually-inferior/impatient people.
  2. If you have the macros highlighted in that preview box, it implies that you got their syntax correct, other wise, until you run them, you can't know that you had missed a closing ] or whatever.

@iWrote Design suggestions please?

Note that the design has to be used in the above preview box as well as in the snip editor box (since now it is a contenteditable editor, it supports highlighting with all sorts of colors and sizes and everything)

GaurangTandon avatar Jul 01 '16 15:07 GaurangTandon

One. Light green enclosures with rounded/sharp edges that appear when you've got the syntax right. And they should grow if the user types additional correctly formatted text (e.g. name of placeholder is increased in length as the user types between the percentage symbols, than the enclosure should keep adjusting.) That should look good and, more importantly, feel good. syntaxhighlighting1

Edit: the more i think about this, the less i like it. maybe just go with 2.

Two. But that might not be doable or as good as I think. So, alternatively, you could just make the text go (prokey's) dark green. 009B3D

Blue might feel weirdly similar to hyperlinks, but remains the best choice if you need a secondary colour. 0D34FF

I recommend against using more than one colour. The highlighting is not for a programming language and the Bazaars of Hyderabad colour scheme is hardly suitable.

iWrote avatar Jul 13 '16 15:07 iWrote

Those are good ideas! I will get back to you as soon as I implement them.

GaurangTandon avatar Jul 13 '16 16:07 GaurangTandon

While I definitely want to implement a Grammarly style underline for snippet words in a paragraph and for the thing u mentioned above, sadly I am clueless on how to do it at the moment. Grammarly uses a series of divs somehow in a text area that wraps around that word.

jaidevshriram avatar Jun 10 '19 18:06 jaidevshriram

Grammarly has the limitation of having to do it in virtually every web editor possible. We currently have to do this only in the options page. I am sure we could do some simple things in this regard (like enclosing relevant text in a <span>?)

GaurangTandon avatar Jun 11 '19 02:06 GaurangTandon