Ctrl+7 (opening Code Block) should set focus to the Code Block #1600

Closed
opened 2026-02-05 01:22:54 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @Biepa on GitHub (Mar 18, 2020).

Describe the feature you'd like
When I edit a page and want to insert a new code block I press ctrl+7.
Then i start typing, but the cursor is still typing on the main page in the background, so everytime I have to take my mouse to focus the code block. So an automatic focus, would be nice.

Edit: Maybe also an option to save the code block with a shortcut would also help (ctrl + Enter, maybe?).

Describe the benefits this feature would bring to BookStack users
Faster creating and editing with code blocks -> better experience

Originally created by @Biepa on GitHub (Mar 18, 2020). **Describe the feature you'd like** When I edit a page and want to insert a new code block I press ctrl+7. Then i start typing, but the cursor is still typing on the main page in the background, so everytime I have to take my mouse to focus the code block. So an automatic focus, would be nice. Edit: Maybe also an option to save the code block with a shortcut would also help (ctrl + Enter, maybe?). **Describe the benefits this feature would bring to BookStack users** Faster creating and editing with code blocks -> better experience
OVERLORD added the 🛠️ Enhancement📝 WYSIWYG Editor💆 UX💻 Front-End labels 2026-02-05 01:22:54 +03:00
Author
Owner

@Biepa commented on GitHub (Mar 21, 2020):

To make the workflow perfect.
After closing the code-block editor it would be cool, if the cursor would be behind the inserted code-block.

@Biepa commented on GitHub (Mar 21, 2020): To make the workflow perfect. After closing the code-block editor it would be cool, if the cursor would be behind the inserted code-block.
Author
Owner

@ssddanbrown commented on GitHub (Apr 6, 2020):

Thank you for the suggestion @Biepa.

I have just implemented some updates, these will be release in v0.29. I've ensured the whole code-insert flow can be done via keyboard, So:

  • Code editor in popup will gain focus on enter.
  • Code in editor can be saved using ctrl+enter.
  • WYSIWYG page editor will get back focus on save.

The last step, page editor refocus, can be a bit quirky. It mostly lands the cursor at the start of the code block but in some cases, such as when immediately after another code block, it can jump to the start.

@ssddanbrown commented on GitHub (Apr 6, 2020): Thank you for the suggestion @Biepa. I have just implemented some updates, these will be release in v0.29. I've ensured the whole code-insert flow can be done via keyboard, So: - Code editor in popup will gain focus on enter. - Code in editor can be saved using `ctrl+enter`. - WYSIWYG page editor will get back focus on save. The last step, page editor refocus, can be a bit quirky. It mostly lands the cursor at the start of the code block but in some cases, such as when immediately after another code block, it can jump to the start.
Author
Owner

@Biepa commented on GitHub (Apr 26, 2020):

Just wanted to give feedback, that this change made editing a lot easier when only using the keyboard. Thanks

@Biepa commented on GitHub (Apr 26, 2020): Just wanted to give feedback, that this change made editing a lot easier when only using the keyboard. Thanks
Author
Owner

@ssddanbrown commented on GitHub (Apr 27, 2020):

No problem @Biepa, Thanks for the idea. It's these kind of low-level improvements that have a big beneift for users on a day-to-day basis!

@ssddanbrown commented on GitHub (Apr 27, 2020): No problem @Biepa, Thanks for the idea. It's these kind of low-level improvements that have a big beneift for users on a day-to-day basis!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1600