(Feature request) How do I add a text line when the code block is the last line? #1754

Closed
opened 2025-10-01 16:08:02 -05:00 by giteasync · 7 comments
Owner

Originally created by @Joackk on GitHub.

Describe feature

Sometimes I habitually make the code block as the last line, but then I need to enter new text, but I can't add a blank line after the code block, a direct enter will only add a line of code block, I can only delete a few lines of the code block and then recreate the block, can I add a blank line for it directly like a table?

Additional Information

No response

Originally created by @Joackk on GitHub. ### Describe feature Sometimes I habitually make the code block as the last line, but then I need to enter new text, but I can't add a blank line after the code block, a direct enter will only add a line of code block, I can only delete a few lines of the code block and then recreate the block, can I add a blank line for it directly like a table? ### Additional Information _No response_
giteasync added the
State: Triage
label 2025-10-01 16:08:02 -05:00
Author
Owner

@Joackk commented on GitHub:

Actually this appears to no longer be an issue. You can just slam (or press, or tap) the enter key three times to exit out of the code block.

Thanks, this is very useful

@Joackk commented on GitHub: > Actually this appears to no longer be an issue. You can just slam (or press, or tap) the `enter` key three times to exit out of the code block. Thanks, this is very useful
Author
Owner

@Konstantin-Davidneko commented on GitHub:

This is so counterintuitive, that I needed to find this issue, to find the solution.
Since exiting other things, like bullet list for example, you need only two enters, I don't think this solution is acceptable.

Please reopen.

@Konstantin-Davidneko commented on GitHub: This is so counterintuitive, that I needed to find this issue, to find the solution. Since exiting other things, like bullet list for example, you need only two enters, I don't think this solution is acceptable. Please reopen.
Author
Owner

@meichthys commented on GitHub:

Actually this appears to no longer be an issue. You can just slam (or press, or tap) the enter key three times to exit out of the code block.

@meichthys commented on GitHub: Actually this appears to no longer be an issue. You can just slam (or press, or tap) the `enter` key three times to exit out of the code block.
Author
Owner

@meichthys commented on GitHub:

I've run into this a couple times. It's not ideal, but a quick workaround is to insert a horizontal line and then remove it:
image

@meichthys commented on GitHub: I've run into this a couple times. It's not ideal, but a quick workaround is to insert a horizontal line and then remove it: ![image](https://github.com/zadam/trilium/assets/10717998/5a97bf80-3263-442d-ba18-c57a07be22be)
Author
Owner

@zadam commented on GitHub:

like bullet list for example, you need only two enters

Because in a bullet list you typically don't have empty lines. In code block you do.

Please reopen.

This is a behavior of CKEditor and I want to avoid changing the behavior of it as much as possible.

@zadam commented on GitHub: > like bullet list for example, you need only two enters Because in a bullet list you typically don't have empty lines. In code block you do. > Please reopen. This is a behavior of CKEditor and I want to avoid changing the behavior of it as much as possible.
Author
Owner

@Ranglage commented on GitHub:

This is a behavior of CKEditor and I want to avoid changing the behavior of it as much as possible.

I totally understand that. Nevertheless, if you need to google how to exit something, we are approaching vim-meme territory.

Maybe there is possibility to add some "tip"? Or always automatically add new line after code block, when it was inserted?

I totally agree with you. I have to google (and find nothing) and find within GitHub issues to get this answer.

@Ranglage commented on GitHub: > > This is a behavior of CKEditor and I want to avoid changing the behavior of it as much as possible. > > I totally understand that. Nevertheless, if you need to google how to exit something, we are approaching vim-meme territory. > > Maybe there is possibility to add some "tip"? Or always automatically add new line after code block, when it was inserted? I totally agree with you. I have to google (and find nothing) and find within GitHub issues to get this answer.
Author
Owner

@Konstantin-Davidneko commented on GitHub:

This is a behavior of CKEditor and I want to avoid changing the behavior of it as much as possible.

I totally understand that. Nevertheless, if you need to google how to exit something, we are approaching vim-meme territory.

Maybe there is possibility to add some "tip"? Or always automatically add new line after code block, when it was inserted?

@Konstantin-Davidneko commented on GitHub: > This is a behavior of CKEditor and I want to avoid changing the behavior of it as much as possible. I totally understand that. Nevertheless, if you need to google how to exit something, we are approaching vim-meme territory. Maybe there is possibility to add some "tip"? Or always automatically add new line after code block, when it was inserted?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TriliumNext/Trilium#1754
No description provided.