Skip to content

Commit

Permalink
Fix condition to skip completions
Browse files Browse the repository at this point in the history
  • Loading branch information
taichimaeda committed Apr 21, 2024
1 parent 105443f commit a0daaf3
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion src/api/clients/openai-compatible.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ export abstract class OpenAICompatibleAPIClient implements APIClient {
return this.generator.parseResponse(content);
} catch (error) {
console.error(error);
console.log(JSON.stringify(error));
new Notice(
'Failed to fetch completions. Make sure your API key or API URL is correct.',
);
Expand Down
3 changes: 0 additions & 3 deletions src/api/proxies/ignored-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ export class IgnoredFilter implements APIClient {
tagRegex.trim() !== '' &&
new RegExp(tagRegex, 'gm').test(content),
);
console.log('tags', settings.completions.ignoredTags);
console.log('isIgnoredFile', isIgnoredFile);
console.log('hasIgnoredTags', hasIgnoredTags);
if (isIgnoredFile || hasIgnoredTags) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/editor/listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function showCompletions(fetcher: CompletionsFetcher) {
// This helps prevent showing completions when opening a new document.
const prefix = state.sliceDoc(0, head);
const suffix = state.sliceDoc(head, length);
if (prefix === '') {
if (prefix.trim() === '') {
return;
}

Expand Down
1 change: 0 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,6 @@ export default class Markpilot extends Plugin {
const { settings } = this;

const fetcher = async (prefix: string, suffix: string) => {
console.log('fetcher');
if (!this.settings.completions.enabled) {
return;
}
Expand Down

0 comments on commit a0daaf3

Please sign in to comment.