How to use @atom/fuzzy-native - 2 common examples

To help you get started, we’ve selected a few @atom/fuzzy-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github atom / fuzzy-finder / lib / fuzzy-finder-view.js View on Github external
atom.config.observe('fuzzy-finder.scoringSystem', (newValue) => {
        this.scoringSystem = newValue

        if (this.scoringSystem === SCORING_SYSTEMS.STANDARD) {
          this.selectListView.update({filter: null})
        } else if (this.scoringSystem === SCORING_SYSTEMS.FAST) {
          if (!this.nativeFuzzy) {
            this.nativeFuzzy = new NativeFuzzy.Matcher(this.items.map(el => el.label))

            // We need a separate instance of the fuzzy finder to calculate the
            // matched paths only for the returned results. This speeds up considerably
            // the filtering of items.
            this.nativeFuzzyForResults = new NativeFuzzy.Matcher([])
          }

          this.selectListView.update({ filter: this.filterFn })
        } else {
          this.selectListView.update({ filter: this.filterFn })
        }

        this.updateExperimentPrompt()
      })
    )
github atom / fuzzy-finder / lib / fuzzy-finder-view.js View on Github external
atom.config.observe('fuzzy-finder.scoringSystem', (newValue) => {
        this.scoringSystem = newValue

        if (this.scoringSystem === SCORING_SYSTEMS.STANDARD) {
          this.selectListView.update({filter: null})
        } else if (this.scoringSystem === SCORING_SYSTEMS.FAST) {
          if (!this.nativeFuzzy) {
            this.nativeFuzzy = new NativeFuzzy.Matcher(this.items.map(el => el.label))

            // We need a separate instance of the fuzzy finder to calculate the
            // matched paths only for the returned results. This speeds up considerably
            // the filtering of items.
            this.nativeFuzzyForResults = new NativeFuzzy.Matcher([])
          }

          this.selectListView.update({ filter: this.filterFn })
        } else {
          this.selectListView.update({ filter: this.filterFn })
        }

        this.updateExperimentPrompt()
      })
    )

@atom/fuzzy-native

Native C++ implementation of a fuzzy string matcher.

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular @atom/fuzzy-native functions