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

Strange behavior in editor - adding/deleting extra characters, flagging #103

Closed
wch opened this issue Jan 26, 2024 · 2 comments
Closed

Strange behavior in editor - adding/deleting extra characters, flagging #103

wch opened this issue Jan 26, 2024 · 2 comments

Comments

@wch
Copy link
Collaborator

wch commented Jan 26, 2024

With the editor in Shinylive for Python, in some cases it will add or delete extra characters, or show text that isn't really there.

In the video below, there is some code that has very weird syntax -- it calls a function using a named argument before using the spread operator on a list. In the recording, I try to move the cursor one step at at a time, and then add commas and delete them one at a time. Then when I move the cursor, it shows some of the text duplicated, and then it goes away.

shinylive-weird-compressed.mp4
def f(a, *args, z):
    return [*args, z]


f(z=2, *[2, 3])

Live example

I am pretty sure this is due Pyright: if I add # type: ignore to the end of that line, then the weird behavior stops.

I think it's also because we are using a very old version of Pyright. I have not been able to reproduce this in VS Code with recent versions of Pylance.

@gadenbuie
Copy link
Contributor

Here's another example. I'm doing something not quite right -- skipping positional, required args -- when things get weird.

Kapture.2024-01-29.at.15.51.48.mp4

@wch
Copy link
Collaborator Author

wch commented May 31, 2024

This has been fixed by #138

@wch wch closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants