Skip to content

Commit

Permalink
🔥 🐛 Disable auto-suggester for now; see #20
Browse files Browse the repository at this point in the history
  • Loading branch information
ebullient committed Aug 7, 2024
1 parent b5c8ccb commit e9aaba5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
44 changes: 22 additions & 22 deletions src/slidesExtended-Plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { addIcon, Plugin, TAbstractFile } from 'obsidian';
import { SlidesExtendedSettings } from './@types';
import { RevealServer } from './reveal/revealServer';
import { ObsidianUtils } from './obsidian/obsidianUtils';
import { AutoCompleteSuggest } from './obsidian/suggesters/AutoCompleteSuggester';
// import { AutoCompleteSuggest } from './obsidian/suggesters/AutoCompleteSuggester';
import {
REVEAL_PREVIEW_VIEW,
RevealPreviewView,
} from './reveal/revealPreviewView';
import { LineSelectionListener } from './obsidian/suggesters/lineSelectionListener';
// import { LineSelectionListener } from './obsidian/suggesters/lineSelectionListener';
import {
DEFAULT_SETTINGS,
ICON_DATA,
Expand All @@ -22,7 +22,7 @@ export class SlidesExtendedPlugin extends Plugin {
obsidianUtils: ObsidianUtils;

private revealServer: RevealServer;
private autoCompleteSuggester: AutoCompleteSuggest;
// private autoCompleteSuggester: AutoCompleteSuggest;
private target: TAbstractFile;
private slideProcessor: EmbeddedSlideProcessor;

Expand Down Expand Up @@ -59,9 +59,9 @@ export class SlidesExtendedPlugin extends Plugin {
this.registerEvent(
this.app.vault.on('modify', this.onChange.bind(this)),
);
this.registerEditorSuggest(
new LineSelectionListener(this.app, this),
);
// this.registerEditorSuggest(
// new LineSelectionListener(this.app, this),
// );

addIcon('slides', ICON_DATA);
addIcon('refresh', REFRESH_ICON);
Expand Down Expand Up @@ -115,14 +115,14 @@ export class SlidesExtendedPlugin extends Plugin {
}

layoutReady = async () => {
this.autoCompleteSuggester = new AutoCompleteSuggest(this.app);
// this.autoCompleteSuggester = new AutoCompleteSuggest(this.app);

if (this.settings.autoComplete == 'always') {
this.autoCompleteSuggester.activate();
} else {
this.autoCompleteSuggester.deactivate();
}
this.registerEditorSuggest(this.autoCompleteSuggester);
// if (this.settings.autoComplete == 'always') {
// this.autoCompleteSuggester.activate();
// } else {
// this.autoCompleteSuggester.deactivate();
// }
// this.registerEditorSuggest(this.autoCompleteSuggester);

await this.initServer();
};
Expand Down Expand Up @@ -156,21 +156,21 @@ export class SlidesExtendedPlugin extends Plugin {
const instance = this.getViewInstance();
if (instance) {
this.app.workspace.detachLeavesOfType(REVEAL_PREVIEW_VIEW);
if (this.settings.autoComplete == 'inPreview') {
this.autoCompleteSuggester.deactivate();
}
// if (this.settings.autoComplete == 'inPreview') {
// this.autoCompleteSuggester.deactivate();
// }
} else {
if (this.settings.autoComplete != 'never') {
this.autoCompleteSuggester.activate();
}
// if (this.settings.autoComplete != 'never') {
// this.autoCompleteSuggester.activate();
// }
await this.showView();
}
}

hideView() {
if (this.settings.autoComplete == 'inPreview') {
this.autoCompleteSuggester.deactivate();
}
// if (this.settings.autoComplete == 'inPreview') {
// this.autoCompleteSuggester.deactivate();
// }
}

async showView() {
Expand Down
24 changes: 12 additions & 12 deletions src/slidesExtended-SettingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,18 +103,18 @@ export class SlidesExtendedSettingTab extends PluginSettingTab {
}),
);

new Setting(containerEl)
.setName('Auto complete')
.setDesc('Do you want to auto-complete inputs?')
.addDropdown(cb => {
cb.addOption('always', 'Always')
.addOption('inPreview', 'only in slide preview')
.addOption('never', 'Never')
.setValue(this.newSettings.autoComplete)
.onChange(value => {
this.newSettings.autoComplete = value;
});
});
// new Setting(containerEl)
// .setName('Auto complete')
// .setDesc('Do you want to auto-complete inputs?')
// .addDropdown(cb => {
// cb.addOption('always', 'Always')
// .addOption('inPreview', 'only in slide preview')
// .addOption('never', 'Never')
// .setValue(this.newSettings.autoComplete)
// .onChange(value => {
// this.newSettings.autoComplete = value;
// });
// });

new Setting(containerEl)
.setName('Export directory')
Expand Down

0 comments on commit e9aaba5

Please sign in to comment.