Return works as well, but only when the caret is at the end of the line.
P.S. It takes less time to try out every single key on your keyboard than to write your post. That might sound silly, but trying everything is arguably the most efficient (and fun) way to learn about an application.
[Edit: realized after posting that “pic #2” referred to Dario’s pic #2, not my pic #2]
Thanks very much for that! Dario did not explain the necessity of the Esc key – nor does the Logseq queries documentation explain it, either. Or, if it does explain it, I have yet to find the explanation after reading through it.
(default mode) displays formatting expressed in editing mode, executes queries, etc.
When you click on a block that is in viewing mode
you switch to editing mode
your cursor appears,
and you can start writing.
When you are writing your query {{query #agenda }} you are in editing mode.
When you press Esc, you exit the editing mode and switch to viewing mode.
If you are writing your query and press Enter:
you start a new block in editing mode (moving over any characters after where the position of your cursor when you pressed Enter).
The block from whence you came is now displayed in viewing mode.
When in your question you are writing your query and press enter between {{query #agenda and }}:
the block switches to viewing mode.
The syntax in the top block does not match the needed syntax for a query (it is missing the closing }}.
It is just recognized as a word {{query a space _ and a tag #agenda (you may notice that #agenda in your picture is now displayed in blue and is a link).
This was the unknown-unknown to me, yes. Thanks to you and to @meowkman for clarifying so well. This is the kind of information that is 1) so basic that no one ever thinks to put it in the documentation, yet 2) required to put the documentation to use in the first place. Of course, it’s possible this info is in the dox and I’ve simply missed it, in which case an argument can be made that it should be promoted into a more obvious “necessary prerequisites” location.