Typing :-<newline>

We poor Prolog users at https://swi-prolog.discourse.group have some trouble trying to enter the most basic part of the Prolog syntax: rules have :- between head and body and it is good practice to put a line break after the :-. This however insists on inserting a smiley, so our code looks like this

p :-1:
    q.

instead of

p :-
    q.

As you can see, the smiley doesn’t even show up inside the code. It would be nice if smiley completion was disabled inside code blocks.

 Thanks!
7 Likes

Change the site setting emoji autocomplete min chars to 3 or 4.

4 Likes

Thanks. The default is not 3 but 0 and 3 is long enough. This is a big improvement for us. Somehow it still feels right not to do emoji autocompletion at all inside code …

4 Likes

Understood, it is very tricky though with our current parser cause we can not efficiently reverse map text in the editor to type of element that you are in the middle of typing.

A trivial regex here counting ``` which are followed by a bit of text and a newline, kind of works but then there is [code] and 3 space indent as well to worry about.

This is definitely something we are thinking about and have similar request (basic markdown highlighting) which would also lean on a similar feature.

10 Likes

Hey @Jan_Wielemaker,

@dan just committed a new feature to try and solve this nuisance.

https://github.com/discourse/discourse/pull/8459

9 Likes

This topic was automatically closed after 6 days. New replies are no longer allowed.