zed icon indicating copy to clipboard operation
zed copied to clipboard

Outline Panel items have flickering effect when typing

Open bobby-sills opened this issue 1 year ago • 2 comments

Check for existing issues

  • [X] Completed

Describe the bug / provide steps to reproduce it

When selecting an item in the outline panel, and then typing in the editor, the currently selected item turns the "selected color" whenever a key is pressed, and reverts back to its normal color when it's not. Edit: It only happens when you're adding new characters to the end of a function/method.

https://github.com/user-attachments/assets/a80e4bcb-a959-42ed-8862-ea1826870830

Environment

Zed: v0.147.2 (Zed) OS: Linux X11 linuxmint 21.3 Memory: 14.3 GiB Architecture: x86_64 GPU: AMD Unknown (RADV GFX1103_R1) || radv || Mesa 23.2.1-1ubuntu3.1~22.04.2

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

bobby-sills avatar Aug 08 '24 06:08 bobby-sills

cc @SomeoneToIgnore

JosephTLyons avatar Aug 09 '24 18:08 JosephTLyons

An interesting edge-case, happens with Python on the edges of the function definitions (and other indent-based languages, I believe).

https://github.com/zed-industries/zed/pull/16512 introduces a debounce timeout on position revealing and makes it more lenient.

I can see almost no flickering after that, albeit most of the time when the very end of the function is appended, I see no function selected in the outline panel. Maybe that can be a better compromise?

SomeoneToIgnore avatar Aug 25 '24 22:08 SomeoneToIgnore

https://github.com/zed-industries/zed/pull/20031 should have improved things on this front.

We still flicker when adding a newline, seems to be due to the way tree-sitter grammars capture function blocks for Python. But after you start editing the line, it does not flicker anymore:

https://github.com/user-attachments/assets/1d09fdd0-150a-42e4-8753-36c28363a65d

I think this is more or less good now, so I'll close the issue, but let's discuss it more if you think something is very broken still.

SomeoneToIgnore avatar Oct 31 '24 14:10 SomeoneToIgnore

This fix looks great, thanks!

On Thu, Oct 31, 2024, 9:41 PM Kirill Bulatov @.***> wrote:

#20031 https://github.com/zed-industries/zed/pull/20031 should have improved things on this front.

We still flicker when adding a newline, seems to be due to the way tree-sitter grammars capture function blocks for Python. But after you start editing the line, it does not flicker anymore:

https://github.com/user-attachments/assets/1d09fdd0-150a-42e4-8753-36c28363a65d

I think this is more or less good now, so I'll close the issue, but let's discuss it more if you think something is very broken still.

— Reply to this email directly, view it on GitHub https://github.com/zed-industries/zed/issues/15956#issuecomment-2450059216, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKKXCONDC3R2O5CCPWLUGLZ6I6RDAVCNFSM6AAAAABMFYQD4CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJQGA2TSMRRGY . You are receiving this because you authored the thread.Message ID: @.***>

bobby-sills avatar Oct 31 '24 14:10 bobby-sills