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

Unrelated doc changes can remove the completion #5

Open
mscolnick opened this issue Feb 18, 2025 · 0 comments
Open

Unrelated doc changes can remove the completion #5

mscolnick opened this issue Feb 18, 2025 · 0 comments

Comments

@mscolnick
Copy link

Some docs changes (like adding decorations for linting or adjusting the height) will remove the completion. It might be better to only remove the suggestion on doc changes or selection changes.

Here is my patch that i've used:

diff --git a/dist/extension.js b/dist/extension.js
index 85ae3900124b575165fc4891e271c97bc1485b5e..7c3385b5381d0aaa4183cc2d293643a046ac2caa 100644
--- a/dist/extension.js
+++ b/dist/extension.js
@@ -12,6 +12,7 @@ const u = p.define({
     const e = n.effects.find(
       (s) => s.is(l)
     );
+    if (!n.docChanged && !e && !n.selection) return t;
     return n.state.doc && e && n.state.doc == e.value.doc ? { suggestion: e.value.text } : { suggestion: null };
   }
 }), l = S.define();
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

1 participant