do not add fnames to the completions more than once; removed local version of completions list
This commit is contained in:
@ -13,7 +13,7 @@ class Files(Column):
|
|||||||
|
|
||||||
def __init__(self, folder, title="Files", name=None, sizing_mode="stretch_width"):
|
def __init__(self, folder, title="Files", name=None, sizing_mode="stretch_width"):
|
||||||
self.folder = folder = Path(folder)
|
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)
|
lbl = Div(text=title)
|
||||||
adjust_margin(lbl, bottom=-10)
|
adjust_margin(lbl, bottom=-10)
|
||||||
@ -38,8 +38,9 @@ class Files(Column):
|
|||||||
print("empty filename")
|
print("empty filename")
|
||||||
return
|
return
|
||||||
|
|
||||||
self.files.append(fn)
|
compl = self.ai_fname.completions
|
||||||
self.ai_fname.completions.append(fn)
|
if fn not in compl:
|
||||||
|
compl.append(fn)
|
||||||
|
|
||||||
fn = self.folder / fn
|
fn = self.folder / fn
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user