Pinegrow Community Support Forum

Editor Auto complete option

Please can we have options to control auto-complete behavior in the code editor?
I hate the immediate auto-complete eg. I’ve got a block of text, I decide I want it bold so I type in < b> at the start. The editor immediately adds < / b> which I then have to delete and type it in where it needs to be at the end.
But I like this aspect of auto-complete - I type in < / in the right place and the editor does the rest.
I can also see it’s useful when starting from scratch - I type < p> and I get a couple of line feeds and
< / p>
Thats why it needs to be an option.
SO autocomplete when I type </ but only optionally when I type < xxx >
Does this make sense? (NB gaps here to defeat the html)

Highlight the text in the code editor then press Shift+Ctrl+A and a dialog will appear type p and then enter and your text will be wrapped with <p></p> :slightly_smiling_face:

BTW you would need to have Emmet enabled in Support > Settings, I’m not sure if it is enabled by default.

I dont really see how that helps, but I’m trying out the Atom editor which has no auto-complete so I shall see which I prefer. I like the auto-complete but it needs more AI.

What you theoretically could do is to disable auto-complete in the Pinegrow settings (support -> settings -> Code editing) and use CTRL + space in case you want it on the fly.

I haven’t tried it out, though.

Cheers

Thomas

You mean ‘show auto-complete as you type’? Thats not it. With that on when you type < the code editor shows a (long) list of valid things that can follow < which you can select from the list.
Say I select < b from the list. The editor enters < b but as soon as I type > the editor adds < / b >. Thats what I dont want because i have to delete it.
What I do like is that when I then enter < / at the end of my block of text the editor responds quite rightly with < / b >.

OK - got it.

Let me say it this way:

Whatever behaviour the code-editor might have, it’s fine for me. PG has been built for visual supporting code.

So your request should be better read as:

By selecting an element or plain-text, PG has options like “Insert before”, “Insert after” the selection.

Why does Pinegrow doesn’t have the “Enclose selected element (or text) into … something”?

Use case:

Say we have plain-text - even not wrapped in a p-Tag. It would be cool to select (parts of) this text and enclose (wrap) it into p-Tag, h-Tag …

Once this done, select the elements in the tree (h3 + p-TAG) and wrap them into a DIV (article, section …).

I once called it (in another thread) reverse engineering. That’s in fact a strong (visual) tool no other application really has. And it’s important for people writing their projects from scratch (content-first).

This theoretically would make the “code editor behaviour” less important.

BTW:

Some things - let’s say b - can be solved by this:

Cheers

Thomas

I know bold can be done that way in the visual editor and I do, I was just using it as a simple example of what happens in the code editor.