#58 - new behavior

Omnisearch no longer register extensions, PDFs are indexed after plaintext files, updated settings descriptions
This commit is contained in:
Simon Cambier
2022-10-01 13:58:11 +02:00
parent 7dc01ecc8f
commit 124e5f5d61
6 changed files with 61 additions and 36 deletions

View File

@@ -6,7 +6,7 @@ import { eventBus } from './globals'
import { registerAPI } from '@vanakat/plugin-api'
import api from './api'
import { loadSearchHistory } from './search-history'
import {isFileIndexable, showWelcomeNotice} from './utils'
import {isFilePlaintext, showWelcomeNotice} from './utils'
import { addNoteToReindex, addToIndex, removeFromIndex } from './notes-index'
function _registerAPI(plugin: OmnisearchPlugin): void {
@@ -22,10 +22,7 @@ export default class OmnisearchPlugin extends Plugin {
// additional files to index by Omnisearch
await loadSettings(this)
this.registerExtensions(settings.indexedFileTypes, 'markdown')
await loadSearchHistory()
_registerAPI(this)
if (settings.ribbonIcon) {
@@ -75,7 +72,7 @@ export default class OmnisearchPlugin extends Plugin {
)
this.registerEvent(
this.app.vault.on('rename', async (file, oldPath) => {
if (file instanceof TFile && isFileIndexable(file.path)) {
if (file instanceof TFile && isFilePlaintext(file.path)) {
removeFromIndex(oldPath)
await addToIndex(file)
}