mirror of
https://github.com/dnlbauer/obsidian-dataview-autocompletion.git
synced 2026-09-10 14:15:29 +00:00
fix: fix addind a deleted value to index not working
This commit is contained in:
@@ -190,8 +190,8 @@ export class DataviewSuggester extends EditorSuggest<String> {
|
|||||||
|
|
||||||
extractCompositeValuesFromPage(page: DataObject): string[] {
|
extractCompositeValuesFromPage(page: DataObject): string[] {
|
||||||
const fields = Object.keys(page)
|
const fields = Object.keys(page)
|
||||||
.filter((k) => k !== "file")
|
.filter((k) => k !== "file")
|
||||||
.map((k) => [k, page[k]]);
|
.map((k) => [k, page[k]]);
|
||||||
|
|
||||||
const compositeValues: string[] = [];
|
const compositeValues: string[] = [];
|
||||||
|
|
||||||
@@ -294,7 +294,10 @@ export class DataviewSuggester extends EditorSuggest<String> {
|
|||||||
|
|
||||||
// adding value to index if not present in index
|
// adding value to index if not present in index
|
||||||
for (const newCompositeValue of updateCompositeValues) {
|
for (const newCompositeValue of updateCompositeValues) {
|
||||||
if (!this.suggestionsRefCount.has(newCompositeValue)) {
|
if (
|
||||||
|
!this.suggestionsRefCount.has(newCompositeValue) ||
|
||||||
|
this.suggestionsRefCount.get(newCompositeValue) === 0
|
||||||
|
) {
|
||||||
// not seen in this or other files
|
// not seen in this or other files
|
||||||
this.suggestionsList.push(newCompositeValue);
|
this.suggestionsList.push(newCompositeValue);
|
||||||
this.suggestionsRefCount.set(newCompositeValue, 1);
|
this.suggestionsRefCount.set(newCompositeValue, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user