boltex / leojs

Leo Literate Editor with Outline in Typescript
https://boltex.github.io/leojs/
MIT License
28 stars 1 forks source link

Alt-N, goto-next-clone, does not select proper body text #61

Closed edreamleo closed 9 months ago

edreamleo commented 9 months ago

This is a serious bug that might lead to corrupted data.

Using LeoJS in vscode.dev:

It appears that the body text is the text of the node's parent.

boltex commented 9 months ago

@edreamleo Hmm, I cannot reproduce this bug. I did it with LeoPyRef exactly like you suggested... weird.

Perhaps you could grab screenshot, or setup a zoom session if you can reproduce the bug reliably?

edreamleo commented 9 months ago

On Mon, Dec 11, 2023 at 7:18 PM Felix @.***> wrote:

Perhaps you could grab screenshot, or setup a zoom session if you can reproduce the bug reliably?

I definitely can reproduce this both with desktop vs-code and vscode.dev on Microsoft Edge.

In both cases, I have enabled LeoJS and disabled LeoInteg. To reproduce:

The problem doesn't always happen, but it usually does. Screenshot below. The outline pane highlights the node BaseText.make_data, but the body pane contains the text of the top-level "Code" node.

BTW, the tab name 'LEOJS: BODY' is useless. It would be much better to have it display c.p.h.

I would be happy to zoom about this.

Edward

[image: image.png]

edreamleo commented 9 months ago

I definitely can reproduce this both with desktop vs-code and vscode.dev on Microsoft Edge.

In both cases, I have enabled LeoJS and disabled LeoInteg.

I just re-enabled LeoInteg. I get the same failure with desktop vs-code.

Edward

boltex commented 9 months ago

@edreamleo Thanks for showing me a reproduction of the bud. I've just noticed also that Leo actually allows you to do this command on a non-clone node, in which case it just does a 'find next clone'.

I'll start by fixing this behavior to match Leo and go on from this to make more experiments to try to squash this bug.

edreamleo commented 9 months ago

On Sat, Dec 16, 2023 at 1:25 PM Felix @.***> wrote:

@edreamleo https://github.com/edreamleo Thanks for showing me a reproduction of the bud. I've just noticed also that Leo actually allows you to do this command on a non-clone node, in which case it just does a 'find next clone'.

You're welcome.

I'll start by fixing this behavior to match Leo and go on from this to make more experiments to try to squash this bug.

Happy hunting :-)

Edward

boltex commented 9 months ago

@edreamleo the devel branch now has a possible fix. Can you try it out on your machine ? (I'll send you a pre-packaged extension file if you prefer)

boltex commented 9 months ago

@edreamleo I just found a way to reproduce it reliably on my machine: the other (target) clone to be navigated-to has to be hidden in a collapsed part of the tree.

The goto-next-marked command has the same problem. I'm near finding the exact source of the problem for those command refresh-ui resolution bugs.

edreamleo commented 9 months ago

@boltex I've pulled devel. How do I test the code?

boltex commented 9 months ago

Just by launching the debugger with F5. But no need to do so now because I've found a way to reproduce! So dont bother since I can now test reliably by myself. (I proposed that you tried it out because i could not reproduce the bug earlier.. hehe.)

edreamleo commented 9 months ago

@boltex Alright. I'll leave you to it. Good luck!

boltex commented 9 months ago

Fixed in #70 Now live as version 0.2.4 :partying_face:

edreamleo commented 9 months ago

@boltex The fix works for me on both vs-code and vscode.dev.