Navigating lines in a code block with Up/Down keys does not work properly.

Describe the bug

When inside a multiline code block, using Up or Down key does not lead to the next line in code block, but skips it completely and text pointer skip to the neares block next to the code block (previous or next, accordingy).

To Reproduce

    1. Create a page with a code block that contains at least three lines (could be two if testing only one direction).
    1. Make sure there are some blocks before or after the code block.
    1. Place text cursor in the middle line of code block.
    1. Press Up or Down key.
    1. Text cursor will skip the remaing lines of code and go to the previous/next block.

Expected behavior

Navigating lines with Up and Down keys should work inside of code block.

  • OS: Windows 10

Desktop (please complete the following information):

  • Device: HP 840 G5
  • Version: 0.16.8

Additional context

Since I cannot upload a file, here is a link to imgur: https://imgur.com/POeHcOn

In the recording I am placing text cursor in the middle line and pressing Up/Down once, then mouse clicking to get text cursor back to the middle line.

3 Likes

The behavior is a bit stranger than that. You can surely go all the way down with no issues but you can go up only once and that is if you are on the last line in the code block. After going up once (or if the cursor is not on the last line), when you press the up arrow key, the cursor jumps to the line above the code block.

By the way, when I say the cursor is on the last line, I mean it is at the end of the last line. It will not work otherwise.

Windows 10, Anytype 0.16.8.

2 Likes

@Tymoteusz Thank you for your notice! It’s the known problem, I added your case in our issue.

It seems there is a similar problem in multiline text blocks (line breaks made with shift+enter). Sorry if you already know this too!

1 Like

@Kirill_Lem @Tymoteusz Yes, I am not sure as to whether it would be appropriate to create a new thread for this but this behavior is not specific to code blocks.

    1. Create a document.
    1. Type something.
    1. Create a new block of text.
    1. You cannot go up/down in lines between the two blocks. It is as if there is a barrier in between blocks of text that prevents you from switching from a block to another one. (Does not happen all the time)

Well, this actually was resolved when I closed and reopened the document but the strange behavior is still there. [Check out the screen recording.](https://i.imgur.com/VoaqLuc.mp4)

By the way, wouldn’t it be more appropriate to have this thread under Navigation instead of Desktop UI/UX?

It depends on whether you think of “Navigation” to mean within documents and the editing experience as well as the more common between documents and throughout the app. Navigation would generally refer to how you “get around”, e.g. home, back/forward, jump to page, etc. I would call this “Editing” if there was a category for that, and if not, then a more generic “UI/UX”. But I can see why it feels like “navigation” as well.