Skip to content

Commit

Permalink
Better autocomplete for licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 17, 2024
1 parent 9cf1025 commit f8fdd90
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/vue/EditSnippet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,12 @@ export default {
if (license === '') {
this.results = this.suggestions;
} else {
this.results = this.suggestions.filter(name => name.toLowerCase().includes(license.toLowerCase()));
const words = license.split(' ');
let results = this.suggestions;
for (const word of words) {
results = results.filter(name => name.toLowerCase().includes(word.toLowerCase()));
}
this.results = results;
}
},
fillLicense(result) {
Expand Down

0 comments on commit f8fdd90

Please sign in to comment.