do not add fnames to the completions more than once; removed local version of completions list

This commit is contained in:
2021-06-21 15:12:05 +02:00
parent 00803262f8
commit f1a860a28b

View File

@ -13,7 +13,7 @@ class Files(Column):
def __init__(self, folder, title="Files", name=None, sizing_mode="stretch_width"):
self.folder = folder = Path(folder)
self.files = files = [str(i.relative_to(folder)) for i in folder.rglob("*")]
files = [str(i.relative_to(folder)) for i in folder.rglob("*")]
lbl = Div(text=title)
adjust_margin(lbl, bottom=-10)
@ -38,8 +38,9 @@ class Files(Column):
print("empty filename")
return
self.files.append(fn)
self.ai_fname.completions.append(fn)
compl = self.ai_fname.completions
if fn not in compl:
compl.append(fn)
fn = self.folder / fn