Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Janky behaviour while typing #673

Closed
orestis opened this issue Jun 16, 2020 · 4 comments
Closed

Janky behaviour while typing #673

orestis opened this issue Jun 16, 2020 · 4 comments
Labels
highlight Syntax highlighting, rainbow parens, such things

Comments

@orestis
Copy link

orestis commented Jun 16, 2020

I posted this in Slack and want to preserve here so that it doesn't get lost:

ezgif-com-crop

There's two issues here:

  1. The flickering (showing, then hiding) of the bracket highlights as you type
  2. Typing a character in require starts off as blue then quickly turns red.

I have confirmed that native VSCode (with Calva disabled) doesn't exhibit any of the behaviours, but of course you get VSCode's bracket matching which is weird.

The machine this runs on is from 2014 so VSCode is a bit sluggish anyway, but I think at least the bracket highlighting could be after a short delay to make sure typing stabilises.

@bpringe
Copy link
Member

bpringe commented Jun 16, 2020

Thanks for reporting here. I think at least with the bracket highlighting we may need to play with the debounce timing. Currently it's set pretty low (not human noticeable), but there is a short delay. See here:

rainbowTimer = setTimeout(updateRainbowBrackets, 16);

I'm not sure about the require coloring without digging in though. But hopefully we can find some way to smooth all of this out like you say.

@bpringe bpringe added highlight Syntax highlighting, rainbow parens, such things parsing labels Jun 16, 2020
@PEZ
Copy link
Collaborator

PEZ commented Jun 16, 2020

Debounce might help, but I think the bracket matching highlight going on looks wrong. Calva only highlights brackets when the cursor is outside. In the OP gif it seems that some highlighting is going on from the inside...

@PEZ
Copy link
Collaborator

PEZ commented Jun 17, 2020

So... this would happen if the highlighting was applied on the old text, with the new cursor position, right?

@PEZ
Copy link
Collaborator

PEZ commented Jun 17, 2020

I took @bpringe's clue about how we defer the rainbows a bit and applied to my hunch about the problem being a that we matched on the wrong version of the document. Seems to have been the right diagnosis.

Can you take this VSIX for a spin, @orestis and see what remains of the problem, if any?

https://6443-125431277-gh.circle-artifacts.com/0/tmp/artifacts/calva-2.0.107-fix-flicker-matching-brackkets-a5af01c1.vsix

@PEZ PEZ closed this as completed in a5af01c Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
highlight Syntax highlighting, rainbow parens, such things
Projects
None yet
Development

No branches or pull requests

3 participants