Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ data.json

# Exclude macOS Finder (System Explorer) View States
.DS_Store
/.vs
8 changes: 6 additions & 2 deletions src/modules/WidgetExtension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,12 @@ class FloatingWidget extends WidgetType {
return;
}

// Grab the selected text from the stored selection info
const selectedText = this.selectionInfo?.text ?? "";
// Grab the selected text from the stored selection info.
// If nothing was selected, use the entire document as context.
let selectedText = this.selectionInfo?.text ?? "";
if (!selectedText && this.outerEditorView) {
selectedText = this.outerEditorView.state.doc.toString();
}

// Show loader
this.toggleLoading(true);
Expand Down