fix: skip the autocompletion debounce when the document shrank past the captured position (#28824)

This commit is contained in:
G30 2026-08-22 08:12:40 -04:00 • committed by GitHub
parent d1c207d091
commit 302ffc8b7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,6 +86,7 @@ export const AIAutocompletion = Extension.create({
const newState = view.state;
const newSelection = newState.selection;
if (currentPos >= newState.doc.content.size) return false;
const newNode = newState.doc.nodeAt(currentPos);
// Check if the node still exists and is still a paragraph