[GH-ISSUE #6749] [Bug] Code block navigation with keys and mouse-clicks isn't standard #2972

Closed
opened 2026-03-23 21:26:34 +00:00 by mirror · 1 comment
Owner

Originally created by @moojet on GitHub (Nov 8, 2024).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/6749

Bug Description

Navigating & clicking in a code block don't follow apparent norms.

Other similar apps do this (in a code block):

1-click : places the cursor
2-click : selects the word
3-click : selects the line

VScode does this:

1-click : places the cursor
2-click : selects the word
3-click : selects the line
4-click : Selects the whole code block

AppFlowy does this:

1-click : places the cursor
2-click : selects the word
3-click : selects the entire code block
4-click : un-selects everything

In the same genre, [command] + {arrows}, could be improved.

Other similar apps (in code block) & VScode both do this:

[command + left]: far left of current line
[command + right]: far right of current line
[command + top]: top of code block
[command + bottom]: bottom of code block

AppFlowy does this:

[command + top] or [command + left]: top of code block
[command + bottom] or [command + right]: bottom of code block

How to Reproduce

Create a code block and add a few lines, with line breaks.

  1. 3-click in a word.
  2. 4-click in a word.
  3. 1-click in the middle of a line, in the middle of the code block. [command + left]
  4. 1-click in the middle of a line, in the middle of the code block. [command + right]

Expected Behavior

  1. Should select the current line.
  2. Should select the entire current code block.
  3. Cursor should go to far left of current line.
  4. Cursor should go to far right of current line.

Operating System

Mac OS 15.1

AppFlowy Version(s)

0.7.2

Screenshots

No response

Additional Context

We have a list of commands in code blocks and often want to select a couple of lines, not the whole block.

Originally created by @moojet on GitHub (Nov 8, 2024). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/6749 ### Bug Description Navigating & clicking in a code block don't follow apparent norms. Other similar apps do this (in a code block): ``` 1-click : places the cursor 2-click : selects the word 3-click : selects the line ``` VScode does this: ``` 1-click : places the cursor 2-click : selects the word 3-click : selects the line 4-click : Selects the whole code block ``` AppFlowy does this: ``` 1-click : places the cursor 2-click : selects the word 3-click : selects the entire code block 4-click : un-selects everything ``` In the same genre, [command] + {arrows}, could be improved. Other similar apps (in code block) & VScode both do this: ``` [command + left]: far left of current line [command + right]: far right of current line [command + top]: top of code block [command + bottom]: bottom of code block ``` AppFlowy does this: ``` [command + top] or [command + left]: top of code block [command + bottom] or [command + right]: bottom of code block ``` ### How to Reproduce Create a code block and add a few lines, with line breaks. 1. 3-click in a word. 2. 4-click in a word. 3. 1-click in the middle of a line, in the middle of the code block. [command + left] 4. 1-click in the middle of a line, in the middle of the code block. [command + right] ### Expected Behavior 1. Should select the current line. 2. Should select the entire current code block. 3. Cursor should go to far left of current line. 4. Cursor should go to far right of current line. ### Operating System Mac OS 15.1 ### AppFlowy Version(s) 0.7.2 ### Screenshots _No response_ ### Additional Context We have a list of commands in code blocks and often want to select a couple of lines, not the whole block.
Author
Owner

@annieappflowy commented on GitHub (Sep 23, 2025):

Our block is treated as one line. Following VSCode will change our underlying logic.

<!-- gh-comment-id:3322742647 --> @annieappflowy commented on GitHub (Sep 23, 2025): Our block is treated as one line. Following VSCode will change our underlying logic.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#2972
No description provided.