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

Flickering display on input from plugin #131

Open
martinjo opened this issue Nov 5, 2024 · 2 comments
Open

Flickering display on input from plugin #131

martinjo opened this issue Nov 5, 2024 · 2 comments
Labels
bug Something isn't working released

Comments

@martinjo
Copy link

martinjo commented Nov 5, 2024

Hi!

I'm writing a small plugin to generate text into the editor using ai. When I update the text in the editor it flickers. It looks like the text appears several times. This happens until the text generation is stopped and no more text is inserted, then the editor will display the final text as intended.

Any idea what could be the cause?

I tried to wait until I have 50 characters in the buffer and it makes the problem a bit less obvious, but it's still there.

 try {
              textBuffer += content;
              
              // Only update when we have accumulated enough characters
              if (textBuffer.length >= 50) {
                  carta.input?.insertAt(position, textBuffer);
                  position += textBuffer.length;
                  carta.input?.update();
                  textBuffer = ''; // Reset the text buffer
              }
          }
      } catch (e) {
          console.warn('Failed to parse line:', line);
          continue;
}
Skarminspelning.2024-11-05.kl.19.59.35.mov
@BearToCode BearToCode added the bug Something isn't working label Nov 6, 2024
@BearToCode
Copy link
Owner

Hello, thanks for reporting this issue. It shoud be fixed in the version about to be published. Let me know!

Copy link

github-actions bot commented Nov 6, 2024

🎉 This issue has been resolved in version carta-md-v4.6.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants